added support for relay-only MTA (for example Nullmailer)

This commit is contained in:
Jordi Sanfeliu 2014-06-10 16:17:58 +02:00
parent 7562401bc5
commit 7e6f750d96
1 changed files with 6 additions and 9 deletions

View File

@ -26,7 +26,6 @@ use Monitorix;
use MIME::Lite; use MIME::Lite;
use LWP::UserAgent; use LWP::UserAgent;
use Exporter 'import'; use Exporter 'import';
use Switch;
our @EXPORT = qw(emailreports_send); our @EXPORT = qw(emailreports_send);
sub emailreports_send { sub emailreports_send {
@ -201,15 +200,13 @@ EOF
); );
} }
switch ($config->{method}) { if(lc($config->{method} || "") eq "relay") {
case "smtp" { $msg->send();
$msg->send('smtp', $emailreports->{smtp_hostname},
Timeout => 60); } else {
} $msg->send('smtp', $emailreports->{smtp_hostname}, Timeout => 60);
case "relay" {
$msg->send();
}
} }
logger("\t$myself: to: $to") if $debug; logger("\t$myself: to: $to") if $debug;
} }
} }