james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: new InputStream class for mail data
Date Tue, 15 Jul 2003 00:11:38 GMT
> > The RFC states that <CR> MUST NOT appear except paired with <LF>.
> > You know this because we addressed that in CRLFTerminatedReader.

> But this contingency cannot be discounted, surely?

It absolutely MUST be discounted.  I don't see that the RFC gives any
discretion.

> While most people will send mail using well behaved clients it is
_possible_
> for CR to appear on its own, particularly in unencoded binary data,

It is not possible, by definition, because it is not permitted.  The RFC is
crystal clear on this point:

RFC 2821, 2.3.7 Lines

   SMTP commands and, unless altered by a service extension, message
   data, are transmitted in "lines".  Lines consist of zero or more data
   characters terminated by the sequence ASCII character "CR" (hex value
   0D) followed immediately by ASCII character "LF" (hex value 0A).
   This termination sequence is denoted as <CRLF> in this document.
   Conforming implementations MUST NOT recognize or generate any other
   character or character sequence as a line terminator.  Limits MAY be
   imposed on line lengths by servers (see section 4.5.3).

   In addition, the appearance of "bare" "CR" or "LF" characters in text
   (i.e., either without the other) has a long history of causing
   problems in mail implementations and applications that use the mail
   system as a tool.  SMTP client implementations MUST NOT transmit
   these characters except when they are intended as line terminators
   and then MUST, as indicated above, transmit them only as a <CRLF>
   sequence.

> the fact that it will probably be munged in transport is a srong
> disincentive to sending it, but doesn;t prohibit it

I would say that the above paragraphs constitute prohibition.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message