Subject: Is the final line of a message required to have a CRLF

From: Tony Hansen <[email-masked]>
Date: Thu, 19 Nov 1998 13:09:43 -0500

Is the final line of a message body required to have a CRLF?

RFC 822 (section 3.1) says a message body "is a sequence of lines".

822bis says:
    Section 2.1

        Messages are divided into lines of characters.  A line is a
series
	of characters which is delimited with the two characters
	carriage-return and line-feed; …

    Section 3.5 says

        The body is simply a series of lines of text which are
uninterpreted
	for the purposes of this standard.

The above says to me that all lines end with a CRLF.

Current practice also seems to agree with this.

However, the ABNF in section 3.5 says that a message does not require a
final CRLF at the end of its last line:

        body            =       *(*998text CRLF) *998text

If the final line of a message body is required to have a CRLF, then I
suggest that the ABNF be changed to read:

        body  = *(*998text CRLF)

If not, this difference from RFC 822 needs to be noted in the
"Differences from earlier standards" section.

	Tony Hansen
	[email-masked]

---

From: Pete Resnick <[email-masked]>
Date: Fri, 20 Nov 1998 13:13:07 -0600

> Is the final line of a message body required to have a CRLF?

No.
> RFC 822 (section 3.1) says a message body "is a sequence of lines".

RFC 822 also defines message as:

     message     =  fields *( CRLF *text )       ; Everything after
                                                 ;  first null line
                                                 ;  is message body
Clearly the only reading of that ABNF is that the body needn't end with CRLF.

> 822bis says:
>     Section 2.1
>         Messages are divided into lines of characters.  A line is a series
> 	carriage-return and line-feed;

Yes. Note that lines are delimited with CRLF; the CRLF is not part of the 
definition of "line".

>     Section 3.5 says
>         The body is simply a series of lines of text which are uninterpreted

Nope.

> Current practice also seems to agree with this.

How so?

>         body            =       *(*998text CRLF) *998text

Right, same as 822.
> "Differences from earlier standards" section.

Nope. It's not a difference.

pr
--
Pete Resnick <mailto:[email-masked]>
QUALCOMM Incorporated
Work: (217)337-6377 or (619)651-4478
Fax: (217)337-1980 or (619)651-1102

---

From: "D. J. Bernstein" <[email-masked]>
Date: 20 Nov 1998 20:31:03 -0000

> Current practice also seems to agree with this.

SMTP (including common extensions) cannot transmit messages with partial
final lines. Some popular mailbox formats cannot hold messages with
partial final lines. MUAs put extra line endings on their messages to
guarantee that users don't bump into these restrictions.

So it's hardly a surprise that your mailbox doesn't contain partial
final lines.

However, there are message-transfer protocols and mailbox formats that
don't have this restriction. There are users transmitting arbitrary
binary data in message bodies. It would be a shame if these messages
were artificially excluded by 822bis.

---Dan
1000 recipients, 28.8 modem, 10 seconds. http://pobox.com/~djb/qmail/mini.html