Craig,

I agree you shouldn't use the MailetContext's bounce() method to generate the response... just create the nice bounce message that complies with the RFC and send the mail internally.

However, as for catching and parsing the exceptions, I think long term it would be better to use a custom Transport implementation that gives much better output. The Transport we're using is geared towards client access, so it has very limited information and control.

Alex in the Geronimo project was working on a complete rewrite of JavaMail to get an ASF-licensed version, although the Transport is relatively pluggable so that may be irrelevant.

The threading model for RemoteDelivery shouldn't be an obstacle to this rework. (it's an obstacle to scalability, but that's another conversation :)

--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. [EMAIL PROTECTED]

Craig Raw wrote:
Hi,

I've been taking a look at at RFC 1894
(http://www.ietf.org/rfc/rfc1894.txt) (see earlier discussion 'Catching
a bounce' on server-user) to produce standard delivery status
notifications. I don't think its very elegant to implement given the
current delivery architecture, so my thoughts are as follows:

The RemoteDelivery mailet currently bounces any mail it can't deliver
through a method bounce() in the MailetContext. The error message is
generated inside RemoteDelivery, and the message seems to be fairly
unstructured at this point. Most bounces are thrown as
SendFailedExceptions.

It may be possible to parse up the SendFailedException and extract the
SMTP response code and error message, and set these as separate
attributes in the Mail. RemoteDelivery could then be configured with
another nested element in config.xml, say
<bounceProcessor>remote-delivery-error</bounceProcessor>. On a bounce,
the Mail could be forwarded to this processor.


The remote-delivery-error processor would contain a mailet similar to
the Bounce mailet already present to generate an RFC 1894 compliant
bounce message based on the response code and message set previously in
the Mail. This is similar to the method used in local-address-error with
the Bounce mailet uncommented.

The only obstacle I can't see through is the threading architecture of
the spool/RemoteDelivery, which I haven't examined in detail. Any
thoughts?

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to