-
Notifications
You must be signed in to change notification settings - Fork 574
Description
Describe the issue
As discussed a bit in the description of #8805, I believe the datatracker is incorrectly sending <LF>
instead of <CRLF>
as line endings. This is at odds with RFC 5321 (see in particular the third paragraph).
Poking at this, I found that removing the force_bytes()
from
datatracker/ietf/utils/mail.py
Line 148 in 148fa2f
unhandled = server.sendmail(frm, to, force_bytes(msg.as_string())) |
<CR>
or <LF>
into the <CRLF>
sequence when its input is a string. When that input is a bytestring, it sends the bytes verbatim.
At least for the text email case I was looking at, the message body coming in has been formatted with email.mime.text.MIMEText
, which normalizes line endings to \n
, so by the time we reach sendmail()
we've already lost any special endings that could have existed. As a result,I believe that for this code path (starting at send_mail_text()
), dropping the force_bytes()
is a reasonable change. There are many other ways these methods are called, though, so more investigation is needed.
Code of Conduct
- I agree to follow the IETF's Code of Conduct