<html>
||include||meta.tpl||
<head>
<!-- Save CMD -->
||ifdef||fpostcmd||
	||post_cmd||(||user_cgi_http_prefix||/cgi/user.cgi?cmd=auto_login&||fpostcmd||&show=na_msg.xml&vhost=||vhost||)||
||endif||
||ifdef||spostcmd||
	||post_cmd||(||user_cgi_http_prefix||/cgi/user.cgi?cmd=auto_login&||spostcmd||&show=na_msg.xml&vhost=||vhost||)||
||endif||
||ifdef||spfpostcmd||
	||post_cmd||(||user_cgi_http_prefix||/cgi/user.cgi?cmd=auto_login&||spfpostcmd||&show=na_msg.xml&vhost=||vhost||)||
||endif||


||ifinstr||surgemail_disallow||friends||
||else||
<!-- Get Friends settings -->
	||define||xcmd||lcmd=user_load_fcommon&show=na_friends.xml||
	||post_cmd||(||user_cgi_http_prefix||/cgi/user.cgi?cmd=auto_login&||xcmd||&vhost=||vhost||)||
||endif||

||ifinstr||surgemail_disallow||spam||
||else||
<!-- Get Spam settings -->
	||define||xcmd||lcmd=user_spam_load&show=na_spam.xml||
	||post_cmd||(||user_cgi_http_prefix||/cgi/user.cgi?cmd=auto_login&||xcmd||&vhost=||vhost||)||
	||undef||spam_enable||
	||ifgreater||spam_store||0||
		||define||spam_enable||true||
	||else||
		||ifequal||spam_store||-1||
			||define||spam_enable||true||
		||endif||
	||endif||
	||ifgreater||spam_bounce||0||
		||define||spam_enable||true||
	||else||
		||ifequal||spam_bounce||-1||
			||define||spam_enable||true||
		||endif||
	||endif||
	||ifgreater||spam_vanish||0||
		||define||spam_enable||true||
	||else||
		||ifequal||spam_vanish||-1||
			||define||spam_enable||true||
		||endif||
	||endif||
||endif||

||ifinstr||surgemail_disallow||spf||
||else||
<!-- Get SPF settings -->
	||define||xcmd||lcmd=user_load_spf&show=na_spf.xml||
	||post_cmd||(||user_cgi_http_prefix||/cgi/user.cgi?cmd=auto_login&||xcmd||&vhost=||vhost||)||

	||undef||spf_enable||
	||ifequal||spf_status||true||
		||define||spf_enable||true||
	||endif||
||endif||


<link rel="stylesheet" type="text/css" href="||nwimg||||tpl_color||/surge.css" />
<title>||cust_title|| - ||lang_str||Spam Control||</title>
<script type="text/javascript">
<!--
function save(){
||ifinstr||surgemail_disallow||friends||
||else||
	||ifequal||friend_mode||disabled||
		if (document.configform.friends[0].checked) {
			document.configform.fpostcmd.value = "lcmd=user_friend_save&friend_mode=smite&friend_smite=1&recent_out_auto=on";
		}
	||else||
		if (document.configform.friends[1].checked) {
			document.configform.fpostcmd.value = "lcmd=user_friend_save&friend_mode=disabled&recent_out_auto=on";
		}
	||endif||
||endif||
||ifinstr||surgemail_disallow||spam||
||else||
	||ifequal||spam_enable||true||
		if (document.configform.spam[1].checked) {
			document.configform.spostcmd.value = "lcmd=user_spam_save&spam_store=0&spam_bounce=0&spam_vanish=0";
		}
	||else||
		if (document.configform.spam[0].checked) {
			document.configform.spostcmd.value = "lcmd=user_spam_save&spam_store=5&spam_bounce=0&spam_vanish=0";
		}
	||endif||
||endif||

||ifinstr||surgemail_disallow||spf||
||else||
	||ifequal||spf_enable||true||
		if (document.configform.spf[1].checked) {
			document.configform.spfpostcmd.value = "lcmd=user_save_spf&spf_block=false";
		}
	||else||
		if (document.configform.spf[0].checked) {
			document.configform.spfpostcmd.value = "lcmd=user_save_spf&spf_block=true";
		}
	||endif||
||endif||

	document.configform.submit();
}
//-->
</script>
<script type="text/javascript" src="||common_files||/util.js"></script>
<script type="text/javascript" src="||nwimg||/layout.js"></script>
</head>
<body class="body" onload="doresize();" onresize="doresize()">

||include||_layout_start.tpl||

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

<form name="configform" method="post" action="||action||">
<input type="hidden" name="cmd" value="config" />
<input type="hidden" name="page" value="config_surge" />
<input type="hidden" name="utoken" value="||utoken||" />
<input type="hidden" name="fpostcmd" value="" />
<input type="hidden" name="spostcmd" value="" />
<input type="hidden" name="spfpostcmd" value="" />
<input type="hidden" name="force_connection" value="true" />
<center>
<p><div class="LF b">||lang_str||Spam Control||</div></p>

||undef||using_https||
||ifnempty||user_cgi_http_prefix||
	||ifinstr||user_cgi_http_prefix||https:||
		||define||using_https||true||
	||endif||
||else||
	||ifinstr||http_action||https:||
		||define||using_https||true||
	||endif||
||endif||
||ifdef||using_https||
<table cellpadding="5" class="bg1">
<tr>	<td class="LF">
		The command: <b>'<a href="||post_cmd_sent||">||lchop||post_cmd_sent||40||</a>'</b><br>
		is attempting to talk to an HTTPS server, which does not work you need to setup the
		webmai.ini setting:<br>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
||define||xshow||imaphost||
||ifempty||xshow||||define||xshow||pophost||||endif||
||ifempty||xshow||||define||xshow||mail.server.com||||endif||
		<b>user_cgi_http_prefix http://||xshow||:7080</b><br>

		To correctly point to surgemail's http user.cgi location.

		<br>&nbsp;<br>
		Due to this error, the details below could be incorrect.
	</td>
</tr>
</table>
<br>
||endif||

||ifdef||post_cmd_failed|| ||include||_post_failed.tpl|| ||endif||

<table cellpadding="5" class="bg1" width="500">
<tr>
	<td colspan="4" class="c"><a class="LF" href="||action||?cmd=config&amp;force_connection=true&amp;utoken=||utoken||&amp;&amp;">||lang_str||Back to options||</a></td>
</tr>
||ifinstr||surgemail_disallow||friends||
||else||
<tr>
	<td nowrap class="LF"><b>||lang_str||Friends||:</b></td>
	<td class="LF" nowrap>
		<input type="radio" name="friends" value="on" ||ifnequal||friend_mode||disabled||checked="checked"||endif||/> ||lang_str||On||
		<input type="radio" name="friends" value="off" ||ifequal||friend_mode||disabled||checked="checked"||endif||/> ||lang_str||Off||
	</td>
	||ifequal||(||check_id||11||)||true||
		<td nowrap><a class="LF b" href="javascript:S(11)">||lang_str||Pending Emails||</a></td>
	||endif||

	||ifequal||(||check_id||1||)||true||
		<td nowrap><a class="LF b" href="javascript:S(1)">||lang_str||Advanced||</a></td>
	||endif||
</tr>
<tr><td colspan="4" class="c">
	||lang_str||If Friends is turned on, a request for confirmation is sent back to any unknown sender and the message will be stored in your 'pending' folder. The message is put in your Inbox when the sender confirms.||
</td></tr>
<tr><td>&nbsp;</td></tr>
||endif||
||ifinstr||surgemail_disallow||spam||
||else||
<tr>
	<td nowrap class="LF"><b>||lang_str||Spam Filtering||:</b></td>
	<td class="LF" nowrap>
		<input type="radio" name="spam" value="on" ||ifdef||spam_enable||checked="checked"||endif||/> ||lang_str||On||
		<input type="radio" name="spam" value="off" ||ifndef||spam_enable||checked="checked"||endif||/> ||lang_str||Off||
	</td>

	||ifequal||(||check_id||10||)||true||
		<td nowrap><a class="LF b" href="javascript:S(10)">||lang_str||Held Emails||</a></td>
	||endif||

	||ifequal||(||check_id||4||)||true||
		<td nowrap><a class="LF b" href="javascript:S(4)">||lang_str||Advanced||</a></td>
	||endif||
</tr>
<tr><td colspan="4" class="c">
	||lang_str||If Spam Filtering is turned on, a message that has been flagged as spam will be put into your 'held' folder for 2 weeks, and then be deleted automatically.||
</td></tr>
<tr><td>&nbsp;</td></tr>
||endif||

||ifinstr||surgemail_disallow||spf||
||else||
<tr>
	<td nowrap class="LF"><b>||lang_str||SPF||:</b></td>
	<td class="LF" nowrap>
		<input type="radio" name="spf" value="on" ||ifdef||spf_enable||checked="checked"||endif||/> ||lang_str||On||
		<input type="radio" name="spf" value="off" ||ifndef||spf_enable||checked="checked"||endif||/> ||lang_str||Off||
	</td>

	||ifequal||(||check_id||12||)||true||
		<td nowrap><a class="LF b" href="javascript:S(12)">||lang_str||Advanced||</a></td>
	||endif||
</tr>
<tr><td colspan="4" class="c">
	||lang_str||SPF|| (||lang_str||Sender Permitted From||) ||lang_str||determines whether the connecting machine is allowed to send email for the domain in the 'from' address||.
</td></tr>
||endif||


||ifdef||surgemail||
	||ifequal||(||check_id||9||)||true||
<tr>
	<td colspan="3"><a class="LF b" href="javascript:S(9)">||lang_str||Filters and Exceptions||</a><br />
	||lang_str||Use exceptions and filtering rules to organise your incoming mail||.</td>
</tr>
	||else||
<tr>
	<td colspan="3"><a class="LF b" href="||action||?cmd=config&amp;force_connection=true&amp;page=config_rules&amp;utoken=||utoken||">||lang_str||Filtering Rules||</a><br />
	||lang_str||Setup filters to help you organise your email into folders||.</td>
</tr>
	||endif||
||else||
<tr>
	<td colspan="3"><a class="LF b" href="||action||?cmd=config&amp;force_connection=true&amp;page=config_rules&amp;utoken=||utoken||">||lang_str||Filtering Rules||</a><br />
	||lang_str||Setup filters to help you organise your email into folders||.</td>
</tr>
||endif||


<tr>
	<td colspan="4" class="c"><input type="button" class="btn" onclick="save()" value="||lang_str||Save Settings||" /></td>
</tr>
</table>
<br>&nbsp;<br>
</center>
</form>
</body>
</html>
