Problems with check_imap


I’m using 3.0rc2 and I having issues with check_imap timing out. The command line I using to test the plugin before I implement it looks like this:

check_imap -H smms -p 443 -e “OK” -v

The output is this:
Using service IMAP
Port: 443
flags: 0x2
Quit string: a1 LOGOUT

server_expect_count: 1
0: OK
CRITICAL - Socket timeout after 10 seconds

what am I doing wrong?



I had the same problem with this command;
So I “wrote” a small perl script to check if there’s a mail in my imap server:
it uses these librairies: (to mesure how long it takes to receive the mail) … Client.pod (the IMAP lib)


use strict;
use Mail::IMAPClient;
use Benchmark;

my $server = $ARGV[0];
my $user= $ARGV[1];
my $passwd = $ARGV[2];

returns an unconnected Mail::IMAPClient object:

my $imap = Mail::IMAPClient->new;
$imap = Mail::IMAPClient->new(
Server => $server,
User => $user,
Password=> $passwd

my $folder = “INBOX”;

my @output;

@output = $imap->messages();
my $count = @output;
if ($count == 0) {
print “No mail in mailbox!\n”;
exit 2;

my$ msgid = @output[0];
my $start_time = new Benchmark;
@output = $imap->message_string($msgid);
my $end_time = new Benchmark;


maybe it can help you if you give up on check_imap :wink:


The script works great!

check_imap has gone away :slight_smile: