I'm working on mail loop monitors. I am having a problem getting check_imap_receive to log into office 365.
I've configured thunderbird to connect to
outlook.office365.com:993 (SSL imap)
This all works fine, and I have a message sitting in the inbox with subject "Testing check_imap_receive"
Check_imap_receive fails:
$ ./check_imap_receive --hostname outlook.office365.com --username '############' --password '###########' --search -s SUBJECT -s "Testing check_imap_receive" --ssl
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 line 121.
Here is a snippet of check_imap_receive (which is perl), near line 121:
114 eval {
115 local $SIG{ALRM} = sub { die "exceeded timeout $timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm`
116 alarm $timeout;
117
118 if( $ssl ) {
119 $imap_port = $default_imap_ssl_port unless $imap_port;
120 my $socket = IO::Socket::SSL->new("$imap_server:$imap_port");
121 die IO::Socket::SSL::errstr() unless $socket;
122 $socket->autoflush(1);
123 $imap = Mail::IMAPClient->new(Socket=>$socket, Debug => 0 );
124 $imap->State(Mail::IMAPClient->Connected);
125 $imap->_read_line() if "$Mail::IMAPClient::VERSION" le "2.2.9"; # necessary to remove the server's "ready" line from the input buffer for old versions of Mail:: IMAPClient. Using string comparison for the version check because the numeric didn't work on Darwin and for Mail::IMAPClient the next version is 2.3.0 and then 3.00 so string comparison works
Perl-IO-Socket-SSL in installed, per yum (this is on rhel6).
Does anyone have advice on how to troubleshoot this?
Thank you!
David Summers
help troubleshooting check_imap_receive and office365
Re: help troubleshooting check_imap_receive and office365
Try adding the following line in the "check_imap_receive":
right above the
line (in the beginning of the script).
Let us know if this helps.
Code: Select all
use IO::Socket::SSL 'inet4';Code: Select all
# look for required modulesLet us know if this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: help troubleshooting check_imap_receive and office365
Thank you!
That did get me past the connect error. I am now getting a new error:
Cannot search messages: Invalid search parameters: 4 BAD The specified message set is invalid. at ./check_imap_receive line 194.
But I will troubleshoot that and append to this thread what I find.
Thanks again.
David
That did get me past the connect error. I am now getting a new error:
Cannot search messages: Invalid search parameters: 4 BAD The specified message set is invalid. at ./check_imap_receive line 194.
But I will troubleshoot that and append to this thread what I find.
Thanks again.
David
Re: help troubleshooting check_imap_receive and office365
My error was a simple syntax error. I was specifying --search and -s. This command is working for me after modifying search_imap_receive as suggested:
./check_imap_receive --hostname outlook.office365.com --username '#####' --password '########' -s SUBJECT -s "Testing check_smtp_send from monitor01p" --ssl
./check_imap_receive --hostname outlook.office365.com --username '#####' --password '########' -s SUBJECT -s "Testing check_smtp_send from monitor01p" --ssl
Re: help troubleshooting check_imap_receive and office365
I am locking this thread as "resolved". Thanks for the feedback!
Be sure to check out our Knowledgebase for helpful articles and solutions!