Regular Expression in content filter

Unanswered Question
Oct 15th, 2009
User Badges:

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
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Andrew Wurster Fri, 10/16/2009 - 16:32
User Badges:

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

sven_warnke_ironport Tue, 10/27/2009 - 15:13
User Badges:

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

Actions

This Discussion