[OT] Email line separator


#1

What line separator do you use when composing emails?

  1. \n
  2. \r\n
  3. \r

Is there a ‘official’ line separator for emails (rfc-document?)?

What separator is the most compatible between Windows, OS X and Linux?


Norman T.

http://blog.inlet-media.de


#2

Norman T. wrote:

What line separator do you use when composing emails?

  1. \n
  2. \r\n
  3. \r

Is there a ‘official’ line separator for emails (rfc-document?)?

CRLF is the official line separator. See RFC822 and RFC2822. Quoting
from the latter:

Messages are divided into lines of characters. A line is a series of
characters that is delimited with the two characters carriage-return
and line-feed; that is, the carriage return (CR) character (ASCII
value 13) followed immediately by the line feed (LF) character (ASCII
value 10). (The carriage-return/line-feed pair is usually written in
this document as “CRLF”.)

Now, however, this only applies if you’re sending the message directly
to an MTA over SMTP. If you’re, e.g., piping to /usr/bin/sendmail, the
line seperator is just LF (sendmail converts the LF to CRLF before
sending it on)


#3

Am Mittwoch, den 22.02.2006, 10:48 -0500 schrieb Anthony DeRobertis:

CRLF is the official line separator. See RFC822 and RFC2822. Quoting
to an MTA over SMTP. If you’re, e.g., piping to /usr/bin/sendmail, the
line seperator is just LF (sendmail converts the LF to CRLF before
sending it on)

Hmmm, so it doesn’t make any difference what line separator to use. But
i know that some of the rails generated emails have defect line breaks
in some mail readers. Is there nothing i can do?


Norman T.

http://blog.inlet-media.de


#4

Norman T. wrote:

Hmmm, so it doesn’t make any difference what line separator to use.

Sure it does. Depending on what interface rails is using (no idea
personally), you must use either CRLF or LF.

But i know that some of the rails generated emails have defect line
breaks in some mail readers. Is there nothing i can do?

Make sure the final email contains CRLF.