From: Bruce Lilly (blilly@erols.com)
Date: Tue May 20 2003 - 01:05:32 CDT
Russ Allbery wrote:
> I'm not sure what you all are discussing exactly, but note that all
> messages transferred via NNTP are *required* to end in CRLF. There's no
> way to transmit a message via NNTP that does not.
>
> How does SMTP handle that issue? Is the CRLF before the period in SMTP
> not considered part of the message?
Extensions are negotiable in SMTP to provide binary transfer.
Base SMTP (i.e. w/o extensions) has a mechanism to deal with the
issue (basically, the sender adds a CRLF).
Details are in RFC 2821 section 4.1.1.4, and in RFC 3030, which
defines a BDAT command as an alternative to base SMTP's DATA.
MIME multipart message (RFC 2046 section 5.1.1) don't necessarily end
with CRLF. The closing delimiter of a multipart ends with "--" and
does not necessarily have a following CRLF. (there may be linear
whitespace, which is ignored). If there is an optional epilogue
after the closing delimiter, (the epilogue is ignored by MIME-
compliant UAs) there is a CRLF between the closing delimiter and
the epilogue, and the epilogue itself does not necessarily end
with CRLF. From RFC 2046:
multipart-body := [preamble CRLF]
dash-boundary transport-padding CRLF
body-part *encapsulation
close-delimiter transport-padding
[CRLF epilogue]
transport-padding := *LWSP-char
; Composers MUST NOT generate
; non-zero length transport
; padding, but receivers MUST
; be able to handle padding
; added by message transports.
delimiter := CRLF dash-boundary
close-delimiter := delimiter "--"
preamble := discard-text
epilogue := discard-text
discard-text := *(*text CRLF) *text
; May be ignored or discarded.
Note that the epilogue (discard-text) ends in *text, and text excludes
CR and LF. if the optional epilogue is not present, the multipart-body
ends with the close-delimiter, which itself ends in "--" (no CRLF).
MIME has been around for over a decade; NNTP ought to have a mechanism
for dealing with multipart MIME messages. Of course, that's outside of
this WG's scope.
The base SMTP method of appending a CRLF is equivalent to adding a
zero-length epilogue or extending the epilogue by two octets, and is
mostly harmless.