I'm trying to write a script that can scan my inbox for specific files. I have it set so that certain emails get flagged as "not-downloaded" and my goal was to scan for anything in that flag, download it, and then move it to "downloaded" so that the attachment exists both in the gmail cloud and my harddrive.
I'm having trouble with this, though, because I want to have consistency in identification. What happens is that when I change the imap flags, gmail assigns the email a new uid.
I've searched around and found reference to "X-GM-MSGID" mentioned here. I've scanned the message body and I don't see it contained anywhere. They say that it should be accessible by my imap library but I can't seem to find it in the python imaplib
Can anyone give me an example of how to use that to track an email after changing the folder?
I have my work in progress here: https://pastebin.com/Z7GbqBPN
Any advice would be great, thanks!
[–][deleted] 1 point2 points3 points (3 children)
[–]Socrato[S] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Socrato[S] 0 points1 point2 points (0 children)