----- Original Message -----
From: "Serge Knystautas" <[EMAIL PROTECTED]>
To: "Java Apache Mail Server" <[EMAIL PROTECTED]>
Sent: Tuesday, March 14, 2000 2:47 PM
Subject: Re: Message validation
> Federico Barbieri wrote:
> >
> > After taking a deeper look at RFC 822 specification it seems to me that
only
> > some headers MUST be present:
> > From, To, Date MUST be present to make the Message valid.
> >
> > My opinion it that James (not SMTPHandler) should take care of
validation.
> > Action to be taken on an invalid message may be "refuse to send" or
"let's
> > try to patch it".
> > IMHO we should aim to first one but any good reason to accept invalid
> > messages is welcome.
> >
> > More than validation James will taka care of adding non necessary but
> > recomanded headers such as trace infos etc.
> > Return-Path, Received from... , Message-Id etc.
> >
> > any advice 'bout this?
>
> I liked your suggestion about putting a servlet (usually first in the
> list) that would add the appropriate headers. I'm pretty sure
> Message-ID is also required, just not from that RFC. Received and
> Return-Path from what I've seen are always included. As well. I think
> this validation must be done within James since you allow public methods
> to submit email messages. If the administrator doesn't want this
> conformance (maybe it's a routing SMTP server that no one sends new
> messages to), they can disable this servlet. I might set Message-ID
> sooner though... perhaps in the sendMail (..) methods, and change them
> to return a String (the Message-ID) instead of void. I've seen several
> mail servers accept new messages and on message completion (after
> [CR][LF].[CR][LF]), it returns something like 250 Message
> XXXXXXXXXXXXXXXX received. Not very important, but might be nice. I
> don't know if any clients expect this behavior... I haven't tested it
> across many servers.
What I've tryed to implement is a separation between NECESSARY and SUGGESTED
headers: necessary headers are validated inside the sendMail method so that
an exception can be thrown if message is invlid. Once the message has been
validated it is stored in the spool bfore processing. The first mail servlet
may take care of recomanded header completion. It is important to split
these roles since mail spooling (sendMail) MUST be as fast as possible
avoiding anything that can be done later.
Agree on leave the admin decide about sendMail validation and/or mail
completion.
I can add "Message-Id" in the necessary fields or make them configurable...
For the sendMail I prefere a void returning with no error if mail is spooled
(this means the MailServer take responsability for the mail) while returning
an Exception if something's wrong (and the mail will not be delivred). I
don't see any good reason for any other response type since something like
"the mail is not valid but I'm going to complete it" or "mail is invalid and
I do not guarantee naything about its delivery" sounds useless to me (IMHO).
>
> I still have lots of code to send you (mostly around the SmartTransport
> object and the RemoteDeliveryServlet)... I'm hoping tomorrow night I can
> send you my changes.
Great! It's the last missing piece before release (except documentation of
course :-)
>
> Serge Knystautas
> Loki Technologies
> http://www.lokitech.com/
>
Federico
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/>
Problems?: [EMAIL PROTECTED]