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

This commit is contained in:
Dmitrii Zolotarev 2014-06-04 09:59:10 +07:00
parent 13d3abc71f
commit fb05fd6371
1 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,7 @@ 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 {
@ -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; logger("\t$myself: to: $to") if $debug;
} }
} }