]> git.sommitrealweird.co.uk Git - rss2maildir.git/blobdiff - rss2maildir.py
Change header encoding for From/To address to make sure they're utf-8 and so they...
[rss2maildir.git] / rss2maildir.py
index b4acdec086d924bb9175c51dca551caf9ab07913..8a59c8548761e87c06c1befe66a9f3550cf4b07b 100755 (executable)
@@ -741,8 +741,8 @@ def parse_and_deliver(maildir, url, statedir):
                 ]) + "@" + socket.gethostname() + ">"
         msg.add_header("Message-ID", messageid)
         msg.set_unixfrom("\"%s\" <rss2maildir@localhost>" %(url))
-        msg.add_header("From", "\"%s\" <rss2maildir@localhost>" %(author))
-        msg.add_header("To", "\"%s\" <rss2maildir@localhost>" %(url))
+        msg.add_header("From", "\"%s\" <rss2maildir@localhost>" %(author.encode("utf-8")))
+        msg.add_header("To", "\"%s\" <rss2maildir@localhost>" %(url.encode("utf-8")))
         if prevmessageid:
             msg.add_header("References", prevmessageid)
         createddate = datetime.datetime.now() \