diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2023-08-07 16:58:17 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2023-08-07 17:26:50 +0900 |
commit | d220b02137c36a2d1d6e6a28cbfda5492188e303 (patch) | |
tree | bbdbb8a749865e12ddd0121b03679cbf7654b629 | |
parent | 09089a66647050559cc40b6f8c2920091e05b180 (diff) | |
download | smokeping-d220b02137c36a2d1d6e6a28cbfda5492188e303.tar.gz |
Use SMTPS and authentication for sending alerts
Not upstreamable. This disables unencrypted sending.
-rw-r--r-- | cpanfile | 1 | ||||
-rw-r--r-- | lib/Smokeping.pm | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -22,3 +22,4 @@ requires 'InfluxDB::LineProtocol'; # See: https://github.com/raphaelthomas/InfluxDB-HTTP/issues/10 requires 'JSON::MaybeXS'; requires 'Object::Result'; +requires 'Authen::SASL'; diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 1cd07bf..5b5bb90 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -267,7 +267,7 @@ sub sendmail ($$$){ $to = $1 if $to =~ /<(.*?)>/; my $body = shift; if ($cfg->{General}{mailhost} and - my $smtp = Net::SMTP->new([split /\s*,\s*/, $cfg->{General}{mailhost}],Timeout=>5) ){ + my $smtp = Net::SMTP->new([split /\s*,\s*/, $cfg->{General}{mailhost}],Timeout=>5,SSL=>1) ){ $smtp->auth($cfg->{General}{mailuser}, $cfg->{General}{mailpass}) if ($cfg->{General}{mailuser} and $cfg->{General}{mailpass}); $smtp->mail($from); |