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