summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2006-08-15 07:59:57 +0200
committerTobi Oetiker <tobi@oetiker.ch>2006-08-15 07:59:57 +0200
commita861412cc85fd76c30cb0e0ce5ef0200487805a1 (patch)
tree3d10e72ddf34d186c858fde7905939114858abc2 /lib
parentfc280a35cc9b6cc96f26d13d4ab87e9a041cf154 (diff)
downloadsmokeping-a861412cc85fd76c30cb0e0ce5ef0200487805a1.tar.gz
smokeping-a861412cc85fd76c30cb0e0ce5ef0200487805a1.tar.xz
allow multiple Mailserver
add shorter timeout to smtp module
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index ac260bc..21b7add 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -168,7 +168,7 @@ sub sendmail ($$$){
$to = $1 if $to =~ /<(.*?)>/;
my $body = shift;
if ($cfg->{General}{mailhost} and
- my $smtp = Net::SMTP->new($cfg->{General}{mailhost})){
+ my $smtp = Net::SMTP->new([split /\s*,\s*/, $cfg->{General}{mailhost}],Timeout=>5) ){
$smtp->mail($from);
$smtp->to(split(/\s*,\s*/, $to));
$smtp->data();
@@ -1688,8 +1688,11 @@ DOC
mailhost =>
{
_doc => <<DOC,
-Instead of using sendmail, you can specify the name of an smtp server
-and use perl's Net::SMTP module to send mail to DYNAMIC host owners (see below).
+
+Instead of using sendmail, you can specify the name of an smtp server and
+use perl's Net::SMTP module to send mail to DYNAMIC host owners (see below).
+Several comma separated mailhosts can be specified. SmokePing will try using
+the next one after not getting an answer for 5 seconds.
DOC
_sub => sub { require Net::SMTP ||return "ERROR: loading Net::SMTP"; return undef; }
},