Simon Comeau Martel wrote:

Attached are dumps of both bincimap instances, and the output of offlineimap. I called "server" the source side and "client" the offlineimap side. Both the server and client are bincimap-1.2.6final unmodified. My version of offlineimap is 4.0.0 from gentoo.

Sorry, I should have told you to use the modified version of bincimap, I was looking into what goes wrong at 19 Mb point.


The fact that hacking binc as suggested by Andy changed the break point, make me think that the problem is more likely to come from binc...

Actually, I think you're hitting bugs in both programs. I've attached a patch for offlineimap - I think it should work with your version.


Daniel
Index: offlineimap/folder/IMAP.py
===================================================================
--- offlineimap/folder/IMAP.py  (revision 575)
+++ offlineimap/folder/IMAP.py  (working copy)
@@ -126,20 +126,22 @@
         ui.debug('imap',
                  'savemessage_addheader: called to add %s: %s' % (headername,
                                                                   headervalue))
+        newline = "%s: %s" % (headername, headervalue)
+        ui.debug('imap', 'savemessage_addheader: newline = ' + repr(newline))
+
         insertionpoint = content.find("\r\n")
         ui.debug('imap', 'savemessage_addheader: insertionpoint = %d' % 
insertionpoint)
-        leader = content[0:insertionpoint]
-        ui.debug('imap', 'savemessage_addheader: leader = %s' % repr(leader))
-        if insertionpoint == 0 or insertionpoint == -1:
-            newline = ''
-            insertionpoint = 0
+
+        if insertionpoint == -1:
+            return newline + "\r\n" + content
+        elif insertionpoint == 0:
+            return newline + content
         else:
-            newline = "\r\n"
-        newline += "%s: %s" % (headername, headervalue)
-        ui.debug('imap', 'savemessage_addheader: newline = ' + repr(newline))
-        trailer = content[insertionpoint:]
-        ui.debug('imap', 'savemessage_addheader: trailer = ' + repr(trailer))
-        return leader + newline + trailer
+            leader = content[0:insertionpoint]
+            ui.debug('imap', 'savemessage_addheader: leader = %s' % repr(leader))
+            trailer = content[insertionpoint:]
+            ui.debug('imap', 'savemessage_addheader: trailer = ' + repr(trailer))
+            return leader + "\r\n" + newline + trailer
 
     def savemessage_searchforheader(self, imapobj, headername, headervalue):
         if imapobj.untagged_responses.has_key('APPENDUID'):

Reply via email to