function compile_amavis() { $amavis = new amavis(); $amavis->Save(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body('<hr>{save_config_to_server}<hr> ', "amavis.index.php"); }
function max_servers_save() { $amavis = new amavis(); $amavis->main_array["BEHAVIORS"]["max_servers"] = $_GET["max_servers"]; $amavis->main_array["BEHAVIORS"]["child_timeout"] = "{$_GET["child_timeout"]}*60"; $amavis->Save(); $sock = new sockets(); $sock->getFrameWork("cmd.php?postfix-ssl=yes"); }
function CheckAmavisLocalInterface() { $sock = new sockets(); $a = $sock->GET_INFO("EnableAmavisInMasterCF"); $EnableAmavisInMasterCF = intval(trim($a)); if ($EnableAmavisInMasterCF == 0) { events("CheckAmavisLocalInterface():: EnableAmavisInMasterCF not enabled = \"{$a}\""); return; } $datas = @file_get_contents("/usr/local/etc/amavisd.conf"); $tbl = explode("\n", $datas); events("CheckAmavisLocalInterface():: " . count($tbl) . " lines"); while (list($num, $ligne) = each($tbl)) { if (trim($ligne) == null) { continue; } if (preg_match("#inet_acl.+?qw#", $ligne)) { events("CheckAmavisLocalInterface():: inet_acl parameters ok"); return true; } } events("rebuild amavis"); $amavis = new amavis(); $amavis->Save(); $amavis->SaveToServer(); }
function main_postmaster(){ $user=new usersMenus(); $servername=$user->hostname; if(isset($_GET["postmaster_mail"])){ if($_GET["postmaster_mail"]==null){ echo main_result(true,'No mailbox set','{postmaster}'); exit; } include_once('ressources/class.user.inc'); $mail=$_GET["postmaster_mail"]; $ldap=new clladp(); $uid=$ldap->uid_from_email($mail); writelogs("$mail has uid $uid",__FUNCTION__,__FILE__); $users=new user($uid); $users->mail=$mail; if(!$users->add_user()){ echo main_result(true,$users->ldap_error,'{postmaster}'); exit; } if(!$users->alias_add("postmaster@$servername")){ echo main_result(true,"postmaster@$servername:$users->ldap_error",'{postmaster}'); exit; } if(!$users->alias_add("root@$servername")){ echo main_result(true,"root@$servername:$users->ldap_error",'{postmaster}'); exit; } include_once("ressources/class.main_cf.inc"); $main=new main_cf(); $main->main_array["double_bounce_sender"]=$mail; $main->main_array["address_verify_sender"]=$mail; $main->main_array["2bounce_notice_recipient"]=$mail; $main->main_array["error_notice_recipient"]=$mail; $main->main_array["delay_notice_recipient"]=$mail; $main->main_array["empty_address_recipient"]=$mail; $main->save_conf(); $main->save_conf_to_server(); $amavis=new amavis(); $amavis->main_array["BEHAVIORS"]["virus_admin"]=$mail; $amavis->main_array["BEHAVIORS"]["mailfrom_notify_admin"]=$mail; $amavis->main_array["BEHAVIORS"]["mailfrom_notify_recip"]=$mail; $amavis->main_array["BEHAVIORS"]["mailfrom_notify_spamadmin"]=$mail; $amavis->Save(); $amavis->SaveToServer(); echo main_result(false,"<br>root@$servername<br>postmaster@$servername<br>{success}",'{postmaster}'); return null; } $postmasters="postmaster@$servername,root@$servername"; $html=" <strong>{postmaster}</strong> <p class=caption>{postmaster_explain} $postmasters</p> <table style='width:100%'> <tr> <td align='right' nowrap valign='top'><strong>{local_mail}:</strong></td> <td valign='top'>" . Field_text('postmaster_mail',$_GET["postmaster_mail"],'width:100%')."</td> </tr> <tr><td colspan=2 align='right'><input type='button' OnClick=\"javascript:postmaster1();\" value='{build} »'></td></tr> </tr> </table>"; $tpl=new templates(); echo $tpl->_ENGINE_parse_body($html); }
function SAVE_QUAR() { if (isset($_GET["SAVE_KAS"])) { $kas = new kas_mysql("default"); if ($_GET["ACTION_SPAM_MODE"] == 1) { $kas->SET_VALUE("ACTION_SPAM_MODE", 2); } else { $kas->SET_VALUE("ACTION_SPAM_MODE", -1); } if ($_GET["ACTION_FORMAL_MODE"] == 1) { $kas->SET_VALUE("ACTION_FORMAL_MODE", 2); } else { $kas->SET_VALUE("ACTION_FORMAL_MODE", 0); } if ($_GET["ACTION_PROBABLE_MODE"] == 1) { $kas->SET_VALUE("ACTION_PROBABLE_MODE", 2); } else { $kas->SET_VALUE("ACTION_SPAM_MODE", 0); $kas->SET_VALUE("ACTION_SPAM_SUBJECT_PREFIX", "[SPAM]"); } $sock = new sockets(); $sock->getFrameWork("cmd.php?kas-reconfigure=yes"); } if (isset($_GET["SAVE_AMAVIS"])) { $amavis = new amavis(); $amavis->main_array["BEHAVIORS"]["spam_quarantine_spammy"] = $_GET["EnableQuarantineSpammy"]; $amavis->main_array["BEHAVIORS"]["spam_quarantine_spammy2"] = $_GET["EnableQuarantineSpammy2"]; $amavis->Save(); } }
function SaveSettings() { echo "<div><code>"; $ldap = new clladp(); $usersMenus = new usersMenus(); $ldap->AddOrganization($_COOKIE["company"]); echo "</div></code>"; echo "<div><code>"; if (!$usersMenus->cyrus_imapd_installed) { $ldap->AddRelayDomain($_COOKIE["company"], $_COOKIE["smtp_domain"], $_COOKIE["smtp_relay"], 25); } else { $ldap->AddDomainEntity($_COOKIE["company"], $_COOKIE["smtp_domain"]); } echo "</div></code>"; echo "<div><code>"; $users = new user($_COOKIE["username"]); $users->mail = "{$_COOKIE["username"]}@{$_COOKIE["smtp_domain"]}"; $users->password = $_COOKIE["password"]; $users->ou = $_COOKIE["company"]; $users->add_user(); $users->add_alias("root"); $users->add_alias("mailflt3"); $users->add_alias("*****@*****.**"); $users->add_alias("root@{$usersMenus->fqdn}"); $users->add_alias("postmaster@{$usersMenus->fqdn}"); $users->add_alias("*****@*****.**"); $users->add_alias("postmaster"); echo "</div></code>"; $sock = new sockets(); $sock->SET_INFO("PostmasterAdress", $users->mail); $sock->SET_INFO("MasterSMTPDomainName", $_COOKIE["smtp_domain"]); $sock->SET_INFO("SmtpWizardFinish", 1); if ($usersMenus->AMAVIS_INSTALLED) { echo "<div><code>"; include_once "ressources/class.amavis.inc"; $amavis = new amavis(); $amavis->Save(); $sock->SET_INFO("EnableAmavisDaemon", "1"); $sock->getFrameWork("cmd.php?artica-filter-reload=yes"); $amavis->SaveToServer(); echo "</div></code>"; } if ($usersMenus->BIND9_INSTALLED) { include_once "ressources/class.bind9.inc"; include_once "ressources/class.system.network.inc"; $net = new networking(); if (is_array($net->arrayNameServers)) { $dns = implode("\n", $net->arrayNameServers); $sock->SaveConfigFile($dns, "PostfixBind9DNSList"); $sock->SET_INFO('PostfixEnabledInBind9', 1); } } echo "<div><code>"; $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); echo "</div></code>"; }
<?php if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");} include_once(dirname(__FILE__).'/ressources/class.templates.inc'); include_once(dirname(__FILE__).'/ressources/class.ini.inc'); include_once(dirname(__FILE__).'/ressources/class.main_cf.inc'); include_once(dirname(__FILE__).'/ressources/class.amavis.inc'); include_once(dirname(__FILE__).'/ressources/class.samba.inc'); include_once(dirname(__FILE__).'/ressources/class.squid.inc'); $main=new main_cf(); $main->save_conf(); $main->save_conf_to_server(1); $amavis=new amavis(); $amavis->Save(); $amavis->SaveToServer(); $samba=new samba(); $samba->SaveToLdap(); $squid=new squidbee(); $squid->SaveToLdap(); $squid->SaveToServer(); system('/etc/init.d/artica-postfix restart postfix'); system('/etc/init.d/artica-postfix restart squid'); system('/etc/init.d/artica-postfix restart samba'); system('/usr/share/artica-postfix/bin/artica-install --cyrus-checkconfig'); system('/etc/init.d/artica-postfix restart imap'); system('/etc/init.d/artica-postfix restart saslauthd');
function ApplyConfigPostfix() { $users = new usersMenus(); $users->LoadModulesEnabled(); $tpl = new templates(); if ($users->AsPostfixAdministrator == true) { //Apply amavis settings if installed if ($users->AMAVIS_INSTALLED == 1) { if ($users->EnableAmavisDaemon == 1) { include_once "ressources/class.amavis.inc"; $amavis = new amavis(); $amavis->Save(); $amavis->SaveToServer(); } } //------------------------------------ $main = new main_cf(); $main->save_conf(); if (!$main->save_conf_to_server()) { $result = InfosError('postfix_main_settings', '{error}'); echo $tpl->_ENGINE_parse_body($result); return null; } $filters = new main_header_check(); $filters->SaveToDaemon(); if ($users->KAV_MILTER_INSTALLED) { if ($users->KAVMILTER_ENABLED == 1) { include_once "ressources/class.kavmilterd.inc"; $kavmilterd = new kavmilterd(); $kavmilterd->ReBuildAllRules(); $kavmilterd->SaveToLdap(0, 1); $tpl = new templates(); echo $tpl->_ENGINE_parse_body(Success("aveserver_main_settings")); } } if ($users->AMAVIS_INSTALLED) { if ($users->EnableAmavisDaemon == 1) { include_once "ressources/class.amavis.inc"; $amavis = new amavis(); $amavis->Save(); } } if ($users->kas_installed) { if ($users->KasxFilterEnabled == 1) { include_once "ressources/class.kas-filter.inc"; $kas = new kas_single(); $kas->Save(); } } $result = Success("postfix_main_settings"); } else { $result = NotAllowed("postfix_main_settings"); } echo $tpl->_ENGINE_parse_body($result); }
function INI_SAVE() { $amavis = new amavis(); while (list($num, $ligne) = each($_GET)) { $amavis->main_array[$_GET["INI_SAVE"]][$num] = $ligne; } $amavis->EnableBlockUsersTroughInternet = $_GET["EnableBlockUsersTroughInternet"]; $amavis->Save(); }
function log_level_save() { $amavis = new amavis(); $sock = new sockets(); $sock->SET_INFO("AmavisDebugSpamassassin", $_POST["AmavisDebugSpamassassin"]); $amavis->main_array["BEHAVIORS"]["log_level"] = $_POST["log_level"]; $tpl = new templates(); echo $tpl->_ENGINE_parse_body('{log_level} -> ' . $_POST["log_level"] . "\n"); $amavis->Save(); }
function INI_SAVE() { $amavis = new amavis(); while (list($num, $ligne) = each($_GET)) { writelogs("Saving [{$num}]=[{$ligne}]", __FUNCTION__, __FILE__, __LINE__); $amavis->main_array[$_GET["INI_SAVE"]][$num] = $ligne; } $amavis->EnableBlockUsersTroughInternet = $_GET["EnableBlockUsersTroughInternet"]; $amavis->Save(); }
function parameters_save() { $AmavisMemoryInRAM = $_POST["AmavisMemoryInRAM"]; if ($AmavisMemoryInRAM > 0) { if ($AmavisMemoryInRAM < 128) { $AmavisMemoryInRAM = 128; } } $sock = new sockets(); $sock->SET_INFO('AmavisMemoryInRAM', $AmavisMemoryInRAM); $sock->SET_INFO('AmavisDebugSpamassassin', $AmavisDebugSpamassassin); $amavis = new amavis(); $amavis->main_array["BEHAVIORS"]["max_servers"] = $_POST["max_servers"]; $amavis->main_array["BEHAVIORS"]["max_requests"] = $_POST["max_requests"]; $amavis->main_array["BEHAVIORS"]["child_timeout"] = $_POST["child_timeout"]; $amavis->main_array["BEHAVIORS"]["final_virus_destiny"] = $_POST["final_virus_destiny"]; $amavis->main_array["BEHAVIORS"]["final_banned_destiny"] = $_POST["final_banned_destiny"]; $amavis->main_array["BEHAVIORS"]["final_spam_destiny"] = $_POST["final_spam_destiny"]; $amavis->main_array["BEHAVIORS"]["always_clean"] = $_POST["always_clean"]; $amavis->main_array["BEHAVIORS"]["trust_my_net"] = $_POST["trust_my_net"]; $amavis->main_array["BEHAVIORS"]["enable_db"] = $_POST["enable_db"]; $amavis->main_array["BEHAVIORS"]["enable_global_cache"] = $_POST["enable_global_cache"]; $amavis->main_array["BEHAVIORS"]["log_level"] = $_POST["log_level"]; $amavis->Save(); $tpl = new templates(); echo $tpl->javascript_parse_text("{ERROR_NEED_TO_SAVEAPPLY}"); }