Include message header at better place
It's not enough to place header after first newline, since this might break multiline rfc0822 folded long header lines. Those are difined as CRLF followed by white space. Instead we'll search for two successive CRLF sequences which mark end of mail headers and place our header just before that. Signed-off-by: Vladimir Marek <vlmarek@volny.cz> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
86cfd31ce9
commit
86e9c7442b
@ -276,7 +276,7 @@ class IMAPFolder(BaseFolder):
|
|||||||
self.ui.debug('imap',
|
self.ui.debug('imap',
|
||||||
'savemessage_addheader: called to add %s: %s' % (headername,
|
'savemessage_addheader: called to add %s: %s' % (headername,
|
||||||
headervalue))
|
headervalue))
|
||||||
insertionpoint = content.find("\r\n")
|
insertionpoint = content.find("\r\n\r\n")
|
||||||
self.ui.debug('imap', 'savemessage_addheader: insertionpoint = %d' % insertionpoint)
|
self.ui.debug('imap', 'savemessage_addheader: insertionpoint = %d' % insertionpoint)
|
||||||
leader = content[0:insertionpoint]
|
leader = content[0:insertionpoint]
|
||||||
self.ui.debug('imap', 'savemessage_addheader: leader = %s' % repr(leader))
|
self.ui.debug('imap', 'savemessage_addheader: leader = %s' % repr(leader))
|
||||||
|
Loading…
Reference in New Issue
Block a user