Pylons / pyramid_mailer

A package for sending email from your Pyramid application
https://docs.pylonsproject.org/projects/pyramid-mailer/en/latest/
Other
50 stars 40 forks source link

Fix lone \n in email as against RFC2822 recommendation #75

Closed miohtama closed 3 years ago

miohtama commented 8 years ago

Otherwise sparkpost.com rejects outbound emails from us

mmerickel commented 8 years ago

@miohtama the tests are broken, it looks like you're depending on py3 changes to the email module

digitalresistor commented 8 years ago

Sparkpost apparently failed to follow Postel's law:

an implementation should be conservative in its sending behavior, and liberal in its receiving behavior

  • Jon Postel (RFC 760)

Was later reworded to the one more people will be familiar with:

Be liberal in what you accept, and conservative in what you send

  • Reworded Jon Postel (RFC 1122)

It is an issue we should fix, but I wonder if it should be fixed in the Python standard library if that is where the error ultimately lies.

ztane commented 3 years ago

Ok seriously this should be fixed. We found out that if you use outlook365 SMTP as the outbound mailer, it will break on quopri bodies in an evil fashion if you use only \n instead of \r\n!

ztane commented 3 years ago

Related https://stackoverflow.com/questions/54292462/pyramid-mailer-message-and-content-transfer-encoding - all seem to be connected to the same issue.

ztane commented 3 years ago

Also https://bugs.python.org/issue724459

ztane commented 3 years ago

https://github.com/Pylons/pyramid_mailer/pull/95/