27.11.2012 Views

IronPort - advanced configuration guide

IronPort - advanced configuration guide

IronPort - advanced configuration guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Header Rule<br />

6-26<br />

Cisco <strong>IronPort</strong> AsyncOS 7.6 for Email Advanced Configuration Guide<br />

Chapter 6 Using Message Filters to Enforce Email Policies<br />

in US format. (Note that there may be an issue if you are searching messages with non-US date formats.)<br />

the following filter bounces all messages from campaign1@yourdomain.com that are injected after<br />

1:00pm on July 28th, 2003:<br />

TimeOutFilter:<br />

if ((date > '07/28/2003 13:00:00') and (mail-from ==<br />

{<br />

}<br />

'campaign1@yourdomain\\.com'))<br />

bounce();<br />

Note Do not confuse the date rule with the $Date message filter action variable.<br />

The header() rule checks the message headers for a specific header, which must be specified quoted in<br />

parentheses (“header name”). This rule may be compared to a regular expression, much like the subject<br />

rule, or may be used without any comparison, in which case it will be “true” if the header is found in the<br />

message, and “false” if it is not found. For example, the following example checks to see if the header<br />

X-Sample is found, and if its value contains the string “sample text”. If a match is made, the message<br />

is bounced.<br />

FooHeaderFilter:<br />

if (header('X-Sample') == 'sample text')<br />

{<br />

}<br />

bounce();<br />

You can specify non-ASCII characters to search for in the value of the header.<br />

The following example demonstrates the header rule without a comparison. In this case, if the header<br />

X-DeleteMe is found, it is removed from the message.<br />

DeleteMeHeaderFilter:<br />

if header('X-DeleteMe')<br />

{<br />

OL-25137-01

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!