]> git.sommitrealweird.co.uk Git - rss2maildir.git/commitdiff
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 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))
                 ]) + "@" + 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() \
         if prevmessageid:
             msg.add_header("References", prevmessageid)
         createddate = datetime.datetime.now() \