||ifinstr||netscape_version||4.||
	||define||feild_width||20||
||else||
	||define||feild_width||35||
||endif||
<html>
<head>
	<link rel="StyleSheet" href="||nwimg||/skin.css" type="text/css">
||include||css_blue.tpl||
</head>

<body>

||begin_rules||
||ifnempty||r_headers_x||
	||define||flt_num||n||
||endif||
||end_rules||
||define||flt_num||(||add||flt_num||1||)||

<form name="config_rules" 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="" />
	<center>
	<p>&nbsp;</p>
<table width="100%" cellspacing="2">
<tr>
	<td align="center">

	<table border="1" cellpadding="0" cellspacing="0"  bgcolor="#FFFFFF" width="100%">
	<tr>
		<td bgcolor="||color_menu||" colspan="2">
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
			<tr>	
				<th width="100%">||lang_str||Email Filtering Rules||</th>
				<td align="right"><a href="||action||?cmd=help&amp;goto_page=help_change_settings&amp;goto_hash=filter&amp;utoken=||utoken||&amp;&amp;" target="Help"><img border="0" alt="Help on Filtering Rules" src="||nwimg||/main_help.gif" /></a></td>
			</tr>
			</table>
		</td>
	</tr>
	<tr><td>
		<table cellpadding="5" cellspacing="0" width="100%">		
		<tr>
			<td colspan="3" nowrap="nowrap" class="bold">
				||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="20" maxlength="190" name="flt_contains" value="||html_text||flt_contains||" />
				&nbsp;&nbsp;
				<input class="clear" type="checkbox" name="flt_iscase" value="true" ||is_checked||flt_iscase|| />
				||lang_str||Case Sensitive||
			</td>
		</tr>
		<tr>
			<td>
				<table border="0">
				<tr nowrap="nowrap">
					<td class="bold">||lang_str||Then||</td>
					<td><input class="clear" type="radio" name="flt_type" value="box" ||ifequal||flt_action||move||checked="checked"||else||||ifndef||flt_action||checked="checked"||endif||||endif|| />
					<td class="bold">
						||lang_str||Move to folder||&nbsp;
						<select name="movefld" size="1" onfocus="document.config_rules.flt_type[0].checked = true">
						||begin_xfld_short||
							<option value="||fld_name||" ||ifequal||flt_dstfld||fld_name||selected||endif||>||lang||fld_name||</option>
						||end_xfld_short||
						</select>
					</td>
				</tr>
				<tr nowrap="nowrap">
					<td>&nbsp;</td>
					<td><input class="clear" type="radio" name="flt_type" value="box" ||ifequal||flt_action||copy||checked="checked"||endif|| />
					<td class="bold">
						||lang_str||Copy to folder||&nbsp;
						<select name="copyfld" size="1" onfocus="document.config_rules.flt_type[1].checked = true">
						||begin_xfld_short||
							<option value="||fld_name||" ||ifequal||flt_dstfld||fld_name||selected||endif||>||lang||fld_name||</option>
						||end_xfld_short||
						</select>
					</td>
				</tr>
				<tr nowrap="nowrap">
					<td>&nbsp;</td>
					<td><input class="clear" type="radio" name="flt_type" value="forward" ||ifinstr||flt_action||forward||checked="checked"||endif|| />
					<td class="bold">
						||lang_str||Forward to Email address||
						<input type="text" size="||feild_width||" maxlength="190" name="flt_address" value="||html_text||flt_address||" onfocus="document.config_rules.flt_type[2].checked = true" />
						&nbsp;
						<input class="clear" 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="nowrap">
					<td>&nbsp;</td>
					<td><input class="clear" type="radio" name="flt_type" value="delete" ||ifequal||flt_action||delete||checked="checked"||endif|| />
					<td class="bold">
						||lang_str||Delete||
					</td>
				</tr>
				||ifgreater||flt_old_pos||0||
				<tr>
					<td>&nbsp;</td>
					<td colspan="2">
						<input type="button" value="||lang_str||New Filter||" onclick="document.location = '||action||?cmd=config&force_connection=true&page=config_rules&utoken=||utoken||&&';" />
						<input type="submit" name="filter_add" value="Update Filter" />

				||else||
				<tr>
					<td>&nbsp;</td>
					<td colspan="2">
						<input type="submit" 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>
				<table border="0" width="100%" cellspacing="1" cellpadding="1">
				<tr bgcolor="#D6D6CE">
					<th>||lang_str||Position||</th>
					<th width="100%">||lang_str||Filter||</th>
					<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
				</tr>

				||begin_rules||
				||ifnempty||r_headers_x||
				<tr>
					<td ||ifequal||flt_old_pos||n||bgcolor="#FFC0C0"||endif|| align="center" class="bold">
						<a href="||action||?cmd=filter_up-||n||&utoken=||utoken||&&"><img border="0" src="||nwimg||/config_up.gif" alt="Move this filter up one position in the list" /></a>
						||n||
						<a href="||action||?cmd=filter_down-||n||&utoken=||utoken||&&"><img border="0" src="||nwimg||/config_down.gif" alt="Move this filter down one position in the list" /></a>
					</td>
					<td ||ifequal||flt_old_pos||n||bgcolor="#FFC0C0"||endif|| ><a href="||action||?cmd=filter_show-||n||&utoken=||utoken||">

						||lang_str||If the|| '<b>||lang_str||(||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_str||(||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>
						</a>
					</td>
					<td ||ifequal||flt_old_pos||n||bgcolor="#FFC0C0"||endif|| ><a href="||action||?cmd=filter_delete-||n||&utoken=||utoken||&&">||lang_str||Delete||</a></td>
				</tr>
				||endif||
				||end_rules||
				</table>

			</td>
		</tr>
		</table>
	</td></tr>
	</table>
	</td>
</tr>
</table>
</center>
</form>
</body>
</html>

||include||message_popup.tpl||

<script type="text/javascript">
<!--

function HiddenFields(){
	if (document.config_rules.flt_type[0].checked == true) {
		document.config_rules.flt_dstfld.value = document.config_rules.movefld.value;
		document.config_rules.flt_box.value = 'Move';
	}
	else if (document.config_rules.flt_type[1].checked == true) {
		document.config_rules.flt_dstfld.value = document.config_rules.copyfld.value;
		document.config_rules.flt_box.value = 'Copy';
	}
	else if (document.config_rules.flt_type[2].checked == true) {
		if (document.config_rules.del.checked == true)
			document.config_rules.flt_forward.value = 'Forward (Del)';
		else
			document.config_rules.flt_forward.value = 'Forward';
	}
}
//-->
</script>
