Forum: Ruby on Rails [OT] Email line separator

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bf66e10c8fc4abefebde0425e7f6f15a?d=identicon&s=25 Norman Timmler (Guest)
on 2006-02-22 13:16
(Received via mailing list)
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 Timmler

http://blog.inlet-media.de
2d0f17b478aa748b34afec2e5ec07b8d?d=identicon&s=25 Anthony DeRobertis (Guest)
on 2006-02-22 17:12
(Received via mailing list)
Norman Timmler 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)
Bf66e10c8fc4abefebde0425e7f6f15a?d=identicon&s=25 Norman Timmler (Guest)
on 2006-02-23 11:56
(Received via mailing list)
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 Timmler

http://blog.inlet-media.de
2d0f17b478aa748b34afec2e5ec07b8d?d=identicon&s=25 Anthony DeRobertis (Guest)
on 2006-02-23 21:18
(Received via mailing list)
Norman Timmler 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.
This topic is locked and can not be replied to.