User Tools

Site Tools


reference:spamrules_statement_ifmatch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
reference:spamrules_statement_ifmatch [2011/08/24 15:21] simonreference:spamrules_statement_ifmatch [2018/11/14 10:45] (current) – external edit 127.0.0.1
Line 32: Line 32:
 ^whitelist  |This allows you to see if the search text is in the spam whitelist |2.1.7 | ^whitelist  |This allows you to see if the search text is in the spam whitelist |2.1.7 |
 ^blacklist  |This allows you to see if the search text is in the spam blacklist |2.1.7 | ^blacklist  |This allows you to see if the search text is in the spam blacklist |2.1.7 |
-^''<headername>''  |This lets you search a specific field in the message header. Any header name can be used. Any MIME encoded header lines will be decoded before searching them. |2.1.7 | +^''<headername>''  |This lets you search a specific field in the message header. Any header name can be used. Any MIME encoded header lines will be decoded before searching them. The header name should be typed without the angle brackets (<>).|2.1.7 | 
-^Raw-''<headername>''  |This lets you search a specific field in the message header. Any header name can be used. MIME encoded header lines will not be decoded before searching them. |2.1.7 |+^Raw-''<headername>''  |This lets you search a specific field in the message header. Any header name can be used. MIME encoded header lines will not be decoded before searching them. The header name should be typed without the angle brackets (<>). |2.1.7 |
 ^attachment  |This searches all the attachment filenames in the message |2.1.11 | ^attachment  |This searches all the attachment filenames in the message |2.1.11 |
 ^rawmessage  |This lets you search through the first 10kB of the raw, undecoded message content.|2.2.1 | ^rawmessage  |This lets you search through the first 10kB of the raw, undecoded message content.|2.2.1 |
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 case insensitive substring search string.
  
 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 regular expression search of the Subject line of the message header to see if it contains the text **hello** anywhere.
 <code> <code>
 IfMatch subject "/.*hello.*/i" IfMatch subject "/.*hello.*/i"
 +# Statements
 +EndIf
 +</code>
 +
 +The example above does not need a regular expression and could also be achieved with a substring search, like so:
 +<code>
 +IfMatch subject "hello"
 +# Statements
 +EndIf
 +</code>
 +
 +This following example uses a regular expression to check whether a Cc header is present 
 +<code>
 +IfMatch cc "/./"
 # Statements # Statements
 EndIf EndIf
 </code> </code>
reference/spamrules_statement_ifmatch.1314195660.txt.gz · Last modified: 2018/11/14 10:44 (external edit)