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

This commit is contained in:
Andrew Ruthven authored and Andrew Ruthven committed 2023-08-16 21:07:12 +12:00
1 parent e0438a703b
commit b5275bb4af
1 file changed
+9
+9
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.