You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Richard O. Hammer" <RO...@EarthLink.net> on 2003/06/10 21:07:58 UTC

CRLF at end of message data

When we receive the end of mail data indicator (CRLF.CRLF), should the
data we send onward to javax.mail.internet.MimeMessage include the 
first CRLF or not?  Should we discard the whole CRLF.CRLF, or just the 
final .CRLF?

Depending upon this judgment, James 2.1.2 may have a feature, since
james.util.CharTerminatedInputStream does not return a concluding CRLF
before the EOF indication of -1 (according to my reading and test of
the code).  It returns the last "line" stripped of CRLF, then -1.

I believe that the first CRLF should be part of the data, according to
my reading of RFC 2821, sections 2.3.7, 3.3, and 4.1.1.4.  That CRLF
is part of the last line of data, since, as I read 2.3.7 you don't 
have a "line" of data unless it is terminated by CRLF.

But the RFC leaves room for confusion.  This phrase from section 3.3
might be interpreted both ways, "...the SMTP server ... considers all
succeeding lines up to but not including the end of mail data
indicator to be the message text."  What is "the end of mail data
indicator"?  Section 4.1.1.4 calls the whole CRLF.CRLF the "end of
mail data indication".

I noticed this as I am working on code which, if I succeed, might 
consilidate: CharTerminatedInputStream, BytesReadResetInputStream,
SizeLimitedInputStream, and DotStuffingInputStream.

Rich



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