function SaveISPAddress() { $tpl = new templates(); $domain = new DomainsTools(); $page = CurrentPageName(); $address = $domain->transport_maps_implode($_GET["isp_address"], $_GET["isp_port"]); $sasl = new smtp_sasl_password_maps(); writepostfixlogs("Set ISP server has {$address}", __FUNCTION__, __FILE__); $sock = new sockets(); $sock->SET_INFO("PostfixRelayHost", "{$address}"); writepostfixlogs("is this server {$address} must use authentication ?", __FUNCTION__, __FILE__); if (trim($_GET["isp_username"]) == null) { $sasl->delete($address); exit; } if (trim($_GET["isp_password"]) == null) { die("password NULL !"); } writepostfixlogs("Enable SMTP Sasl", __FUNCTION__, __FILE__); $main = new main_cf(); $main->smtp_sasl_password_maps_enable(); if (!$sasl->add($address, trim($_GET["isp_username"]), trim($_GET["isp_password"]))) { die($sasl->ldap_infos); } }
function relayhostSave(){ if($_GET["relay_port"]==null){$_GET["relay_port"]=25;} $tpl=new templates(); if($_GET["relay_address"]==null){ echo $tpl->_ENGINE_parse_body("{error_no_server_specified}"); exit; } $tool=new DomainsTools(); writepostfixlogs("Port={$_GET["relay_port"]} address={$_GET["relay_address"]}",__FUNCTION__,__FILE__); $data=$tool->transport_maps_implode($_GET["relay_address"],$_GET["relay_port"],'smtp',$_GET["MX_lookups"]); writepostfixlogs("Port={$_GET["relay_port"]} address={$_GET["relay_address"]}=$data",__FUNCTION__,__FILE__); $data=str_replace('smtp:','',$data); $main=new main_cf(); $main->main_array["relayhost"]=$data; $sock=new sockets(); $sock->SET_INFO("PostfixRelayHost",$data); $main->save_conf(); if($_GET["relay_username"]<>null){ $sals=new smtp_sasl_password_maps(); $sals->add($data,$_GET["relay_username"],$_GET["relay_password"]); } $sock->getFrameWork("cmd.php?postfix-relayhost=yes"); }
function relayhostSave() { if ($_GET["relay_port"] == null) { $_GET["relay_port"] = 25; } $tpl = new templates(); if ($_GET["relay_address"] == null) { echo $tpl->_ENGINE_parse_body("{error_no_server_specified}"); exit; } $tool = new DomainsTools(); writepostfixlogs("Port={$_GET["relay_port"]} address={$_GET["relay_address"]}", __FUNCTION__, __FILE__); $data = $tool->transport_maps_implode($_GET["relay_address"], $_GET["relay_port"], 'smtp', $_GET["MX_lookups"]); writepostfixlogs("Port={$_GET["relay_port"]} address={$_GET["relay_address"]}={$data}", __FUNCTION__, __FILE__); $data = str_replace('smtp:', '', $data); $main = new main_cf(); $main->main_array["relayhost"] = $data; $main->save_conf(); }