[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#584535: Patch for OfflineIMAP to handle multi-line headers



tag 584525 + patch
thanks

The problem mentioned in bug #584535 seems to be that OfflineIMAP
doesn't understand multi-line headers.  The following patch (based on
6.2.0.2-2 from Sid) addresses that problem:

--- offlineimap/folder/IMAP.py.old	2010-09-07 14:15:48.000000000 +0200
+++ offlineimap/folder/IMAP.py	2010-09-07 14:37:31.000000000 +0200
@@ -234,6 +234,9 @@
                  'savemessage_addheader: called to add %s: %s' % (headername,
                                                                   headervalue))
         insertionpoint = content.find("\r\n")
+        while ((insertionpoint > 0) and (content[insertionpoint+2].isspace())):
+            i = content[insertionpoint+2:].find("\r\n")
+            insertionpoint += i+2
         ui.debug('imap', 'savemessage_addheader: insertionpoint = %d' % insertionpoint)
         leader = content[0:insertionpoint]
         ui.debug('imap', 'savemessage_addheader: leader = %s' % repr(leader))

Roland.
-- 
Roland Mas

Certains disent que les vrais hommes ne font pas de backups.
Mais ils disent aussi que même les vrais hommes pleurent parfois.



Reply to: