GAM-team / GAM

command line management for Google Workspace
https://github.com/GAM-team/GAM/wiki
Apache License 2.0
3.53k stars 473 forks source link

Getting "User: {user name}, Does not exist" when issuing command "gam user {user name} delete messages query rfc822msgid:{Message-ID} doit" #240

Closed ahampel closed 8 years ago

ahampel commented 8 years ago

New issue starting with GAM v.3.7

Full steps to reproduce the issue:

  1. upgrade to GAM v.3.7 (Python 2.7), e.g. from GAM v.3.65 (Using tar.gz version on RHEL 5.x)
  2. python2.7 /opt/google/GAM-3.7/gam.py user {user name}@{domain} delete messages query rfc822msgid:{Message-ID} doit

Expected outcome (what are you trying to do?): Searching messages for {user name}@{domain} Got 1 messages for user {user name}@{domain} deleting 1 messages deleted 1 of 1 messages

Actual outcome (what errors or bad behavior do you see instead?): Searching messages for {user name}@{domain} User: {user name}@{domain}, Does not exist Got 0 messages for user {user name}@{domain} would try to delete 0 messages for user {user name}@{domain} (max 1)

kitgillingham commented 8 years ago

I'm getting the same issue when trying to set a vacation using the command

gam user user@domain.com vacation on subject "auto reply" message "I am not available to respond to your email. \n\nThank you" startdate 2016-09-01 enddate 2016-10-23

Error: User: user@domain.com, Does not exist

Even though running gam user user@domain.com show forward for the same account works!

ahampel commented 8 years ago

Same Issue in 3.71, tested Sep 2, 2016.

kitgillingham commented 8 years ago

This fixed it for me:

To use this version, you must update the list of authorized scopes for your Gam OAuth2 Client and Service Account. Go here: https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile Log on to the admin console as in steps 6.ii.c, d, e. In the list of Authorized API clients, locate your Gam OAuth2 Client, copy the Client ID and then remove the entry. Paste the Client ID into the Client name box as in step 6.ii.f, then do steps 6.ii.g and 6.ii.h. You'll notice that the API Scopes - OAuth2 list has additional entries, these are what is required in Gam 3.7. Skip down to step 6.iii. In the list of Authorized API clients, locate your Gam Service Account, copy the Client ID and then remove the entry. Paste the Client ID into the Client name box as in step 6.iii.c, then do steps 6.iii.d and 6.iii.e. You'll notice that the API Scopes - Service Account list has additional entries, these are what is required in Gam 3.7.

ghost commented 8 years ago

Thanks @kitgillingham it solved the issue

xbrugue commented 8 years ago

Hi, Where is the step 6? I have the same problem with 3.71 (user does not exist) to execute GAM, but I don't see this step in the link https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile

Could you help me? I can't to locate the problem (Paste the Client ID into the Client name box as in step 6.ii.f, then do steps 6.ii.g and 6.ii.h.)

Thanks

Xavi

GI-thub commented 8 years ago

This is the section you need https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile#authorize-the-api-scopes-for-use-with-gam-in-the-admin-console

Graham Ingleby | Google for Work Consultant | +44 1344 203395 | gingleby@ancoris.com [image: Google+] http://google.com/+Ancoris http://www.linkedin.com/company/98835 http://www.ancoris.com http://www.ancoris.com/news-and-views/ancoris-blog/ancoris-receives-uk-cloud-award-for-best-digital-transformation-project.html http://www.ancoris.com/news-and-views/ancoris-blog.html http://www.ancoris.com/news-and-views/ancoris-blog/crn-recognises-ancoris-with-2015-cloud-services-provider-award.html

Powered by Ancoris Signatures https://chrome.google.com/webstore/detail/ancoris-signatures/flgcflgdedfldaeicfjahbhchlpcfkob

On 21 September 2016 at 12:34, xbrugue notifications@github.com wrote:

Hi, Where is the step 6? I have the same problem with 3.71 (user does not exist) to execute GAM, but I don't see this step in the link https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile

Could you help me? I can't to locate the problem (Paste the Client ID into the Client name box as in step 6.ii.f, then do steps 6.ii.g and 6.ii.h.)

Thanks

Xavi

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jay0lee/GAM/issues/240#issuecomment-248585359, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSMz5r88sRE98gQ60y7XGRDyeNmiFpwks5qsRZXgaJpZM4Jo4z8 .


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ


ahampel commented 8 years ago

The unfortunate timing of the re-vamped documentation structure made kitgillingham's fix hard to follow. To mitigate the risk of "breaking" GAM's functionality, I resorted to creating a new (parallel) Google Project with a new set of Credentials, as described in the HowTo. The old project (and Creds) will eventually be retired once testing of the new GAM versions' functionality has succeeded. As there are now two possible "fixes" to this issue, it is now time to close it. Thanks to all who participated in this thread.

hatim-1 commented 6 years ago

hello dear

there is some ways to filter bounce email with gam from gsuite ?