I'm using the Nagios plugin check_email_delivery to monitor email, and to check software statuses in some cases. We're now moving all of our internal mail servers to Office 365 and have discovered that this command:
./check_imap_receive_epn -H outlook.office365.com -U user@example.com -P password --ssl -s SUBJECT -s $ARG1$ -w 1200 -c 1800
Results in:
IMAP RECEIVE CRITICAL - Could not connect to outlook.office365.com port 993: IO::Socket::INET6 configuration failederror:00000000:lib(0):func(0):reason(0) at ./check_imap_receive_epn line 93.
HOWEVER! Resolving the cname to an IP address seems to work. Example:
./check_imap_receive_epn -H 157.56.239.201 -U user@example.com -P password --ssl -s SUBJECT -s $ARG1$ -w 1200 -c 1800
With a result of:
IMAP RECEIVE OK - 5 seconds, 1 found, 1 deleted
I think the issue is caused here:
my $socket = IO::Socket::SSL->new(PeerAddr=>"$imap_server:$imap_port", %ssl_args);
Where $imap_server
isn't resolving correctly. Any suggestions? >.<