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

@ -93,7 +93,7 @@ class GmailFolder(IMAPFolder):
labels = set()
labels = labels - self.ignorelabels
labels_str = imaputil.format_labels_string(self.labelsheader, sorted(labels))
body = self.addmessageheader(body, self.labelsheader, labels_str)
body = self.addmessageheader(body, '\n', self.labelsheader, labels_str)
if len(body)>200:
dbg_output = "%s...%s" % (str(body)[:150], str(body)[-50:])