--- /usr/local/nagios/libexec/check_email_loop.pl 2006-09-29 15:21:04.000000000 -0500 +++ check_email_loop.pl 2007-02-06 09:47:37.000000000 -0600 @@ -47,7 +47,7 @@ 'UNKNOWN' , '3'); my $state = "UNKNOWN"; -my ($sender,$receiver, $pophost, $popuser, $poppasswd, $smtphost,$keeporphaned); +my ($sender,$receiver, $pophost, $popuser, $poppasswd, $smtphost,$keeporphaned,$authuser,$authpasswd); my ($poptimeout,$smtptimeout,$pinginterval,$maxmsg)=(60,60,5,50); my ($lostwarn, $lostcrit,$pendwarn, $pendcrit,$debug); $debug = 0; @@ -89,6 +89,8 @@ "pendcrit=i",\$pendcrit, "maxmsg=i",\$maxmsg, "keeporphaned=s",\$keeporphaned, + "authuser=s",\$authuser, + "authpasswd=s",\$authpasswd, ); usage() if ($status == 0 || ! ($pophost && $popuser && $poppasswd && $smtphost && $receiver && $sender )); @@ -122,6 +124,9 @@ my $smtp = Net::SMTP->new($smtphost,Timeout=>$smtptimeout, %other_smtp_opts) || nsexit("SMTP connect timeout ($smtptimeout s)",'CRITICAL'); +if ($authuser && $authpasswd) { + $smtp->auth($authuser,$authpasswd) || nsexit("Error authenticating to SMTP server",'CRITICAL'); +} ($smtp->mail($sender) && $smtp->to($receiver) && $smtp->data() && @@ -246,6 +251,8 @@ print " -passwd=text Password for the POP3-user\n"; print " -poptimeout=num Timeout in seconds for the POP3-server\n"; print " -smtphost=text IP oder name of the SMTP host\n"; + print " -authuser=text SMTP Auth username\n"; + print " -authpasswd=text SMTP Auth passwd\n"; print " -smtptimeout=num Timeout in seconds for the SMTP-server\n"; print " -statfile=text File to save ids of messages ($statfile)\n"; print " -interval=num Time (in minutes) that must pass by before sending\n";