offlineimap breaks headers (?)

Sebastian Spaeth Sebastian at
Thu Feb 17 10:51:21 GMT 2011

I was just looking at the Debian bugs filed for offlineimap and finding
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

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

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


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: <>

More information about the OfflineIMAP-project mailing list