I'm using pyramid_mailer's Mailer class to send a Message. If I use the Mailer's send() method it works. If I use the send_to_queue() method instead, then the qp script that attempts to send the email raises an SMTPRecipientsRefused exception ("Domain name required for sender address").
From what I can tell, repoze.sendmail is encoding the X-Actually-From header (the recipient address, say, "email@example.com") as utf-8, then storing the message in the maildir. When it later parses the message, it doesn't decode the header. Instead it sets the string "=?utf-8?q?e=40example=2Ecom?=" as the sender, which raises the exception.
As a temporary workaround I added two lines to the QueueProcessor's _parseMessage method (in repoze.sendmail.queue):
fromaddr = message['X-Actually-From']
+ from email.header import decode_header
+ fromaddr = decode_header(fromaddr)
I'm not submitting it as a patch because I don't think it's the best approach, but I wanted you to see the change I had to make to get it working for me on Python 2.7. Please let me know if there's something I should be doing different or if this is a legitimate issue.
Having the same issue.
Workaround for github issue #7.
Starting work now.
Fix issue #7, handling of to/from addresses with non-ascii characters
when using queued mail delivery.