[Email-SIG] fixing the current email module

Oleg Broytman phd at phd.pp.ru
Thu Oct 8 18:54:05 CEST 2009


On Fri, Oct 09, 2009 at 12:31:43AM +0900, Stephen J. Turnbull wrote:
> Oleg Broytman writes:
>  > > I can think of no input for which the parser should *ever* throw an
>  > > exception.
>  > 
>  >    Are you saying that even a random garbage would be parsed to a Message
>  > of some kind? No headers, a single unparsed body?..
> 
> As long as it contains no NULs or high-bit-set octets, and is
> separated into at least two parts, each less than 998 characters long,
> by a CRLF

   After all, you can think of input that should make a parser to raise an
exception, can't you?

> This Message should not be sendable because RFC 5322 requires the
> presence of a From and a Date.  However, if you were implementing a
> sendmail-compatible MTA or LDA, you might very well wish to accept
> such a thing on stdin, parse it to a Message, and then default the
> >From and Date header fields appropriately, and add a Message-ID header
> field.  I would, anyway, wouldn't you?
> 
> Ah, yes, that's another use case, isn't it?!

   Absolutely. We're talking about parsing data, not necessary from SMTP,
even less not necessary sendable.

Oleg.
-- 
     Oleg Broytman            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.


More information about the Email-SIG mailing list