[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-user
Subject:    Re: programmatic bounce
From:       "Serge Knystautas" <sergek () lokitech ! com>
Date:       2002-02-28 21:52:54
[Download RAW message or body]

Shal,

I can't understand why you want to add CUSTOMERROR to the mailet API.  The
Mail.setState methods takes a String, not the name of a constant in the
mailet API.  If you want to send a message to the "foobar" processor to
execute some custom mailets, either use the ToProcessor mailet to send it to
"foobar" or in a mailet call setState("foobar").  The setState method does
not iterate through the final fields on the Mail class and throw an
exception if you set it to some String not defined there.  You can add as
many custom mailets, stick them in as many custom processors as you want,
and call setState to any of those custom processors just by changing your
xml conf file.

The states defined as constants by the mailet API have the following special
meanings:
- DEFAULT is where all incoming messages start getting processed.  it is
"root" (we might want to change this so the names match)
- ERROR is where messages are sent if an uncaught exception is thrown.  it
is "error"
- GHOST indicates a message is to be deleted/consumed by the mailet context
(it gets sent nowhere).  it is "ghost".
- TRANSPORT probably could be removed as there isn't an internal meaning
except to generally mean that the message is ready for delivery... it is
"transport"

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "Shal Jain" <shal_jain@intertechsys.com>
To: "James Users List" <james-user@jakarta.apache.org>
Sent: Thursday, February 28, 2002 4:41 PM
Subject: Re: programmatic bounce


> There seems to be no Mail.CUSTOMERROR constant defined in the mailet.jar
in
> James 2.0a2
> Only available states are DEFAULT, ERROR, GHOST, TRANSPORT.
>
> For my particular needs, going to the ERROR processor is not enough.  I
> truly need to do some custom processing
> which also requires custom mailets/matchers
>
> I suppose I can define yet another constant and rebuild the source but I
was
> hoping not to.
> I'd be glad to submit a mod that allows defining of custom states and
> processors in config.xml if folks feel
> its useful.
>
>
>
> ----- Original Message -----
> From: "Danny Angus" <danny@thought.co.uk>
> To: "James Users List" <james-user@jakarta.apache.org>
> Sent: Thursday, February 21, 2002 4:46 AM
> Subject: RE: programmatic bounce
>
>
> > > if a
> > > certain condition
> > > occurs, I need to bounce the email back to the sender
> > > Is there a straightforward way to do so
> >
> > mail.setState(Mail.CUSTOMERROR);
> >
> >
> > will send this mail to the CUSTOMERROR processor, which can have a
mailet
> > configured to bounce the mail, for example ..
> >
> > <spoolmanager>
> > ......... sniped every preceding node for clarity ............
> >         <processor name="customerror">
> >           <mailet match="All" class="NotifySender">
> >           </mailet>
> >         </processor>
> > ......... more nodes snipped ...............
> > </spoolmanager>
> >
> > d.


--
To unsubscribe, e-mail:   <mailto:james-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic