You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Shal Jain <sh...@intertechsys.com> on 2002/03/01 20:21:12 UTC

Re: programmatic bounce

Thanx for the clarification - I was under the assumption that the constants
were the only valid values that could be
specified for setState

----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: "James Users List" <ja...@jakarta.apache.org>
Sent: Thursday, February 28, 2002 3:52 PM
Subject: Re: programmatic bounce


> 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" <sh...@intertechsys.com>
> To: "James Users List" <ja...@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" <da...@thought.co.uk>
> > To: "James Users List" <ja...@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:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>