Commit 2f93799f authored by Maxime Besson's avatar Maxime Besson

Use specified port when testing SMTP conf

When saving the configuration in the manager, the SMTP test would fail
if your SMTP server is not on the standard port 25

The test now takes the port into account
parent 65d3e921
......@@ -325,7 +325,11 @@ sub tests {
if ($@);
# Create SMTP object
my $smtp = Net::SMTP->new( $conf->{SMTPServer}, Timeout => 5 );
my $smtp = Net::SMTP->new(
$conf->{SMTPServer},
Timeout => 5,
( $conf->{SMTPPort} ? ( Port => $conf->{SMTPPort} ) : () ),
);
return ( 1,
"SMTP connection to " . $conf->{SMTPServer} . " failed" )
unless ($smtp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment