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 Jason Clark <je...@gmail.com> on 2005/06/16 21:35:53 UTC

forwarding mail within a mailet

Hello all,

I'm looking for a tidy way to forward an email from within a mailet. 

I'm trying to avoid using the <forwardto> in config.xml if at all possible.

Am I missing something simple?

cheers,
jason.

Re: forwarding mail within a mailet

Posted by Theodore Watson <tw...@mindbridge.com>.
Check out the code for Redirect.java, its pretty simple.

Essentially, you just duplicate the original email:

Mail newMail = ((MailImpl) mail).duplicate(newName((MailImpl) mail));

set the recipients to newMail, set the remote host to be your host and then 
send it:

getMailetContext().sendMail(newMail);

On Thursday 16 June 2005 15:35, Jason Clark wrote:
> Hello all,
>
> I'm looking for a tidy way to forward an email from within a mailet.
>
> I'm trying to avoid using the <forwardto> in config.xml if at all possible.
>
> Am I missing something simple?
>
> cheers,
> jason.

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


Re: forwarding mail within a mailet

Posted by Theodore Watson <te...@mindbridge.com>.
Check out the code for Redirect.java, its pretty simple.

Essentially, you just duplicate the original email:

Mail newMail = ((MailImpl) mail).duplicate(newName((MailImpl) mail));

set the recipients to newMail, set the remote host to be your host and then 
send it:

getMailetContext().sendMail(newMail);

On Thursday 16 June 2005 15:35, Jason Clark wrote:
> Hello all,
>
> I'm looking for a tidy way to forward an email from within a mailet.
>
> I'm trying to avoid using the <forwardto> in config.xml if at all possible.
>
> Am I missing something simple?
>
> cheers,
> jason.

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