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

Work around Google marking fetched messages as read #13

Open
rtucker opened this issue Mar 1, 2011 · 2 comments
Open

Work around Google marking fetched messages as read #13

rtucker opened this issue Mar 1, 2011 · 2 comments

Comments

@rtucker
Copy link
Owner

rtucker commented Mar 1, 2011

From an e-mail thread:

I've run into the same thing... I don't think it is "intentionally" being marked as read by the script or imaplib, but since the message is being downloaded, Google is marking it as read. I first noticed this around September of last year, if I recall correctly.

It has been awhile since I poked at it, but I think I tried two different approaches to work around this:

  1. Remember the original flags for the message, fetch the message, then set the flags back to the way they were.
  2. Hide the problem by only considering messages marked as "SEEN"

I ended up with the second solution (--search=CRITERIA, default to "SEEN"), in commit a708c65. This seems to work well with my workflow (run it nightly to back up the day's read messages), but revisiting the solution would be a very good idea. -rt

@blocke
Copy link

blocke commented Sep 6, 2011

When attempting to use imap2maildir for the first time on a gmail account with over 3,000 messages with the default "SEEN" criteria only about 200 or so emails were pulled down. Specifying the "OLD" criteria allowed imap2maildir to see the full mailbox. This might be related to the fact the bulk of the 3,000 messages were pulled over from another gmail account via gmail's builtin pop import mechanism and those emails might be tagged differently somehow.

Just an FYI.

@bobbybeever
Copy link

I believe a fetch (BODY.PEEK[]) instead of (RFC822) will do the trick.. Another thing we might want to add for each select(folder) is select(folder, readonly=True) which will execute "EXAMINE" instead of "SELECT" which is basically read/write mode.

Would you like a patch for these changes?

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

3 participants