GmailAttachmentsExtractor icon indicating copy to clipboard operation
GmailAttachmentsExtractor copied to clipboard

WARNING: unable to change permissions for everybody

Open LegoDruid opened this issue 3 years ago • 1 comments

D:\Programs\GmailAttachmentsExtractor>java -jar GmailAttachmentsExtractor.jar --mime-type 'video' has:attachment v Sep 26, 2020 10:19:03 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly WARNING: unable to change permissions for everybody: D:\Programs\GmailAttachmentsExtractor\tokens Sep 26, 2020 10:19:03 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly WARNING: unable to change permissions for owner: D:\Programs\GmailAttachmentsExtractor\tokens

Starting Gmail Attachments Extractor v1.0.0 Parameters: Query string: has:attachment Output directory: D:\Programs\GmailAttachmentsExtractor\v Output labels prefix: Cleanup Attachment filter: MIME type regex: ^('video').*

Labels 'Cleanup [pre]' and/or 'Cleanup [post]' already exist. Running this program when this labels already exist might lead to confusing results. Please provide different output labels prefix and try again. Note that removing those labels is probably not a good solution, as it may prevent you from distinguishing between emails with attachments and its copies without attachments - Terminating.

LegoDruid avatar Sep 27 '20 02:09 LegoDruid

This is normal operation.

1.

WARNING: unable to change permissions for ... is just a warning informing you that the tokens directory, which contains confidential information (tokens that allow access to you gmail account), can't be secured properly (by changing permissions and owner in file system). For all I know it's issue in google-api-client library, and I can't fix it. If you want to get rid of the warning, then run the program under Unix/Linux system. The most important thing though, is that this warning has no negative impact on GmailAttachmentsExtractor operation - the program should work just fine when this warning is displayed.

2.

The reason why your GmailAttachmentsExtractor is terminating prematurely is described in the last line of the output (and in the README). Program creates Cleanup [pre] and Cleanup [post] labels in your gmail account, and marks result of it's execution (emails with attachments removed) with the ... [post] label. To run it again you must remove those lables. But before you remove those labels you probably want to delete all emails marked with one of those labels:

  • Delete all emails marked with ...[post] labels if you want to delete all emails with attachments removed. This is essentially reverting your gmail to the state from before running the extractor.
  • Delete all emails marked with ...[pre] labels if you want to delete all emails with attachments. This will remove attachments from your gmail, freeing disk space.

After you do one of the above, then you can remove ...[pre] and ...[post] labels. And after you remove those labels, you can run the GmailAttachmentsExtractor again. Make sure you read the "WARNING" part in the README, before you start deleting emails.

3.

If you don't want to delete emails before each run, you can use --no-modify-gmail option. This will cause the program to only download attachments, and don't modify your gmail account in any way.

TeWu avatar Sep 27 '20 13:09 TeWu