Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dholth opened this issue Mar 4, 2020 · 3 comments
Open

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

dholth opened this issue Mar 4, 2020 · 3 comments

Comments

@dholth
Copy link

dholth commented Mar 4, 2020

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
Copy link
Author

dholth commented Mar 4, 2020

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
Copy link
Author

dholth commented Mar 4, 2020

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 added a commit to dholth/repoze.sendmail that referenced this issue Mar 4, 2020
@dholth
Copy link
Author

dholth commented Mar 5, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant