From 82cab2ee7efbfde9b74a65ff10d0c4d1c05a0d7b Mon Sep 17 00:00:00 2001 From: Brett Parker Date: Sun, 2 Oct 2011 19:28:45 +0100 Subject: [PATCH 1/1] Change header encoding for From/To address to make sure they're utf-8 and so they are not invalidly encoded later. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug reported by Andre Klärner with pointers to what was going wrong - many thanks! --- rss2maildir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() \ -- 2.39.5