From: Brett Parker Date: Sun, 2 Oct 2011 18:28:45 +0000 (+0100) Subject: Change header encoding for From/To address to make sure they're utf-8 and so they... X-Git-Url: https://git.sommitrealweird.co.uk/rss2maildir.git/commitdiff_plain/82cab2ee7efbfde9b74a65ff10d0c4d1c05a0d7b?ds=inline Change header encoding for From/To address to make sure they're utf-8 and so they are not invalidly encoded later. Bug reported by Andre Klärner with pointers to what was going wrong - many thanks! --- diff --git a/rss2maildir.py b/rss2maildir.py index b4acdec..8a59c85 100755 --- a/rss2maildir.py +++ b/rss2maildir.py @@ -741,8 +741,8 @@ def parse_and_deliver(maildir, url, statedir): ]) + "@" + socket.gethostname() + ">" msg.add_header("Message-ID", messageid) msg.set_unixfrom("\"%s\" " %(url)) - msg.add_header("From", "\"%s\" " %(author)) - msg.add_header("To", "\"%s\" " %(url)) + msg.add_header("From", "\"%s\" " %(author.encode("utf-8"))) + msg.add_header("To", "\"%s\" " %(url.encode("utf-8"))) if prevmessageid: msg.add_header("References", prevmessageid) createddate = datetime.datetime.now() \