OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: [Novice] - Header_checks

From: Magnus Bäck (magnusdsek.lth.se)
Date: Wed Oct 31 2007 - 05:20:17 CDT


On Wed, October 31, 2007 9:53 am, Cedric BUSCHINI said:

> I'd like to perform a test (if ... endif) on headers.
> My aim is to check if the 'subject' feild contains a specific words and
> if the mail is not sent to a specific address.
>
> I've tried :
>
> if /^Subject: Specific Words/
> /^!To: specific.userexemple.com/
> REDIRECT new.addressexemple.com
> endif

This is not possible to do with header_checks. Quoting header_checks(5):

BUGS
       Many people overlook the main limitations of header and
       body_checks rules.

       o These rules operate on one logical message header
              or one body line at a time. A decision made for one
              line is not carried over to the next line.

--
Magnus Bäck
magnusdsek.lth.se