commit 9fdbf5011773ca335285187833d5c14fbaee7fe4
parent bbf99c4f0eb311f04389b7d1880566502af57454
Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 9 Mar 2014 19:52:52 +0100
Use the original timestamp.
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/feedemail.py b/feedemail.py
@@ -10,6 +10,7 @@ from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.utils import formataddr, formatdate, parseaddr
from email.header import Header
+import time
import html2text as h2t
h2t.UNICODE_SNOB = 1
@@ -60,7 +61,11 @@ def send(feed, to, smtphost="localhost", smtpport=None, ssl="False", \
msg["From"] = formataddr((fname, faddr))
msg["To"] = formataddr(parseaddr(to))
- msg["Date"] = formatdate()
+ if "updated" in article:
+ msg["Date"] = formatdate(time.mktime(\
+ article["updated"].timetuple()))
+ else:
+ msg["Date"] = formatdate()
msg["Subject"] = subject
if "link" in article: