offlineimap breaks headers (?)

Sebastian Spaeth Sebastian at SSpaeth.de
Thu Feb 17 10:51:21 UTC 2011


I was just looking at the Debian bugs filed for offlineimap and finding
bug 482557 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482557)

called "offlineimap: breaks mail headers". Does anyone know if that is
still the case?

The responsible code is in:
    def savemessage_addheader(self, content, headername, headervalue):

Looking at it, I wonder why we do that manual mail parsing and inserting
anyway. We already parse the mail with the rfc822 module (in some cases)
into a proper "Mail" object anyway and using that, we could simply use
email.add_header()
(http://docs.python.org/library/email.message.html#email.message.Message.add_header)

Of course, this might fail with emails that are so broken that the email
module can't parse them where manual inserting might still work. Also
parsing the email fully might have some performance implications, but I
would be rather safe than sorry and not have offlineimap break any
emails.

What do people think about this one? Or have people already thought
about this?

Sebastian

P.S. I am holding back any major new stuff until a new stable release is
out. :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/offlineimap-project/attachments/20110217/7b829e15/attachment.pgp>


More information about the OfflineIMAP-project mailing list