From b5275bb4afd6844dc0a93630edbafcd565def012 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 16 Aug 2023 21:07:12 +1200 Subject: [PATCH] If we can write to the logfile, and syslog is off, enable logging to the logfile. --- VIRTUAL_VACATION/vacation.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/VIRTUAL_VACATION/vacation.pl b/VIRTUAL_VACATION/vacation.pl index 536fa958..cbddbe54 100644 --- a/VIRTUAL_VACATION/vacation.pl +++ b/VIRTUAL_VACATION/vacation.pl @@ -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.