[FIX] mail: Strip In-Reply-To header
For emails sent via Office 365, reply-to header could contains additional spaces or get multiline header. e.g.: In-Reply-To: <4ba8f246904b4fedb49fbab7945a7f82@AM3PR06MB433.eurprd06.prod.outl$$k.com> The message lookup fails if header is not stripped
This commit is contained in:
parent
69f87cd34c
commit
3d35a5d42b
|
@ -554,7 +554,7 @@ class mail_thread(osv.AbstractModel):
|
||||||
email_from = decode_header(message, 'From')
|
email_from = decode_header(message, 'From')
|
||||||
email_to = decode_header(message, 'To')
|
email_to = decode_header(message, 'To')
|
||||||
references = decode_header(message, 'References')
|
references = decode_header(message, 'References')
|
||||||
in_reply_to = decode_header(message, 'In-Reply-To')
|
in_reply_to = decode_header(message, 'In-Reply-To').strip()
|
||||||
|
|
||||||
# 1. Verify if this is a reply to an existing thread
|
# 1. Verify if this is a reply to an existing thread
|
||||||
thread_references = references or in_reply_to
|
thread_references = references or in_reply_to
|
||||||
|
|
|
@ -533,7 +533,7 @@ class TestMailgateway(TestMailBase):
|
||||||
|
|
||||||
# 1. In-Reply-To header
|
# 1. In-Reply-To header
|
||||||
reply_msg2 = format(MAIL_TEMPLATE, to='erroneous@example.com',
|
reply_msg2 = format(MAIL_TEMPLATE, to='erroneous@example.com',
|
||||||
extra='In-Reply-To: %s' % msg1.message_id,
|
extra='In-Reply-To:\r\n\t%s' % msg1.message_id,
|
||||||
msg_id='<1198923581.41972151344608186760.JavaMail.3@agrolait.com>')
|
msg_id='<1198923581.41972151344608186760.JavaMail.3@agrolait.com>')
|
||||||
self.mail_group.message_process(cr, uid, None, reply_msg2)
|
self.mail_group.message_process(cr, uid, None, reply_msg2)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue