Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get mails of delegated accounts

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

like image 476
Jerome Avatar asked Sep 12 '25 05:09

Jerome


1 Answers

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

like image 101
Jay Lee Avatar answered Sep 16 '25 08:09

Jay Lee