I'm just now adding systematically to most places the "unaltered" value as acceptable, 
and behaving like not coding the parameter (i.e. null).

For backward compatibility, in Redirect the logic is to use <recipients>, *if null use 
<to>*, if null no change.
I found an error in the current code: if <recipients> is null, will use <to>; <to> can 
be "unaltered",  but <recipients> can not be "unaltered", so you get the error.

As now <recipients> will accept "unaltered", it will work.

In the meantime, just take out the <to>unaltered</to> line from your config.xml: it is 
redundant.

Vincenzo

> -----Original Message-----
> From: Hontvari Jozsef [mailto:[EMAIL PROTECTED]
> Sent: martedi 24 giugno 2003 18.39
> To: James Developers List
> Subject: Re: subject prefix mailet or unaltered recipients in Redirect
> 
> 
> I tried it but it is not working. Looking at the source it seems 
> to me that
> it follows the original class description.
> 
> I used the following test:
>   <mailet match="[EMAIL PROTECTED]" class="Redirect">
>     <static>true</static>
>     <prefix>[SPAM blackholes-easynet-nl]</prefix>
>     <to>unaltered</to>
>     <passThrough>true</passThrough>
>    </mailet>
> 
> This throws an exception at initialization saying that
> "Special ("magic") address found not allowed: unaltered, allowed 
> values are
> "[postmaster,sender,returnPath]""
> 
> The reason is that if the "recipients" parameter is not supplied 
> it uses the
> "to" parameter. The "to" parameter contains "unaltered" in my case. But
> unaltered is not allowed in recipients.
> 
> Here is the relevant code part:
> 
>     protected Collection getRecipients() throws MessagingException {
>         Collection newRecipients = new HashSet();
>         String addressList = (getInitParameter("recipients") == null)
>                                  ? getInitParameter("to")
>                                  : getInitParameter("recipients");
>         // if nothing was specified, return null meaning no change
>         if (addressList == null) {
>             return null;
>         }
> 


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

Reply via email to