changeset f0835831dae6 in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset;node=f0835831dae6
description:
        Add missing Date header on email sent

        issue8596
        review272091002
        (grafted from fc47f7e21925305bbb2d6783e74949ee83186469)
diffstat:

 trytond/sendmail.py |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r fe9af17f69d3 -r f0835831dae6 trytond/sendmail.py
--- a/trytond/sendmail.py       Fri Aug 23 18:31:05 2019 +0200
+++ b/trytond/sendmail.py       Fri Aug 30 09:08:32 2019 +0200
@@ -3,6 +3,7 @@
 import logging
 import smtplib
 from email.message import Message
+from email.utils import formatdate
 from urllib.parse import parse_qs, unquote_plus
 
 from .config import config, parse_uri
@@ -29,6 +30,8 @@
         quit = True
     else:
         quit = False
+    if 'Date' not in msg:
+        msg['Date'] = formatdate()
     try:
         senderrs = server.sendmail(from_addr, to_addrs, msg.as_string())
     except smtplib.SMTPException:

Reply via email to