I've got SendMail 8.14.4 running on a CentOS 5 server.
A user in Japan is sending a message and when it gets processed by the server, SendMail is adding an extra carriage return for some reason.
The email contains a X-header with values that (presumably) contain international characters. I say "presumably" because when I examine the MIME source with notepad++ I see oddities like STX
and CAN
.
I've been able to narrow the testing scope down to this:
If I send that through Sendmail, it eventually leaves SendMail as this:
(ips, Q-ID, and hostname changed to protect the innocent)
Now obviously a potential red flag here: the header value starts with a quote but doesn't have a closing one. Is that required by RFC standards? Or is that part a red herring?
The end result is that header values leak into the message body:
Any thoughts on why sendmail is adding the extra carriage return?
Best Answer
That is pretty simple actually: RFC 2822 section 2.2.3 allows for long headers, where a header is a fieldname followed by a : to fold and continue on the next line, as long as (simplified) that next line starts with a space
.
Line 3 of the original input starts not with a space, but with the character c and does not contain a colon : which makes it neither the continuation of the previous header nor the next header field (ยง2.2).
That marks it as the end of the headers...
And the start of the body.
Sendmail "corrects" that malformed message and adds the required blank line between what it perceives as end of the the headers and start of the body.
A simple telnet mail session can reproduce that behaviour:
Which results in similar message as your example:
With an additional new line between the original header continuation and the "new" start of the body.