[Mimedefang] Filter Recipient Coding Help

John Nemeth jnemeth at victoria.tc.ca
Fri Aug 19 15:58:56 EDT 2005


On Jan 9,  4:10am, <Matthew.van.Eerde at hbinc.com> wrote:
} Jeff Grossman wrote:
} > if ($recip2 eq 'test at turners.com' or
} >         $recip2 eq 'test2 at turners.com' and
} >         $sender2 ne 'test at aol.com') {
} > ) {
} 
} Parentheses are a good idea here...

     Correction:  parentheses are a MUST....

     The problem is that "and" binds tighter then "or" so Perl sees the
expression as A or (B and C).  If A is true then the whole expression
is true.

} if (
} 	(
} 		$recip2 eq 'test at turners.com' or
} 		$recip2 eq 'test2 at turners.com'
} 	) and
} 	$sender2 ne 'test at aol.com'
} ) {
} 
} but the logic looks like it shold have worked anyway.

     No, see above.

}-- End of excerpt from <Matthew.van.Eerde at hbinc.com>



More information about the MIMEDefang mailing list