|
<html>
<link rel=StyleSheet href=help.css>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Online Help</title>
<style type="text/css">
.style1 {
text-align: left;
}
</style>
</head>
<body >
<p class="masthead">global message rules - expression</p>
<p class="nav"><a href="#">Home/<a href="#">Administration</a>/<a href="Grules.htm">GlobalMessageRules</a>/<a href="#">Match
Expression</a></p>
<p class="posttitle"> Global Message Rules - Match Expression</p>
<p class="post">Match Expression is a text field which accepts a certain syntax that
defines the rule expression.<br>
Expression consists of matchers, operators and values which defines a condition.<br>
<pre>matcher operator "value"<br><br><i>A simple example of a condition would be:</i><br><b>Date == "2006.02.23"</b><br>where Date is the matcher, == is the operator and "2006.02.23" is the value.<br>This condition can be read as "If the Date is equal to 2006.02.23".</pre>
<p class="post">You can join multiple conditions with clauses or negate them;</p>
<pre> Condition1 <b>AND</b> Condition2 => If Condition1 and Condition2 are both true<br> Condition1 <b>OR</b> Condition2 => If Condition1 or Condition2 is true <br> <b>NOT </b>Condition1 => Reverse Condition1; false if true, true if false</pre>
<pre> Conditions can also be parenthesized set of matchers;<br><br> Date <b>==</b> "2006.02.23" <b>AND</b> <b>(</b>HeaderField "X-Priority:" <b><</b> "4" <b>AND</b> HeaderField "X-Priority:" <b>!=</b> "1"<b>)</b><br><br> As you can see from the above example, we are following the syntax of if-then statement in C</pre>
<p class="posttitle">Matchers:</p>
<p class="post">Following are the available matchers: <SP> is referring to the
single space separation (Space bar).</p>
<table class="htable" cellSpacing="0" cellPadding="5" border="0" id="table1">
<tr>
<th class="htableheader" style="width: 96px">Matcher</th>
<th class="htableheader" style="width: 124px">Usage</th>
<th class="htableheader" style="width: 159px">Description </th>
<th class="htableheader" style="width: 43px">API </th>
<th class="htableheader">Example</th>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>smtp.mail_from</b></td>
<td class="htablerow" style="width: 124px">smtp.mail_from</td>
<td class="htablerow" style="width: 159px">SMTP command MAIL FROM: value</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">smtp.mail_from <strong>!=</strong> "ivar@lumisoft.ee"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>smtp.rcpt_to</b></td>
<td class="htablerowOdd" style="width: 124px">smtp.rcpt_to</td>
<td class="htablerowOdd" style="width: 159px">SMTP command RCPT TO: values</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">smtp.rcpt_to <strong>==</strong> "me@domain.com"</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>smtp.ehlo</b></td>
<td class="htablerow" style="width: 124px">smtp.ehlo</td>
<td class="htablerow" style="width: 159px">SMTP command EHLO/HELO: value</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">smtp.ehlo == "ABC Server ready"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>smtp.authenticated</b></td>
<td class="htablerowOdd" style="width: 124px">smtp.authenticated</td>
<td class="htablerowOdd" style="width: 159px">Specifies if SMTP session is
authenticated</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">smtp.authenticated == true</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>smtp.user</b></td>
<td class="htablerow" style="width: 124px">smtp.user</td>
<td class="htablerow" style="width: 159px">SMTP authenticated user name. Empy
string "" if not authenticated</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">smtp.user =="ivar"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>smtp.remote_ip</b></td>
<td class="htablerowOdd" style="width: 124px">smtp.remote_ip</td>
<td class="htablerowOdd" style="width: 159px">SMTP session connected client IP
address</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">smtp.remote_ip == "192.168.1.10"</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>message.size</b></td>
<td class="htablerow" style="width: 124px">message.size</td>
<td class="htablerow" style="width: 159px">Message size in bytes</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">message.size > "1024"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>message.header</b></td>
<td class="htablerowOdd" style="width: 124px">message.header <SP> "HeaderFieldName:"</td>
<td class="htablerowOdd" style="width: 159px">Message main header header field. If
multiple header fields, then all are checked</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">message.header "CustomHeader:" == "YES"</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>message.all_headers</b></td>
<td class="htablerow" style="width: 124px">message.all_headers <SP> "HeaderFieldName:"</td>
<td class="htablerow" style="width: 159px">Any mime entity header field. If
multiple header fields, then all are checked.</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">message.all_headers "CustomHeader:" =="YES"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>message.body_text</b></td>
<td class="htablerowOdd" style="width: 124px">message.body_text</td>
<td class="htablerowOdd" style="width: 159px">Plain text body of the message</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">message.body_text * "viagra"</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>message.body_html</b></td>
<td class="htablerow" style="width: 124px">message.body_html</td>
<td class="htablerow" style="width: 159px">HTML body of the message</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">message.body_html * "size=12"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>message.content_md5</b></td>
<td class="htablerowOdd" style="width: 124px">message.content_md5</td>
<td class="htablerowOdd" style="width: 159px">Message any mime entity decoded data
MD5 hash.</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">message.content_md5 == "A3BE4D3C553CA"</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>sys.date_time</b></td>
<td class="htablerow" style="width: 124px">sys.date_time</td>
<td class="htablerow" style="width: 159px">System current date time. Format:
yyyy.MM.dd HH:mm:ss</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">sys.date_time == "2006.01.01 24:00:00"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>sys.date</b></td>
<td class="htablerowOdd" style="width: 124px">sys.date</td>
<td class="htablerowOdd" style="width: 159px">System current date. Format:
yyyy.MM.dd</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">sys.date == "2006.01.01"</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>sys.time</b></td>
<td class="htablerow" style="width: 124px">sys.time</td>
<td class="htablerow" style="width: 159px">System current time. Format: HH:mm:ss.</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">sys.time=="24:00:00"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>sys.day_of_week</b></td>
<td class="htablerowOdd" style="width: 124px">sys.day_of_week</td>
<td class="htablerowOdd" style="width: 159px">Day of week. Days: sunday,monday,
tuesday, wednesday, thursday, friday, saturday.</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">sys.day_of_week =="sunday"</td>
</tr>
<tr>
<td class="htablerow" style="width: 96px"><b>sys.day_of_month</b></td>
<td class="htablerow" style="width: 124px">sys.day_of_month</td>
<td class="htablerow" style="width: 159px">Day of month. Format: 1 - 31. If no so
much days in month, then replaced with month max days.</td>
<td class="htablerow" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerow">sys.day_of_month == "31"</td>
</tr>
<tr>
<td class="htablerowOdd" style="width: 96px"><b>sys.day_of_year</b></td>
<td class="htablerowOdd" style="width: 124px">sys.day_of_year</td>
<td class="htablerowOdd" style="width: 159px">Month of year. Format: 1 - 12</td>
<td class="htablerowOdd" style="width: 43px">
<p class="style1">N/A</p>
</td>
<td class="htablerowOdd">sys.day_of_year =="12"</td>
</tr>
</table>
<br>
<p class="posttitle">Operators:</p>
<table class="htable" cellSpacing="0" cellPadding="5" border="0" id="table2">
<tr>
<th class="htableheader">Operator</th>
<th class="htableheader">Usage</th>
<th class="htableheader" style="width: 190px">Description</th>
<th class="htableheader">API info</th>
<th class="htableheader">Example</th>
</tr>
<tr>
<td class="htablerow" style="text-align: center">></td>
<td class="htablerow">> <SP> "value"</td>
<td class="htablerow" style="width: 190px">matcher bigger than value</td>
<td class="htablerow" style="text-align: center">N/A</td>
<td class="htablerow">HeaderField "X-Priority:" <strong>></strong> "2"</td>
</tr>
<tr>
<td class="htablerow" style="text-align: center; height: 26px;"><</td>
<td class="htablerow" style="height: 26px">< <SP> "value"</td>
<td class="htablerow" style="height: 26px; width: 190px">matcher smaller than value</td>
<td class="htablerow" style="text-align: center; height: 26px;">N/A</td>
<td class="htablerow" style="height: 26px">HeaderField "X-Priority:"
<strong><</strong> "4"</td>
</tr>
<tr>
<td class="htablerow" style="text-align: center">!=</td>
<td class="htablerow">!= <SP> "value"</td>
<td class="htablerow" style="width: 190px">matcher Not equal to value.</td>
<td class="htablerow" style="text-align: center">N/A</td>
<td class="htablerow">smtp.mail_from <strong>!=</strong> "ivar@lumisoft.ee"</td>
</tr>
<tr>
<td class="htablerow" style="text-align: center">==</td>
<td class="htablerow">== <SP> "value"</td>
<td class="htablerow" style="width: 190px">matcher Equal to value</td>
<td class="htablerow" style="text-align: center">N/A</td>
<td class="htablerow">smtp.mail_from <strong>==</strong> "ivar@lumisoft.ee"</td>
</tr>
<tr>
<td class="htablerow" style="text-align: center">>=</td>
<td class="htablerow">>= <SP> "value"</td>
<td class="htablerow" style="width: 190px">matcher bigger or equal to value</td>
<td class="htablerow" style="text-align: center">N/A</td>
<td class="htablerow">HeaderField "X-Priority:" <strong>>=</strong> "3"</td>
</tr>
<tr>
<td class="htablerow" style="text-align: center"><=</td>
<td class="htablerow"><= <SP> "value"</td>
<td class="htablerow" style="width: 190px">matcher smaller or equal to value</td>
<td class="htablerow" style="text-align: center">N/A</td>
<td class="htablerow">HeaderField "X-Priority:" <strong><=</strong> "3"</td>
</tr>
<tr>
<td class="htablerow" style="text-align: center">*</td>
<td class="htablerow">* <SP> "value"</td>
<td class="htablerow" style="width: 190px">matcher asterisk pattern match to value</td>
<td class="htablerow" style="text-align: center">N/A</td>
<td class="htablerow">HeaderField "From:" * "Ivar"</td>
</tr>
<tr>
<td class="htablerow" style="text-align: center">!*</td>
<td class="htablerow">!* <SP> "value"</td>
<td class="htablerow" style="width: 190px">matcher asterisk pattern
reverse (not match the pattern)</td>
<td class="htablerow" style="text-align: center">N/A</td>
<td class="htablerow">HeaderField "From:" !* "spammer@spam.com"</td>
</tr>
</table>
<p class="posttitle">Examples:</p>
<pre><br>Date == "19.02.2006"
HeaderField "From:" * "*Ivar*"
MainHeaderField "Content-Disposition:" * "*aNL.txt*"
Date == "20.02.2006" AND smtp.mail_from != "ivar@lumisoft.ee"<br>
<br>HeaderField "From:" * "*Ivar*" OR (HeaderField "X-Priority:" < "4" AND HeaderField "X-Priority:" != "1")
HeaderField "MyCustomHeader:" == "THE_VALUE" AND sys.date > "01.01.2006"
</pre>
<p class="dateheader" >Last Modified on 12/3/2006 </p>
<p class="postfooter" >LumiSoft MailServer Online Help (c) 2006. Author: Ivar Lumi</p>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.