0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

If we can write to the logfile, and syslog is off, enable logging to the logfile.

This commit is contained in:
Andrew Ruthven 2023-08-16 21:07:12 +12:00 committed by Andrew Ruthven
parent e0438a703b
commit b5275bb4af

View File

@ -163,6 +163,15 @@ if (-f '/etc/mail/postfixadmin/vacation.conf') {
# =========== end configuration ===========
# Try and enable log_to_file if syslog is disabled
if ($syslog == 0 && $log_to_file == 0 && (
(-f $logfile && -w $logfile)
||
(! -f $logfile && -w dirname($logfile)))
) {
$log_to_file=1;
}
if($log_to_file == 1) {
if (( ! -w $logfile ) && (! -w dirname($logfile))) {
# Cannot log; no where to write to.