/offlineimap/head: changeset 578
Applied patch from Daniel James to adjust the insertion point for a new header.
This commit is contained in:
parent
e95dae8c3f
commit
69abd0e656
@ -9,6 +9,8 @@ offlineimap (4.0.3) unstable; urgency=low
|
|||||||
Closes: #252645.
|
Closes: #252645.
|
||||||
* Fixed typos in manual. Closes: #252646.
|
* Fixed typos in manual. Closes: #252646.
|
||||||
* Regenerated docs.
|
* Regenerated docs.
|
||||||
|
* Applied patch from Daniel James to adjust the insertion point
|
||||||
|
for a new header.
|
||||||
|
|
||||||
-- John Goerzen <jgoerzen@complete.org> Fri, 4 Jun 2004 10:10:00 -0500
|
-- John Goerzen <jgoerzen@complete.org> Fri, 4 Jun 2004 10:10:00 -0500
|
||||||
|
|
||||||
|
@ -126,20 +126,22 @@ class IMAPFolder(BaseFolder):
|
|||||||
ui.debug('imap',
|
ui.debug('imap',
|
||||||
'savemessage_addheader: called to add %s: %s' % (headername,
|
'savemessage_addheader: called to add %s: %s' % (headername,
|
||||||
headervalue))
|
headervalue))
|
||||||
|
newline = "%s: %s" % (headername, headervalue)
|
||||||
|
ui.debug('imap', 'savemessage_addheader: newline = ' + repr(newline))
|
||||||
|
|
||||||
insertionpoint = content.find("\r\n")
|
insertionpoint = content.find("\r\n")
|
||||||
ui.debug('imap', 'savemessage_addheader: insertionpoint = %d' % insertionpoint)
|
ui.debug('imap', 'savemessage_addheader: insertionpoint = %d' % insertionpoint)
|
||||||
leader = content[0:insertionpoint]
|
|
||||||
ui.debug('imap', 'savemessage_addheader: leader = %s' % repr(leader))
|
if insertionpoint == -1:
|
||||||
if insertionpoint == 0 or insertionpoint == -1:
|
return newline + "\r\n" + content
|
||||||
newline = ''
|
elif insertionpoint == 0:
|
||||||
insertionpoint = 0
|
return newline + content
|
||||||
else:
|
else:
|
||||||
newline = "\r\n"
|
leader = content[0:insertionpoint]
|
||||||
newline += "%s: %s" % (headername, headervalue)
|
ui.debug('imap', 'savemessage_addheader: leader = %s' % repr(leader))
|
||||||
ui.debug('imap', 'savemessage_addheader: newline = ' + repr(newline))
|
trailer = content[insertionpoint:]
|
||||||
trailer = content[insertionpoint:]
|
ui.debug('imap', 'savemessage_addheader: trailer = ' + repr(trailer))
|
||||||
ui.debug('imap', 'savemessage_addheader: trailer = ' + repr(trailer))
|
return leader + "\r\n" + newline + trailer
|
||||||
return leader + newline + trailer
|
|
||||||
|
|
||||||
def savemessage_searchforheader(self, imapobj, headername, headervalue):
|
def savemessage_searchforheader(self, imapobj, headername, headervalue):
|
||||||
if imapobj.untagged_responses.has_key('APPENDUID'):
|
if imapobj.untagged_responses.has_key('APPENDUID'):
|
||||||
|
Loading…
Reference in New Issue
Block a user