You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2003/11/05 04:07:14 UTC

DSNBounce Mailet (was [PATCH] RemoteDelivery multiple delay times)

Andreas,

> I wrote a DSNBounce Mailet (extending Vincenzos AbstractNotify)
> that produces Delivery Status Notifications using the format
> described in RFC 3462 - RFC 3464.

Excellent.  It would be very good to have a DSN Mailet submitted.  :-)  Feel
free to submit patches for the other parts as well.

> Therefor I replaced the call of "bounce(mail, ex);" at the end of
> RemoteDeliverys failMessage() by the following:

> mail.setAttribute("DSN-error", ex);
> mail.setState("dsn");
> MailetContext mc = getMailetContext();
> try {
>     mc.sendMail(mail);
> } catch (MessagingException e) {
>     log("Exception re-inserting failed mail: ", e);
> }
> //bounce(mail, ex);

I think it would be a good idea to allow the DSN processor to be
parameterized, and if there isn't one, use the default handling (for now).
And it would be a good idea to wrap the DSN code into a convenient method
for other pieces of code to use as necessary, rather than replicate it.

MailImpl has a bounce method that is supposed to return a Mail object
containing the bounce notice.  I don't believe, off-hand, that it is used,
nor am I sure if it continues to have any value.  MailetContext has bounce
methods that are intended to send the notice.  It might be useful to modify
them such that we can provide the necessary information, such as the
message, the DSN-status, any exception, and the target DSN processor.  The
MailetContext can verify that the processor exists, which would be a good
thing.

> My DSNBounce Mailet could easy be re-written to handle all DSNs, not only
> Bounces like it does at the moment. "delayed"-reports and
"success"-reports
> may be done in this way. But therefore more information must be provided
to
> the Mailet. I would suggest a DSN-specific Attribute that holds an
"Enhanced
> Mail System Status Code" (RFC3463).  This should be set either by the
> SMTP-handler (which could implement RFC3461 - SMTP service extension for
> DSN) or by RemoteDelivery. At the moment my Mailet is "guessing" this
Status
> Code using the exception catched in RemoteDelivery.

I agree.  However, I think that we also need to parameterize the system so
that we can be selective about which DSNs we want to provide.  Not everyone
will want to provide as much information.

> JavaMail 1.3.1 doesn't support the MIME-Type "message/delivery-status"
> and I don't have the time to look at the JavaBeans Activation Framework
> for writing an own DataContentHandler for this MIME-Type.

For now, use text/plain.  Far better than nothing, and we can improve it
incrementally.

Thoughts?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org