Subba Rao writes:

> On  0, Sam <[EMAIL PROTECTED]> wrote:
> > > 
> > > The OR operator ( || ) is for 2 expressions. The correct syntax should be
> > > 
> > > if(^/(To|Cc): .*(jack|bob).*/ ){
> > >     to "!jack bob"
> > > }
> > 
> > Congratulations.  Any time either jack or bob receives a message, both of
> > them will now receive a copy of it.
> > 
> > That's not what the guy wants.
> > 
> 
> Ok here it is. 
> 
> if(^/(To|Cc): .*(jack&bob).*/ ) {
>     to "!jack bob"
> }

When there's a To: or Cc: header that contains the string 'jack&bob',
verbatim, forward the message to both of them.

& carries no special meaning in regular expressions.

> if(^/(To): .*(jack|bob).*/ && ^/Cc: .*(jack|bob).*/ ) {
>     to "!jack bob"
> }

If there's a To: header containing either jack, or bob, and that there is a
Cc: header containing either jack, or bob, forward the message to both of
them.

According to these rules, if a message contains the following header:

To: jack, bob

The message will be discarded, because it meets neither conditions.

What you really want to do is very simple:

if (hasaddr("[EMAIL PROTECTED]"))
{
    cc "! jack"
}

if (hasaddr("[EMAIL PROTECTED]"))
{
    cc "! bob"
}

# Rest of the filtering instructions

Reply via email to