diff options
Diffstat (limited to 'config/postfix')
-rw-r--r-- | config/postfix/postfix.inc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/config/postfix/postfix.inc b/config/postfix/postfix.inc index 182f9d00..831e6bb2 100644 --- a/config/postfix/postfix.inc +++ b/config/postfix/postfix.inc @@ -295,22 +295,22 @@ function sync_package_postfix() { } #update /etc/inc/system.inc $sys_log_file='/etc/inc/system.inc'; + $pfsense_version=preg_replace("/\s/","",file_get_contents("/etc/version")); $sys_log = file($sys_log_file); $new_sys_log=""; $found_mail=0; foreach ($sys_log as $line){ $new_line=preg_replace('/mail.(.|crit);/',$mail_syslog,$line); - #set syslog entry mail.* %/var/log/maillog when log_to = system - if (preg_match ('/mail.(.|crit);/',$line) && $postfix_config['log_to'] =="maillog") + if (preg_match('/mail.*system.log/',$line) && $postfix_config['log_to'] =="maillog"){ $new_sys_log .= 'mail.*'."\t\t\t\t\t\t".'/var/log/maillog'."\n"; - #remove syslog entry mail.* %/var/log/maillog when log_to != system - if (preg_match ("/^mail/",$line)) - $new_sys_log .=""; - else - $new_sys_log .= $new_line; + } + if (preg_match('/maillog/',$line)){ + $new_line =""; + } + $new_sys_log .= $new_line; } - if (!file_exists('/root/system.inc.backup')) { - copy ($sys_log_file,'/root/system.inc.backup'); + if (!file_exists('/root/'.$pfsense_version.'.system.inc.backup')) { + copy ($sys_log_file,'/root/'.$pfsense_version.'.system.inc.backup'); } file_put_contents($sys_log_file,$new_sys_log, LOCK_EX); #mwexec('/usr/local/bin/php -q /usr/local/www/postfix_syslog.php'); |