||begin_rules|| ||ifnempty||r_headers_x|| ||define||flt_num||n|| ||endif|| ||end_rules||
||define||flt_num||(||add||flt_num||1||)||
<html>
||include||meta.tpl||
<head>
<link rel="stylesheet" type="text/css" href="||nwimg||||tpl_color||/surge.css" />
<script type="text/javascript">
<!--
function HiddenFields(){
	if (document.configform.flt_type[0].checked == true) {
		document.configform.flt_dstfld.value = document.configform.movefld.value;
		document.configform.flt_box.value = 'Move';
	}
	else if (document.configform.flt_type[1].checked == true) {
		document.configform.flt_dstfld.value = document.configform.copyfld.value;
		document.configform.flt_box.value = 'Copy';
	}
	else if (document.configform.flt_type[2].checked == true) {
		if (document.configform.del.checked == true)
			document.configform.flt_forward.value = 'Forward (Del)';
		else
			document.configform.flt_forward.value = 'Forward';
	}
}
//-->
</script>
<script type="text/javascript" src="||common_files||/util.js"></script>
<script type="text/javascript" src="||nwimg||/layout.js"></script>
<title>||cust_title|| - ||lang_str||Filtering Rules||</title>
</head>

<body class="body" onload="doresize();" onresize="doresize()">

||include||_layout_start.tpl||

||ifdef||error||
	||include||_errorinline.tpl||
||endif||
||ifdef||msg||
	||include||_msginline.tpl||
||endif||

<form name="configform" method="post" action="||action||" onsubmit="HiddenFields();">
<input type="hidden" name="cmd" value="filter_add" />
<input type="hidden" name="utoken" value="||utoken||" />
<input type="hidden" name="flt_old_pos" value="||flt_old_pos||" />
<input type="hidden" name="flt_box" value="" />
<input type="hidden" name="flt_forward" value="" />
<input type="hidden" name="flt_dstfld" value="" />
<input type="hidden" name="encode_text" value="flt_dstfld" />


<center>
<p><div class="LF b">||lang_str||Filtering Rules||</div></p>
<table class="LT" border="0" cellspacing="0" width="95%">
<tr class="bg1">
	<th>||lang_str||Position||</th>
	<th width="90%">||lang_str||Filter||</th>
	<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
	<th></th>
</tr>
||define||color||1||
||begin_rules||
||ifnempty||r_headers_x||
<tr class="L||color||">
	||ifequal||color||1||
		||define||color||0||
	||else||
		||define||color||1||
	||endif||
	<td nowrap>
		<a href="||action||?cmd=filter_up-||n||&utoken=||utoken||&&">||lang_str||Up||</a>
		<b>||n||</b>
		<a href="||action||?cmd=filter_down-||n||&utoken=||utoken||&&">||lang_str||Down||</a>
	</td>
	<td>
		||lang_str||If the|| '<b>||lang||r_headers_x||</b>' ||lang_str||section contains|| '<b>||r_contains||</b>'||ifequal||r_iscase||checked||<font size="-2">(||lang_str||Case Sensitive||)</font>||endif||
			||lang_str||then||
			<b>||lang||r_action_x||</b>

			||ifnequal||r_action_x||delete||
				||ifinstr||r_action_x||forward||
					||lang_str||To|| '<b>||r_addr||</b>'
				||else||
					||lang_str||To|| '<b>||lang_str||(||folder||)||</b>'
				||endif||
			||endif||
			</b>
	</td>
	<td><a href="||action||?cmd=filter_show-||n||&utoken=||utoken||">||lang_str||Edit||</a></td>
	<td>&nbsp;<a href="||action||?cmd=filter_delete-||n||&utoken=||utoken||&&">||lang_str||delete||</a></td>
</tr>
||endif||
||end_rules||
</table>

<br />
<table class="bg1" cellpadding="5">
<tr><th class="config">||lang_str||Email Filtering Rules||</th></tr>
<tr>
||ifdef||surgemail||
	||ifequal||(||check_id||9||)||true||
		<td class="c"><a class="LF" href="||action||?cmd=config&amp;force_connection=true&amp;page=config_adv&amp;utoken=||utoken||&amp;&amp;">||lang_str||Back to advanced options||</a></td>
	||else||
		<td class="c"><a class="LF" href="||action||?cmd=config&amp;force_connection=true&amp;utoken=||utoken||">||lang_str||Back to options||</a></td>
	||endif||
||else||
	<td class="c"><a class="LF" href="||action||?cmd=config&amp;force_connection=true&amp;utoken=||utoken||">||lang_str||Back to options||</a></td>
||endif||
</tr>
<tr>
	<td colspan="3" nowrap class="b">
		||lang_str||If the||
		<select name="flt_header" size="1">
<option ||ifequal||flt_header||From||selected||endif|| value="From">||lang_str||From||</option>
<option ||ifequal||flt_header||Subject||selected||endif|| value="Subject">||lang_str||Subject||</option>
<option ||ifequal||flt_header||To||selected||endif|| value="To">||lang_str||To||</option>
<option ||ifequal||flt_header||Cc||selected||endif|| value="Cc">||lang_str||Cc||</option>
<option ||ifequal||flt_header||To or Cc||selected||endif|| value="To or Cc">||lang_str||To or Cc||</option>
<option ||ifequal||flt_header||Reply-to||selected||endif|| value="Reply-to">||lang_str||Reply-to||</option>
<option ||ifequal||flt_header||Email Body||selected||endif|| value="Email Body">||lang_str||Email Body||</option>
||ifinstr||extended_filter||x-spamdetect||
	<option ||ifequal||flt_header||X-SpamDetect||selected||endif|| value="X-SpamDetect" >||lang_str||X-SpamDetect||</option>
||endif||
||ifinstr||extended_filter||x-spam-level||
	<option ||ifequal||flt_header||X-Spam-Level||selected||endif|| value="X-Spam-Level" >||lang_str||X-Spam-Level||</option>
||endif||
||ifinstr||extended_filter||x-spam-score||
	<option ||ifequal||flt_header||X-Spam-Score||selected||endif|| value="X-Spam-Score" >||lang_str||X-Spam-Score||</option>
||endif||
||ifinstr||extended_filter||x-orbs-stamp||
	<option ||ifequal||flt_header||X-ORBS-Stamp||selected||endif|| value="X-ORBS-Stamp" >||lang_str||X-ORBS-Stamp||</option>
||endif||
||ifinstr||extended_filter||sender||
	<option ||ifequal||flt_header||Sender||selected||endif|| value="Sender" >||lang_str||Sender||</option>
||endif||
||ifinstr||extended_filter||list-id||
	<option ||ifequal||flt_header||List-Id||selected||endif|| value="List-Id" >||lang_str||List-Id||</option>
||endif||
||ifinstr||extended_filter||list-post||
	<option ||ifequal||flt_header||List-Post||selected||endif|| value="List-Post" >||lang_str||List-Post||</option>
||endif||
||ifinstr||extended_filter||x-perlmx-spam||
	<option ||ifequal||flt_header||X-PerlMx-Spam||selected||endif|| value="X-PerlMx-Spam" >X-PerlMx-Spam</option>-->
||endif||
		</select>
		||lang_str||section contains||
		<input type="text" size="40" maxlength="256" name="flt_contains" value="||html_text||flt_contains||" />
		&nbsp;&nbsp;
		<input type="checkbox" name="flt_iscase" value="true" ||is_checked||flt_iscase|| />
		||lang_str||Case Sensitive||
	</td>
</tr>
<tr>
	<td>

<table border="0">
<tr nowrap>
	<td class="b">||lang_str||Then||</td>
	<td><input type="radio" name="flt_type" value="box" ||ifequal||flt_action||move||checked="checked"||else||||ifndef||flt_action||checked="checked"||endif||||endif|| />
	<td class="b">
		||lang_str||Move to folder||&nbsp;
		<select name="movefld" size="1" onfocus="document.configform.flt_type[0].checked = true">
		||begin_xfld_short||
			<option value="||encode_text||fld_name||" ||ifequal||flt_dstfld||fld_name||selected||endif||>||lang||fld_name||</option>
		||end_xfld_short||
		</select>
	</td>
</tr>
<tr nowrap>
	<td>&nbsp;</td>
	<td><input type="radio" name="flt_type" value="box" ||ifequal||flt_action||copy||checked="checked"||endif|| />
	<td class="b">
		||lang_str||Copy to folder||&nbsp;
		<select name="copyfld" size="1" onfocus="document.configform.flt_type[1].checked = true">
		||begin_xfld_short||
			<option value="||encode_text||fld_name||" ||ifequal||flt_dstfld||fld_name||selected||endif||>||lang||fld_name||</option>
		||end_xfld_short||
		</select>
	</td>
</tr>
<tr nowrap>
	<td>&nbsp;</td>
	<td><input type="radio" name="flt_type" value="forward" ||ifinstr||flt_action||forward||checked="checked"||endif|| />
	<td class="b">
		||lang_str||Forward to Email address||
		<input type="text" size="35" maxlength="256" name="flt_address" value="||html_text||flt_address||" onfocus="document.configform.flt_type[2].checked = true" />
		&nbsp;
		<input type="checkbox" name="del" value="true"||ifinstr||flt_action||forward|| ||ifinstr||flt_action||del||checked="checked"||endif||||endif|| />
		||lang_str||Delete forwarded Email||
	</td>
</tr>
<tr nowrap>
	<td>&nbsp;</td>
	<td><input type="radio" name="flt_type" value="delete" ||ifequal||flt_action||delete||checked="checked"||endif|| />
	<td class="b">
		||lang_str||Delete||
	</td>
</tr>
||ifgreater||flt_old_pos||0||
<tr>
	<td>&nbsp;</td>
	<td colspan="2">
		<input type="button" class="btn" value="||lang_str||New Filter||" onclick="document.location = '||action||?cmd=config&force_connection=true&page=config_rules&utoken=||utoken||&&';" />
		<input type="submit" class="btn" name="filter_add" value="||lang_str||Update Filter||" />

||else||
<tr>
	<td>&nbsp;</td>
	<td colspan="2">
		<input type="submit" class="btn" name="filter_add" value="||lang_str||Add Filter||" />
||endif||
		||lang_str||At Filter Position||
		<select name="flt_pos">
			||begin_for||1||40||
			||ifgreater||flt_num||for||
				<option value="||for||" ||ifequal||flt_old_pos||for||selected="selected"||endif||>||for||</option>
			||endif||
			||end_for||
			||ifdef||flt_old_pos||
				<option value="||flt_num||">||flt_num||</option>
			||else||
				<option value="||flt_num||" selected="selected">||flt_num||</option>
			||endif||
		</select>
	</td>
</tr>
</table>

	</td>
</tr>
<tr><td class="c"><a class="LF" href="||action||?cmd=help&amp;goto_page=help_change_settings&amp;goto_hash=filter&amp;utoken=||utoken||&amp;&amp;" target="Help">||lang_str||Help on Filtering Rules||</a></td>
</tr>
</table>
</center>
</form>
</body>
</html>
