This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
reference:spamrules_statement_ifmatch [2011/08/24 14:21] – simon | reference:spamrules_statement_ifmatch [2018/11/14 10:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 32: | Line 32: | ||
^whitelist | ^whitelist | ||
^blacklist | ^blacklist | ||
- | ^''< | + | ^''< |
- | ^Raw-''< | + | ^Raw-''< |
^attachment | ^attachment | ||
^rawmessage | ^rawmessage | ||
Line 39: | Line 39: | ||
=====Search===== | =====Search===== | ||
- | The search parameter to the **IfMatch** statement can either be a regular expression or a simple substring search string. | + | The search parameter to the **IfMatch** statement can either be a regular expression or a simple |
You should put quotes around the text or Perl Compatible Regular Expression (PCRE) to search for. | You should put quotes around the text or Perl Compatible Regular Expression (PCRE) to search for. | ||
Line 59: | Line 59: | ||
=====Example===== | =====Example===== | ||
- | This following example will perform a regular expression search of the Subject line of the message header to see if it contains the text **hello** anywhere. | + | This following example will perform a case insensitive |
< | < | ||
IfMatch subject "/ | IfMatch subject "/ | ||
+ | # Statements | ||
+ | EndIf | ||
+ | </ | ||
+ | |||
+ | The example above does not need a regular expression and could also be achieved with a substring search, like so: | ||
+ | < | ||
+ | IfMatch subject " | ||
+ | # Statements | ||
+ | EndIf | ||
+ | </ | ||
+ | |||
+ | This following example uses a regular expression to check whether a Cc header is present | ||
+ | < | ||
+ | IfMatch cc "/ | ||
# Statements | # Statements | ||
EndIf | EndIf | ||
</ | </ |