0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 11:12:15 +02:00

Fix default $smtp_client setting if we aren't connecting to the SMTP server on localhost.

This fixes the issue noted on https://github.com/postfixadmin/postfixadmin/discussions/648
This commit is contained in:
Andrew Ruthven 2023-08-18 23:23:07 +12:00 committed by Andrew Ruthven
parent 5c1725aef8
commit c9551cbb32
2 changed files with 13 additions and 0 deletions

View File

@ -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.

View File

@ -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,