3

Being authenticated as user1, i'd like to retrieve mails of all the users who have delegated access to user1.

So i have two problems :

  1. Retrieve all the accounts that have delegated access
  2. Retrieve the mails

The emails-settings-API gives acccess to delegates, not delegators.

Is there a way to do that progamatically.

Feel free to ask for more information

Jerome
  • 2,104
  • 1
  • 17
  • 31

1 Answers1

4

To find out who has given you delegated access to their account, you would need to perform the retrieve delegates API call: https://developers.google.com/google-apps/email-settings/#retrieving_all_gmail_delegates

for all users in your Google Apps instance.

Programmatic access to a user's gmail mailbox is provided by IMAP OAuth logins: https://developers.google.com/google-apps/gmail/oauth_overview

However, there is currently no way for a delegate to access a delegators mailbox via IMAP so I'm afraid you're out of luck.

If you are an administrator, you can use IMAP OAuth login along with service accounts: https://developers.google.com/accounts/docs/OAuth2ServiceAccount

this will give you programmatic access to all users in your Google Apps instance.

Jay

Jay Lee
  • 13,415
  • 3
  • 28
  • 59
  • Thanks for the reply. This is indeed a solution, even if i won't be able to use it. It does not scale very well with domain size, and i have not always access to an admin account. – Jerome Nov 22 '12 at 13:33
  • Is this really the only way - unfortunate if this is necessary to just read some emails into a db. Does anyone have a prototype of this handy? – JPH Sep 16 '13 at 13:01