Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading GMAIL Attachments #234

Closed
carbm1 opened this issue Jan 31, 2022 · 1 comment
Closed

Downloading GMAIL Attachments #234

carbm1 opened this issue Jan 31, 2022 · 1 comment

Comments

@carbm1
Copy link

carbm1 commented Jan 31, 2022

I am attempting to automate updating our annotatedAssetIds on our Chromebooks. The only automated way to export from our asset management system is for it to send us an email with an attachment in either pdf, csv, or excel. I am attempting to download the attachment from the email so I can process it and make changes as necessary.

Unfortunately when I have the attachment sent to me as a CSV or XLSX file the attachment is not displayed when running:
gam user $GoogleAccount show messages query "has:attachment subject:'Chromebook Serial Numbers' from:'do-not-reply@assettiger.com'" showattachments max_to_show 1

The email displays but not the attachment.

If I have the attachment sent as a PDF then it will show and download correctly using this command:
& gam user $GoogleAccount show messages query "has:attachment subject:'Chromebook Serial Numbers' from:'do-not-reply@assettiger.com'" saveattachments overwrite maxtoshow 1 targetfolder "$($currentPath)\temp\Chromebooks"

If I take the original email with the CSV or XLSX and forward it to myself then the attachment will download correctly using the last command.

I'm not sure how to proceed here. It appears that if an email with a CSV or EXCEL attachment is sent from an external email address you can't download the file. However, you can if its a PDF or if you sent it from an internal email address.

Can someone shed some light on the reasons for this behavior?

@taers232c
Copy link
Owner

taers232c commented Jan 31, 2022 via email

@carbm1 carbm1 closed this as completed Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants