| 1 |
Index: pkg-nagios-plugins-contrib/check_email_delivery/src/check_smtp_send |
| 2 |
=================================================================== |
| 3 |
--- pkg-nagios-plugins-contrib.orig/check_email_delivery/src/check_smtp_send |
| 4 |
+++ pkg-nagios-plugins-contrib/check_email_delivery/src/check_smtp_send |
| 5 |
@@ -149,26 +149,16 @@ eval { |
| 6 |
if( $tls and $auth_method ) { |
| 7 |
$smtp_port = $default_smtp_tls_port unless $smtp_port; |
| 8 |
$smtp = TLS_auth->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password, Auth_Method=>$auth_method); |
| 9 |
- if( $smtp ) { |
| 10 |
- my $message = oneline($smtp->message()); |
| 11 |
- die "cannot connect with TLS/$auth_method: $message" if $smtp->code() =~ m/53\d/; |
| 12 |
- } |
| 13 |
} |
| 14 |
elsif( $tls ) { |
| 15 |
$smtp_port = $default_smtp_tls_port unless $smtp_port; |
| 16 |
$smtp = Net::SMTP::TLS->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password); |
| 17 |
- if( $smtp ) { |
| 18 |
- my $message = oneline($smtp->message()); |
| 19 |
- die "cannot connect with TLS: $message" if $smtp->code() =~ m/53\d/; |
| 20 |
- } |
| 21 |
} |
| 22 |
elsif( $ssl ) { |
| 23 |
$smtp_port = $default_smtp_ssl_port unless $smtp_port; |
| 24 |
$smtp = Net::SMTP::SSL->new($smtp_server, Port => $smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); |
| 25 |
if( $smtp && $username ) { |
| 26 |
$smtp->auth($username, $password); |
| 27 |
- my $message = oneline($smtp->message()); |
| 28 |
- die "cannot connect with SSL/password: $message" if $smtp->code() =~ m/53\d/; |
| 29 |
} |
| 30 |
} |
| 31 |
elsif( $auth_method ) { |
| 32 |
@@ -176,8 +166,6 @@ eval { |
| 33 |
$smtp = Net::SMTP_auth->new($smtp_server, Port=>$smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); |
| 34 |
if( $smtp ) { |
| 35 |
$smtp->auth($auth_method, $username, $password); |
| 36 |
- my $message = oneline($smtp->message()); |
| 37 |
- die "cannot connect with SSL/$auth_method: $message" if $smtp->code() =~ m/53\d/; |
| 38 |
} |
| 39 |
} |
| 40 |
else { |
| 41 |
@@ -185,8 +173,6 @@ eval { |
| 42 |
$smtp = Net::SMTP->new($smtp_server, Port=>$smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); |
| 43 |
if( $smtp && $username ) { |
| 44 |
$smtp->auth($username, $password); |
| 45 |
- my $message = oneline($smtp->message()); |
| 46 |
- die "cannot connect with password: $message" if $smtp->code() =~ m/53\d/; |
| 47 |
} |
| 48 |
} |
| 49 |
}; |