Fix improper header separator for X-OfflineIMAP header

For servers without UIDPLUS we are inserting additional header
just after transformation '\n' -> CRLF was done.  addmessageheaders()
was written to work with just '\n' as the separator, so X-OfflineIMAP
header wasn't preceeded by the CRLF, but just by '\n'.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
Eygene Ryabinkin
2014-06-01 22:09:44 +04:00
parent 7770b5ff73
commit e8db1217d4
5 changed files with 29 additions and 10 deletions

View File

@ -526,6 +526,7 @@ class IMAPFolder(BaseFolder):
# NB: imapobj to None.
try:
while retry_left:
# XXX: we can mangle message only once, out of the loop
# UIDPLUS extension provides us with an APPENDUID response.
use_uidplus = 'UIDPLUS' in imapobj.capabilities
@ -535,7 +536,7 @@ class IMAPFolder(BaseFolder):
content)
self.ui.debug('imap', 'savemessage: header is: %s: %s' %\
(headername, headervalue))
content = self.addmessageheader(content, headername, headervalue)
content = self.addmessageheader(content, CRLF, headername, headervalue)
if len(content)>200:
dbg_output = "%s...%s" % (content[:150], content[-50:])