From fc984bb656d163f67bfaa5df041255572b65368a Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Sat, 7 Dec 2013 13:17:53 +0100 Subject: [PATCH] add Date header, close #42 --- isso/ext/notifications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index ce6a2fb..da645a0 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -9,6 +9,7 @@ import json import socket import smtplib +from email.utils import formatdate from email.header import Header from email.mime.text import MIMEText @@ -73,7 +74,6 @@ class SMTP(object): def format(self, thread, comment): - rv = io.StringIO() author = comment["author"] or "Anonymous" @@ -122,6 +122,7 @@ class SMTP(object): msg = MIMEText(body, 'plain', 'utf-8') msg['From'] = "Ich schrei sonst! <%s>" % from_addr msg['To'] = to_addr + msg['Date'] = formatdate(localtime=True) msg['Subject'] = Header(subject, 'utf-8') with self as con: