Open shuLhan opened 1 year ago
Change https://go.dev/cl/508535 mentions this issue: mime/quotedprintable: fix encoding where a period alone on a line
If we pass the Writer output into SMTP DATA command, the server read the "\r\n.\r\n" as the end of DATA which cause the message truncated on the receiver.
A line starting with a .
needs to be sent to the SMTP DATA command prefixed with an additional .
:
https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.2
Perhaps we should change the mime/quotedprintable behavior, but the problem of message truncation here lies in the SMTP client implementation.
@neild Thanks for reviewing.
... but the problem of message truncation here lies in the SMTP client implementation.
You were right. I have tested with net/smtp Client and it works perfectly.
Perhaps we should change the mime/quotedprintable behavior
I read your comment on gerrit, will continue discussion in there.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Given the following example of message body,
The quotedprintable Writer will encode the message into,
If we pass the Writer output into SMTP DATA command, the server read the "\r\n.\r\n" as the end of DATA which cause the message truncated on the receiver.
Reproduceable code
What did you expect to see?
Full message received as,
What did you see instead?
Message received as,