Danny,
Not quite ... Minh Chiem said "[Redirect] changes the message headers so I
lose my original TO's and CC's." The *ORIGINAL* e-mail being passed through
is altered.
The code is:
MimeMessage message = mail.getMessage();
MimeMessage reply = new MimeMessage(..., null);
//Create the message
if(getInLineType() != UNALTERED) {
...
} else {
log("message resent unaltered:");
reply = message;
}
... reply.setThis() and reply.setThat() ...
If inlinetype is UNALTERED, the new MimeMessage is discarded, and the
original message is changed. I believe that the code should be altered to
read:
MimeMessage message = mail.getMessage();
- MimeMessage reply = new MimeMessage(..., null);
+ MimeMessage reply = null;
//Create the message
if(getInLineType() != UNALTERED) {
log("alter message inline=:" + getInLineType());
+ reply = new MimeMessage(..., null);
...
} else {
log("message resent unaltered:");
+ // if we need the original, create a copy of this message to
redirect
+ reply = getPassThrough() ? new MimeMessage(message) : message;
}
... reply.setThis() and reply.setThat() ...
That contains an optimization so that you do reuse the original if you
aren't going to pass it through, otherwise you make a copy to redirect.
--- Noel
-----Original Message-----
From: Danny Angus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 6:07
To: James Users List
Subject: RE: Forwarding mail
Minh, (or should I say Chiem?)
I've just patched Redirect to accomodate your idea, now setting the
<to></to> parameter to be <to>recipients</to> will cause the redirected mail
to have the same addresses in the To header as the original.
You'll have to make it from CVS to get this.
d.
> -----Original Message-----
> From: Minh Chiem [mailto:[EMAIL PROTECTED]]
> Sent: 21 August 2002 09:00
> To: James Users List
> Subject: RE: Forwarding mail
>
>
>
> No good. It changes the message headers so I lose my original TO's and
> CC's. The "To" on the mail that goes to the user changes to
> backup@localhost as well.
>
> This is my config
> <mailet match="RecipientIsNot=backup@localhost" class="Redirect">
> <recipients>backup@localhost</recipients>
> <inline>unaltered</inline>
> <passThrough>true</passThrough>
> </mailet>
>
>
>
>
> "Danny Angus"
>
> <[EMAIL PROTECTED] To: "James
> Users List" <[EMAIL PROTECTED]>
> > cc:
>
> Subject: RE:
> Forwarding mail
> 08/21/02 05:28 PM
>
> Please respond to
>
> "James Users
>
> List"
>
>
>
>
>
>
>
>
>
> use Redirect, and let it pass through
>
> > -----Original Message-----
> > From: Minh Chiem [mailto:[EMAIL PROTECTED]]
> > Sent: 21 August 2002 08:04
> > To: James Users List
> > Subject: RE: Forwarding mail
> >
> >
> >
> > I've tested the RecipientIsNot mailet and there are no problems except
> the
> > original recipient never gets the mail. With the current mailets, is it
> > possible to forward mail to a third party as well as the original
> > recipients?
> >
> >
> >
> >
> >
> >
> > "Noel J. Bergman"
> >
> > <[EMAIL PROTECTED] To: "James
> > Users List" <[EMAIL PROTECTED]>
> > > cc:
> >
> > Subject: RE:
> > Forwarding mail
> > 08/21/02 04:51 PM
> >
> > Please respond to
> >
> > "James Users
> >
> > List"
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Minh,
> >
> > Forward sends the message back to the top of the root processor,
> > so you are
> > forwarding all mail back to yourself over and over and ...
> >
> > > I'm trying to get something like this happening
> >
> > > <mailet match="RecipientIsNot=backup@localhost" class="Forward">
> > > <forwardto>backup@localhost</forwardto>
> > > <passThrough>true</passThrough>
> > > </mailet>
> >
> > That would behave differently. The first time through the recipient
> would
> > match, causing the message to be forwarded; subsequent times, the
> > recipient
> > would not match. You'd still need to be careful not to create any loops
> > later.
> >
> > --- Noel
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]
> >
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]
>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]
>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>