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/ [email protected]
Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Email-SIG mailing list
[email protected]
Your options:
http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com