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): self.log.trace() - return self._getmsgpartbyid(msgid, '(RFC822)') + return self._getmsgpartbyid(msgid, '(BODY.PEEK[])') def _getheaderbyid(self, msgid): self.log.trace()
Hi David, 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. Stay tuned!
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.