repoze / repoze.sendmail

Send e-mails transactionally (originally cloned from zope.sendmail)
http://pypi.python.org/pypi/repoze.sendmail/
11 stars 25 forks source link

qp on Python 3.6 confuses Exchange on quoted-printable line wraps #46

Open dholth opened 4 years ago

dholth commented 4 years ago

An HTML mail ascii/quoted-printable, sent through to Exchange, displays = signs where the quoted-printable encoding wraps. Exact same file sent with Python 2 works fine. For now it's easy to just run qp in Python 2.

I think it is probably not sending CRLF line endings over the network.

dholth commented 4 years ago

We pass bytes to this, so fix-eols does not happen https://github.com/python/cpython/blob/3.8/Lib/smtplib.py#L567

It might be possible to set the policy=(a policy with crlf line endings) when parsing, or when serializing. https://github.com/repoze/repoze.sendmail/blob/master/repoze/sendmail/queue.py#L111

dholth commented 4 years ago

See also email.policy:

SMTP = default.clone(linesep='\r\n') HTTP = default.clone(linesep='\r\n', max_line_length=None) SMTPUTF8 = SMTP.clone(utf8=True)

dholth commented 4 years ago

Should be fixed in #47 plus bonus Python 2 backwards compat