Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Regular Expression in content filter

Hey,

i want to create a content filter with the "body-contains"-condition in combination with a regular expression. To specify it:
I want to check whether a string (disclaimer) is already added to the email. If not, i have to add the footer.
So to say: REGULAR EXPRESSION = does not contain "string"
But how does the regular expression look like?

          <rule>
<rule_type>Only_Body_Contains_Rule</rule_type>
<rule_data>REGULAR EXPRESSION (does not contain...)</rule_data>
<rule_extra1>1</rule_extra1>
</rule>


Thx

2 REPLIES
Community Member

Re: Regular Expression in content filter

you MAY be able to use a negative lookahead assertion like:
?!EXPRESSION
this results in:
content_filter: if (only-body-contains("?!disclaimer text", 1) )

OR in message filters you can say:
if ( not body-contains("EXPRESSION",1) )


all that said, you should just have two content filters, 1 to check for the filter and deliver immediately (w/o filter stamp) and another catch-all filter to stamp filters. for example:

disclaimer_skip
disclaimer_skip: if (only-body-contains("disclaimer text", 1)) { deliver(); }

outbound-disclaimer-catchall
outbound-disclaimer-catchall: if (true) { add-footer("my_disclaimer"); }

cheers,

andrew

Community Member

Re: Regular Expression in content filter

i opened a ticket at ironport and the answer is:
it doens't work the way i want to do it.

the way of doing it with a message filter will be the easiest one

712
Views
0
Helpful
2
Replies
CreatePlease to create content