[Email-SIG] fixing the current email module
Oleg Broytman
phd at phd.pp.ru
Wed Oct 7 19:07:18 CEST 2009
On Wed, Oct 07, 2009 at 11:23:24AM -0500, Matthew Dixon Cowles wrote:
> In my opinion, the email module should never raise an exception as a
> result of working with a malformed message. Though it should
> certainly make the information that a message was malformed available
> for the calling program to check.
I disagree. email package is not a user agent, and exceptions are *the*
way to indicate there are problems.
> That is, I think that it's extremely unlikely that the calling
> program wants to blow up as a result of a malformed message.
Then the calling program must catch all exceptions and process they in a
reasonable (for this particular application) way. But certainly email
package must not dictate what ways are reasonable - they are too
application-specific.
> Very
> probably, it wants to make what sense of the message that it can.
Yes, if email parse a message in some way - ok. You can help by creating
more intelligent parser(s). But if a parser stumbles upon an unparseable
block - it must raises an exception.
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