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.
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.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/>
Problems?: [EMAIL PROTECTED]