Merge pull request #49 from dmitrii-zolotarev/master

Added support for relay-only MTA (for example Nullmailer)
This commit is contained in:
Jordi Sanfeliu 2014-06-10 10:46:05 +02:00
commit 7562401bc5
1 changed files with 10 additions and 1 deletions

View File

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