Change header encoding for From/To address to make sure they're utf-8 and so they...
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Sun, 2 Oct 2011 18:28:45 +0000 (19:28 +0100)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Sun, 2 Oct 2011 18:28:45 +0000 (19:28 +0100)
Bug reported by Andre Klärner with pointers to what was going wrong - many thanks!

rss2maildir.py

index b4acdec..8a59c85 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() \