Skip to content

Commit

Permalink
Merge pull request #756 from puck/unset-smtp_client
Browse files Browse the repository at this point in the history
Fix default $smtp_client setting if we aren't connecting to the SMTP …
  • Loading branch information
DavidGoodwin committed Aug 29, 2023
2 parents 5c1725a + c9551cb commit 2324cf6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions VIRTUAL_VACATION/Contributions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <andrew@etc.gen.nz>
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.
7 changes: 7 additions & 0 deletions VIRTUAL_VACATION/vacation.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2324cf6

Please sign in to comment.