diff --git a/VIRTUAL_VACATION/Contributions.txt b/VIRTUAL_VACATION/Contributions.txt index c28990b2..d8f5f076 100644 --- a/VIRTUAL_VACATION/Contributions.txt +++ b/VIRTUAL_VACATION/Contributions.txt @@ -97,3 +97,9 @@ Additional authors: Add configuration parameter $account_check and $account_name if account_check is set it will add the value of name of the mailbox in front of the email and it is shown as sender, if no name is specified at the mailbox, the variable friendly-name is placed in front of the email and it is shown as sender otherwise the email will show as sender. + +2023-08-18 Andrew Ruthven + Minor improvements to the use of Log4Perl + + Fix handling of the default $smtp_client setthing of 'localhost' + if we aren't connecting to the SMTP server on localhost. diff --git a/VIRTUAL_VACATION/vacation.pl b/VIRTUAL_VACATION/vacation.pl index 578205eb..aaa4dd08 100644 --- a/VIRTUAL_VACATION/vacation.pl +++ b/VIRTUAL_VACATION/vacation.pl @@ -571,6 +571,13 @@ sub send_vacation_email { } } + # We can't use localhost as the local bind interface if we're trying + # to connect to an SMTP server that isn't on localhost, we won't be + # able to route to that server. + if ($smtp_server ne 'localhost' && $smtp_client eq 'localhost') { + $smtp_client = undef; + }; + my $smtp_params = { host => $smtp_server, port => $smtp_server_port,