Red Hat Bugzilla – Bug 483771
imap retriever marks mail as read
Last modified: 2009-02-04 10:52:48 EST
By fetching '(RFC822)' we implicitly mark mail as read on the server. We should probably use (BODY.PEEK) instead...
--- _retrieverbases.py.orig 2009-02-03 15:19:10.000000000 +0000
+++ _retrieverbases.py 2009-02-03 15:19:21.000000000 +0000
@@ -820,7 +820,7 @@ class IMAPRetrieverBase(RetrieverSkeleto
def _getmsgbyid(self, msgid):
- return self._getmsgpartbyid(msgid, '(RFC822)')
+ return self._getmsgpartbyid(msgid, '(BODY.PEEK)')
def _getheaderbyid(self, msgid):
in the options you can choose to leave mail read or unread,
so from end-user perspective it shouldn't be different.
Nevertheless I've asked some advice from upstream.
Feedback from upstream:
Retrieving the message *is* reading the message, and therefore it should be marked as read by the server (if that's what the particular server does when you retrieve a message). I don't see any reason why getmail should be trying to get around that by using BODY.PEEK instead when it retrieves the message.
Note that this is different from getmail's idea of whether it has seen the
message before or not.