Commit ce536895 authored by Romain Courteaud's avatar Romain Courteaud

Generate Message-ID header, in order to prevent the MTA to generate it later...

Generate Message-ID header, in order to prevent the MTA to generate it later and so, store the information into ERP5 to be able to keep mail threading.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44711 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc45ecc4
...@@ -16,6 +16,7 @@ except ImportError: ...@@ -16,6 +16,7 @@ except ImportError:
BaseMailTemplate = None BaseMailTemplate = None
from email.Header import make_header from email.Header import make_header
from email.utils import make_msgid
if BaseMailTemplate is not None: if BaseMailTemplate is not None:
def _process_utf8(self,kw): def _process_utf8(self,kw):
...@@ -80,6 +81,8 @@ if BaseMailTemplate is not None: ...@@ -80,6 +81,8 @@ if BaseMailTemplate is not None:
)) ))
# add date header # add date header
headers['Date']=BaseMailTemplate.DateTime().rfc822() headers['Date']=BaseMailTemplate.DateTime().rfc822()
# add message-id header
headers['Message-ID']=make_msgid()
# turn headers into an ordered list for predictable header order # turn headers into an ordered list for predictable header order
keys = headers.keys() keys = headers.keys()
keys.sort() keys.sort()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment