diff options
| author | 2011-02-27 18:08:00 +0100 | |
|---|---|---|
| committer | 2011-02-27 19:07:13 +0100 | |
| commit | 91d07861942a3bac602cf3e67c6260f1bc85537f (patch) | |
| tree | 24fd4b9d2123c0b33ba76ab58d77a7ec870515f2 | |
| parent | d4fa57e81588eaa4acf9291f6de83e842a3ecec4 (diff) | |
add Date and Message-ID header fields in email from mini-dinstall
bugreport and initial patch from Sven Hartge <sven@svenhartge.de>
| -rw-r--r-- | minidinstall/mail.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/minidinstall/mail.py b/minidinstall/mail.py index 8f97147..30103a3 100644 --- a/minidinstall/mail.py +++ b/minidinstall/mail.py @@ -20,6 +20,7 @@ import smtplib import email.mime.text +import email.utils import logging @@ -34,6 +35,8 @@ def send(smtp_server, smtp_from, smtp_to, body, subject="mini-dinstall mail noti mime_body['Subject'] = subject mime_body['From'] = smtp_from mime_body['To'] = smtp_to + mime_body['Date'] = email.utils.formatdate(localtime=True) + mime_body['Message-ID'] = email.utils.make_msgid() mime_body.add_header('X-Mini-Dinstall', 'YES') # Send via SMTP server |
