1

Suppose you have a plain content part:

Header: value
Header: value

content...

In HTTP, there is no requirement to add an additional "\r\n\r\n" at the end of the content (Should newline be included in http response content length?), it uses only content-length (or chunked) to determine the size of the message.

However the question is: is it necessary for email? I can't find the exact place in the (many) rfcs related to mail that define how a "normal" content part should end.

Community
  • 1
  • 1
nablex
  • 4,635
  • 4
  • 36
  • 51

1 Answers1

1

MIME content parts end just before the newline before the content separator. Thus in the following fragment

--moo

Foo
--moo

Bar

--moo--

... the first part lacks a trailing newline, whereas the second ends with one.

Pre-MIME messages were not explicitly standardized on this particular point; but due to the requirements of SMTP, it wasn't possible to transmit a message which didn't have a final newline at the end.

tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Ok, I take from this that I will leave the trailing linefeeds when constructing mail. Thanks! – nablex Jul 10 '14 at 08:44