function TreePostfixBuildConfiguration() { $mny = new usersMenus(); $tpl = new templates(); if ($mny->AsPostfixAdministrator == false) { echo $tpl->_ENGINE_parse_body('{no_privileges'); exit; } $main = new main_cf(); $main->save_conf_to_server(); include_once "ressources/class.main_cf_filtering.inc"; $filters = new main_header_check(); $filters->SaveToDaemon(); echo "OK"; }
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 delete_mail_subject_rule() { $main = new main_header_check(); $main->delete_subject($_GET["delete_mail_subject_rule"]); echo tableau_subject(); }
function macros_quick_deny_domains() { $pattern = $_GET["quick_deny_domains"]; $table_pattern = explode(',', $pattern); $main = new main_header_check(); $tpl = new templates(); writelogs("Domain to block:" . count($table_pattern), __FUNCTION__, __FILE__); for ($i = 0; $i < count($table_pattern); $i++) { $new_pattern = $table_pattern[$i]; $new_pattern = $main->TransformToregex($new_pattern); $new_pattern = "/^From:.*\\@{$new_pattern}/\tREJECT\tBANNED DOMAIN"; if ($main->saverule($new_pattern, null)) { writelogs("Domain to block: {$table_pattern[$i]} success", __FUNCTION__, __FILE__); echo $tpl->_ENGINE_parse_body("{success}:{rule} \"ban '{$table_pattern[$i]}'\"\n{goto_globalsmtprules}"); $sock = new sockets(); $sock->getFrameWork("cmd.php?headers-check-postfix=yes"); } else { writelogs("Domain to block: {$table_pattern[$i]} failed", __FUNCTION__, __FILE__); } } }
function compile_header_check() { $tpl = new templates(); $filters = new main_header_check(); $filters->SaveToDaemon(); echo $tpl->_ENGINE_parse_body("<strong>{POSTFIX_FILTERS}:</strong> {apply config} {success}"); }