Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4110218
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:54:20+00:00 2026-05-20T21:54:20+00:00

I need to get some admin users using google apps gmail the ability to

  • 0

I need to get some admin users using google apps gmail the ability to monitor their employees email. Have you used Google’s Audit API to do this.

I wish there there was a way for the admins to just click a view my users email but that doesn’t be the case.

If it matters the application is a rails app. The email is completely done on googles mail through google apps. Anyone that has done this any advice would be helpful.

Update! 500 points for this one!

I’m using ruby on rails hosting an app on heroku. The email is completely hosted with google apps standard, not business so we will have to upgrade, and the DNS is with zerigo which you already know if you use heroku.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:54:21+00:00Added an answer on May 20, 2026 at 9:54 pm

    Well, I hadn’t planned on extending the gdata-ruby-util gem :), but here’s some code that could be used for the Google Audit API based on Google’s documentation. I only wrote a create_monitor_on method, but the rest are pretty easy to get.

    Let me know if it works or needs any rewrites and I’ll update it here:

        class Audit < GData::Client::Base
    
          attr_accessor :store_at
    
          def initialize(options = {})
            options[:clientlogin_service] ||= 'apps'
            options[:authsub_scope] ||= 'https://apps-apis.google.com/a/feeds/compliance/audit/' 
            super(options)
          end
    
          def create_monitor_on(email_address)
            user_name, domain_name = email_address.split('@')
            entry = <<-EOF
            <atom:entry xmlns:atom='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
            <apps:property name='destUserName' value='#{@store_at}'/>
            <apps:property name='beginDate' value=''/>
            <apps:property name='endDate' value='2019-06-30 23:20'/>
            <apps:property name='incomingEmailMonitorLevel' value='FULL_MESSAGE'/>
            <apps:property name='outgoingEmailMonitorLevel' value='FULL_MESSAGE'/>
            <apps:property name='draftMonitorLevel' value='FULL_MESSAGE'/>
            <apps:property name='chatMonitorLevel' value='FULL_MESSAGE'/>
            </atom:entry>
            EOF
    
            return true if post('https://apps-apis.google.com/a/feeds/compliance/audit/mail/monitor/'+domain_name+'/'+user_name, entry).status_code == 201
            false
          end   
       end
    

    Then use it elsewhere like this:

    auditor = Audit.new
    auditor.store_at = 'this-username'
    auditor.clientlogin(username, password)
    render :success if auditor.create_monitor_on('email-address@my-domain.com')
    

    My suggestion is to create one core email address that all the email monitors are sent to, so your admins’ inboxes aren’t slammed with everyone else’s mail. Then in your Rails app, use Net::IMAP to download the messages you want from that master email account. i.e., you can create a link that says “View Joe’s Email” and the method does something like this:

    require 'net/imap'
    
    imap = Net::IMAP.new('imap.gmail.com', 993, true)
    imap.login('this-username@my-domain.com', password)
    imap.select('INBOX')
    
    messages = []
    imap.search(["TO", "joe@email.com").each do |msg_id|
      msg = imap.fetch(msg_id, "(UID RFC822.SIZE ENVELOPE BODY[TEXT])")[0]
      body = msg.attr["BODY[TEXT]"]
      env = imap.fetch(msg_id, "ENVELOPE")[0].attr["ENVELOPE"]
      messages << {:subject => env.subject, :from => env.from[0].name, :body => body }
    end
    
    imap.logout
    imap.disconnect
    

    Then you can put those messages in your view — or send them all in one bulk email, or whatever you want to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have decided that I really need to get some flowcharts for reverse engineering
I need to get some information that is contained in the MFT on a
I need to get some AVI animations for use with the Borland VCL TAnimate
I need to optimize code to get room for some new code. I do
I need to get the default printer name. I'll be using C# but I
I'm working with C#.net developing applications for windows mobile 6, and i need get
I need to get a log of user access to our SQL Server so
I need to get the first and last day of a month in the
I need to get the name of the machine my .NET app is running
I need to get the value of the 'test' attribute in the xsl:when tag,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.