<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<filters>
		<filter name="primary">
			<log>
				<option type="match true" />
				<option type="rules with match" />
				<option type="execution" />
			</log>
			<results default="accept">
				<result key="accept">
					<return>0</return>
					<copy enabled="yes" createdir="yes">c:\regexflt\accepted\{yyyy}-{mm}\{smtp:rcpt_to_domain}\{smtp:rcpt_to_mailbox}\{source:filename}{smtp:recipient_id}.txt</copy>
					<copy enabled="yes" operation="append" mail="no" append="&quot;{smtp:client_ip}&quot;,&quot;{smtp:helo}&quot;,&quot;{smtp:mail_from}&quot;,&quot;{smtp:rcpt_to}&quot;,&quot;{mm}/{dd}/{yyyy} {HH}:{MM}:{SS}&quot;,&quot;{smtp:mail_from_mailbox}&quot;,&quot;{smtp:mail_from_domain}&quot;,&quot;{smtp:rcpt_to_mailbox}&quot;,&quot;{smtp:rcpt_to_domain}&quot;,&quot;accept&quot;,&quot;default&quot;,&quot;c:\\regexflt\\accepted\\{yyyy}-{mm}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{source:filename}{smtp:recipient_id}.txt&quot;\r\n">c:\regexflt\accepted\{yyyy}-{mm}\log.txt</copy>
					<imap enabled="no" createdir="yes">c:\Program Files\Merak\mail\2150.com\rejectedmail\RegEx Accepted\{source:filename}{smtp:recipient_id}.imap</imap>
					<http enabled="no">http://localhost/2150/regexflt_test.asp</http>
				</result>
				<result key="accept_do_nothing">
					<return>0</return>
				</result>
				<result key="mark">
					<return>0</return>
					<copy enabled="yes" createdir="yes">c:\regexflt\accepted\{yyyy}-{mm}\{smtp:rcpt_to_domain}\{smtp:rcpt_to_mailbox}\{source:filename}{smtp:recipient_id}.txt</copy>
					<copy enabled="yes" operation="append" mail="no" append="&quot;{smtp:client_ip}&quot;,&quot;{smtp:helo}&quot;,&quot;{smtp:mail_from}&quot;,&quot;{smtp:rcpt_to}&quot;,&quot;{mm}/{dd}/{yyyy} {HH}:{MM}:{SS}&quot;,&quot;{smtp:mail_from_mailbox}&quot;,&quot;{smtp:mail_from_domain}&quot;,&quot;{smtp:rcpt_to_mailbox}&quot;,&quot;{smtp:rcpt_to_domain}&quot;,&quot;mark&quot;,&quot;whitelist&quot;,&quot;c:\\regexflt\\accepted\\{yyyy}-{mm}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{source:filename}{smtp:recipient_id}.txt&quot;\r\n">c:\regexflt\accepted\{yyyy}-{mm}\log.txt</copy>
					<imap enabled="no" createdir="yes">c:\Program Files\Merak\mail\2150.com\rejectedmail\RegEx Accepted\{source:filename}{smtp:recipient_id}.imap</imap>
					<http enabled="no">http://localhost/2150/regexflt_test.asp</http>
					<modifysource enabled="yes">
					  <header enabled="yes" action="add" item="X-RegEx-Filter" value="regex_whitelist.xml" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-Title" value="{result:rule:title}" comment="Not yet implemented" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-UID" value="{result:rule:uid}" comment="Not yet implemented" />
					</modifysource>
				</result>
				<result key="mark_high">
					<return>0</return>
					<copy enabled="yes" createdir="yes">c:\regexflt\accepted\{yyyy}-{mm}\{smtp:rcpt_to_domain}\{smtp:rcpt_to_mailbox}\{source:filename}{smtp:recipient_id}.txt</copy>
					<copy enabled="yes" operation="append" mail="no" append="&quot;{smtp:client_ip}&quot;,&quot;{smtp:helo}&quot;,&quot;{smtp:mail_from}&quot;,&quot;{smtp:rcpt_to}&quot;,&quot;{mm}/{dd}/{yyyy} {HH}:{MM}:{SS}&quot;,&quot;{smtp:mail_from_mailbox}&quot;,&quot;{smtp:mail_from_domain}&quot;,&quot;{smtp:rcpt_to_mailbox}&quot;,&quot;{smtp:rcpt_to_domain}&quot;,&quot;mark_high&quot;,&quot;whitelist&quot;,&quot;c:\\regexflt\\accepted\\{yyyy}-{mm}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{source:filename}{smtp:recipient_id}.txt&quot;\r\n">c:\regexflt\accepted\{yyyy}-{mm}\log.txt</copy>
					<imap enabled="no" createdir="yes">c:\Program Files\Merak\mail\2150.com\rejectedmail\RegEx Accepted\{source:filename}{smtp:recipient_id}.imap</imap>
					<http enabled="no">http://localhost/2150/regexflt_test.asp</http>
					<modifysource enabled="yes">
					  <header enabled="yes" action="add" item="X-RegEx-Filter" value="regex_whitelist.xml" />
					  <header enabled="yes" action="replaceoradd" item="Importance" value="High" />
					  <header enabled="yes" action="replaceoradd" item="X-Priority" value="1 (Highest)" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-Title" value="{result:rule:title}" comment="Not yet implemented" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-UID" value="{result:rule:uid}" comment="Not yet implemented" />
					</modifysource>
				</result>
			</results>
			<parser>
				<maxlines>10000</maxlines>
				<maxbuffer>500000</maxbuffer>
				<quickresult>yes</quickresult>
			</parser>
			<rules>
				<rule result="accept_do_nothing">
					<title>Whitelist MAIL FROM (do nothing)</title>
					<comment>Allow all email from these addresses (outbound mailing lists)</comment>
					<scope>
						<mailfrom>all</mailfrom>
					</scope>
					<expressions oninit="score=0" logic="return score > 0">
						<expression casesensitive="no" type="regex" onmatch="score += 1">clubgayday@gayday\.com</expression>
					</expressions>
				</rule>
				<rule result="mark_high">
					<title>Secret phrase</title>
					<comment>Secret phrase to force email to be accepted unconditionally. Any email containing one of these phrases will be accepted.</comment>
					<scope>
						<header>all</header>
						<body>all</body>
					</scope>
					<expressions oninit="score=0" logic="return score > 0">
						<expression casesensitive="no" type="regex" onmatch="score += 1" comment="You should change this to something unique for your installation">abcd---ACCEPT---wxyz</expression>
					</expressions>
				</rule>
				<rule result="mark">
					<title>Whitelist MAIL FROM</title>
					<comment>Allow all email from these addresses (used to allow certain email from known respectful mailers, especially those whose email might otherwise get rejected because of content); open for abuse since these addresses could be forged, don't use indiscriminately</comment>
					<scope>
						<mailfrom>all</mailfrom>
					</scope>
					<expressions oninit="score=0" logic="return score > 0">
						<expression casesensitive="no" type="regex" onmatch="score += 1">@[-A-Za-z0-9_]+\.avsforum\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@badpuppy\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@badpuppymag\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@canamsatellites\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@capitaloneauto\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@([-A-Za-z0-9_]+\.){0,}att\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@commerceonline\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@dell\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@([-A-Za-z0-9_]+\.){0,}delta\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@directnic\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@([-A-Za-z0-9_]+\.){0,}elecard\.net\.ru</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@freessl\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@godaddy\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@icewarp\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@jblair\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@officialticketcenter\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1">service@paypal\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@paypal\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@pwebtech\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@solweb\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@supportwebsite\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">@tivo\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">briancbottorff@aol\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">bbottorff@biltmorecomm\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">reunionpartyinfo@aol\.com</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">maxflightcorp@aol\.com</expression>
					</expressions>
				</rule>
				<rule result="mark">
					<title>Whitelist RCPT TO</title>
					<comment>Allow all email from these addresses (can be used to effectively disable filtering to specific users/domains, though the index is a better way to do this</comment>
					<scope>
						<rcptto>all</rcptto>
					</scope>
					<expressions oninit="score=0" logic="return score > 0">
					</expressions>
				</rule>
				<rule result="mark">
					<title>Whitelist body</title>
					<comment>Whitelist based on these expressions being in the body of an email</comment>
					<scope>
						<body>all</body>
					</scope>
					<expressions oninit="score=0" logic="return score > 0">
					</expressions>
				</rule>
			</rules>
		</filter>
		<filter name="secondary">
			<log>
				<option type="match true" />
				<option type="rules with match" />
				<option type="execution" />
			</log>
			<results default="accept">
				<result key="accept">
					<return>0</return>
					<copy enabled="yes" createdir="yes">c:\regexflt\accepted\{yyyy}-{mm}\{smtp:rcpt_to_domain}\{smtp:rcpt_to_mailbox}\{source:filename}{smtp:recipient_id}.txt</copy>
					<copy enabled="yes" operation="append" mail="no" append="&quot;{smtp:client_ip}&quot;,&quot;{smtp:helo}&quot;,&quot;{smtp:mail_from}&quot;,&quot;{smtp:rcpt_to}&quot;,&quot;{mm}/{dd}/{yyyy} {HH}:{MM}:{SS}&quot;,&quot;{smtp:mail_from_mailbox}&quot;,&quot;{smtp:mail_from_domain}&quot;,&quot;{smtp:rcpt_to_mailbox}&quot;,&quot;{smtp:rcpt_to_domain}&quot;,&quot;accept&quot;,&quot;default&quot;,&quot;c:\\regexflt\\accepted\\{yyyy}-{mm}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{source:filename}{smtp:recipient_id}.txt&quot;\r\n">c:\regexflt\accepted\{yyyy}-{mm}\log.txt</copy>
					<imap enabled="no" createdir="yes">c:\Program Files\Merak\mail\2150.com\rejectedmail\RegEx Accepted\{source:filename}{smtp:recipient_id}.imap</imap>
					<http enabled="no">http://localhost/2150/regexflt_test.asp</http>
				</result>
				<result key="mark">
					<return>0</return>
					<copy enabled="yes" createdir="yes">c:\regexflt\accepted\{yyyy}-{mm}\{smtp:rcpt_to_domain}\{smtp:rcpt_to_mailbox}\{source:filename}{smtp:recipient_id}.txt</copy>
					<copy enabled="yes" operation="append" mail="no" append="&quot;{smtp:client_ip}&quot;,&quot;{smtp:helo}&quot;,&quot;{smtp:mail_from}&quot;,&quot;{smtp:rcpt_to}&quot;,&quot;{mm}/{dd}/{yyyy} {HH}:{MM}:{SS}&quot;,&quot;{smtp:mail_from_mailbox}&quot;,&quot;{smtp:mail_from_domain}&quot;,&quot;{smtp:rcpt_to_mailbox}&quot;,&quot;{smtp:rcpt_to_domain}&quot;,&quot;mark&quot;,&quot;whitelist&quot;,&quot;c:\\regexflt\\accepted\\{yyyy}-{mm}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{source:filename}{smtp:recipient_id}.txt&quot;\r\n">c:\regexflt\accepted\{yyyy}-{mm}\log.txt</copy>
					<imap enabled="no" createdir="yes">c:\Program Files\Merak\mail\2150.com\rejectedmail\RegEx Accepted\{source:filename}{smtp:recipient_id}.imap</imap>
					<http enabled="no">http://localhost/2150/regexflt_test.asp</http>
					<modifysource enabled="yes">
					  <header enabled="yes" action="add" item="X-RegEx-Filter" value="regex_whitelist.xml" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-Title" value="{result:rule:title}" comment="Not yet implemented" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-UID" value="{result:rule:uid}" comment="Not yet implemented" />
					</modifysource>
				</result>
				<result key="mark_high">
					<return>0</return>
					<copy enabled="yes" createdir="yes">c:\regexflt\accepted\{yyyy}-{mm}\{smtp:rcpt_to_domain}\{smtp:rcpt_to_mailbox}\{source:filename}{smtp:recipient_id}.txt</copy>
					<copy enabled="yes" operation="append" mail="no" append="&quot;{smtp:client_ip}&quot;,&quot;{smtp:helo}&quot;,&quot;{smtp:mail_from}&quot;,&quot;{smtp:rcpt_to}&quot;,&quot;{mm}/{dd}/{yyyy} {HH}:{MM}:{SS}&quot;,&quot;{smtp:mail_from_mailbox}&quot;,&quot;{smtp:mail_from_domain}&quot;,&quot;{smtp:rcpt_to_mailbox}&quot;,&quot;{smtp:rcpt_to_domain}&quot;,&quot;mark_high&quot;,&quot;whitelist&quot;,&quot;c:\\regexflt\\accepted\\{yyyy}-{mm}\\{smtp:rcpt_to_domain}\\{smtp:rcpt_to_mailbox}\\{source:filename}{smtp:recipient_id}.txt&quot;\r\n">c:\regexflt\accepted\{yyyy}-{mm}\log.txt</copy>
					<imap enabled="no" createdir="yes">c:\Program Files\Merak\mail\2150.com\rejectedmail\RegEx Accepted\{source:filename}{smtp:recipient_id}.imap</imap>
					<http enabled="no">http://localhost/2150/regexflt_test.asp</http>
					<modifysource enabled="yes">
					  <header enabled="yes" action="add" item="X-RegEx-Filter" value="regex_whitelist.xml" />
					  <header enabled="yes" action="replaceoradd" item="Importance" value="High" />
					  <header enabled="yes" action="replaceoradd" item="X-Priority" value="1 (Highest)" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-Title" value="{result:rule:title}" comment="Not yet implemented" />
					  <header enabled="no" action="add" item="X-RegEx-Filter-UID" value="{result:rule:uid}" comment="Not yet implemented" />
					</modifysource>
				</result>
			</results>
			<parser>
				<maxlines>1000</maxlines>
				<maxbuffer>10000</maxbuffer>
				<quickresult>yes</quickresult>
			</parser>
			<rules>
				<rule result="mark">
					<title>Whitelist subject</title>
					<comment>Exclude subject lines with a date at the end or with "order"/"confirm"/"reservation" in them to catch online orders and reservations that append an order # that otherwise would flag immediately as SPAM.</comment>
					<scope>
						<header>all</header>
					</scope>
					<expressions oninit="score=0" logic="return score > 0">
						<expression casesensitive="no" type="regex" onmatch="score -= 10" comment="If viagra is in the subject, don't allow whitelist subjects to work">^subject:.+\bv[iI1]agra\b</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Exclude any from address with 'advize'">^from:.+advize</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Exclude any subject with 'debt'">^subject:.+debt</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">^subject:.+20(03\|04\|05\|06\|07\|08\|09\|10\|11\|12)$</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it starts with 'you can'">^subject:.+\byou can order\b</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'diet'">^subject:.+\bdiet</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'drugs'">^subject:.+\bdrugs</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'log in'">^subject:.+\blog +in</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'medication'">^subject:.+\bmedication</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'meds'">^subject:.+\bmeds</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'offer confirmation'">^subject:.+\boffer +confirmation</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'order approved'">^subject:.+\border +approved</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'penis'">^subject:.+pen[iIl1]s</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'porno'">^subject:.+p[oO0]rn[oO0]</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'virgin'">^subject:.+\bv[iI1]rg[iI1]n</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'waiting on your'">^subject:.+\bwaiting +on +your</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'we want'">^subject:.+\bwe +want</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'xanax'">^subject:.+\bxanax</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'order' if it has 'you can order'">^subject:.+\byou +can +order</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">^subject:.+\border\b</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'confirm' if it has 'your information'">^subject:.+\byour +information</expression>
						<expression casesensitive="no" type="regex" onmatch="score -= 1" comment="Don't whitelist based on 'confirm' if it has 'as seen on">^subject:.+\bas +seen +on</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">^subject:.+\bconfirm</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">^subject:.+\breservation</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">^subject:.+priceline.+request</expression>
						<expression casesensitive="no" type="regex" onmatch="score += 1">^subject:.+\bshipment</expression>
					</expressions>
				</rule>
			</rules>
		</filter>
	</filters>
</configuration>