]> git.sommitrealweird.co.uk Git - rss2maildir.git/blobdiff - rss2maildir.py
Update so that we don't get a warning in python 2.6 and above, where the md5 module...
[rss2maildir.git] / rss2maildir.py
index 4ee21260685f23e48a7ff072fd78df7dda3d814e..a1e8819f8fcb067eff4cb892c70a460bc6b294c7 100755 (executable)
@@ -39,7 +39,11 @@ from optparse import OptionParser
 from ConfigParser import SafeConfigParser
 
 from base64 import b64encode
-import md5
+
+if sys.version_info[0] == 2 and sys.version_info[1] >= 6:
+    import hashlib as md5
+else:
+    import md5
 
 import cgi
 import dbm
@@ -742,6 +746,8 @@ def parse_and_deliver(maildir, url, statedir):
         except:
             pass
         msg.add_header("Date", createddate)
+        msg.add_header("X-rss2maildir-rundate", datetime.datetime.now() \
+            .strftime("%a, %e %b %Y %T -0000"))
         subj_gen = HTML2Text()
         title = item["title"]
         title = re.sub(u'<', u'&lt;', title)