Old and cranky:


./check_mail_loop -debug -pa=PASS -smtppasswd=PASS -pendw=15 -pendc=20



  • startssl and tls are not both supported with POP.
  • Especially with MS Exchange it seems not possible to use this plugin.
  • You often need to use a pop option for imap.
  • Automatic Port selection seems to be implemented for some parts, but not all.



We needed something else, that just worked!


The MK devs recently commited a python version of this check to the doc/treasures directory. 

It's a cleanup of one of the last things I had built in my time at MK (smile)

This check does just what you need and nothing more - it sends a mail to a configurable SMTP echo server and then checks via POP3 if the mail arrived OK.

The old version from me and with some emergency help from Basti still had a known race condition that led to mails not being deleted on the server. I'm glad they "healed" it now so I  can document it for everyone.

For my own site I added back the SMTP send support since I for really checking a mail loop you also need to really use the submission method an end user has to go through.

This is a "classical" Nagios check that can be used in any kind of setup, not just Check_MK.

It needs to be configured inline, by giving server addresses and usernames, and potentially setting it for SSL or not etc. The good thing it has great tracking of emails and could well be extended (using proper email libraries to parse headers) to give performance data.


Anyway, here's the rule set. I had called the check, now it's check_mail_loop for easier confusion, but oh well. The perl check is such a mess I don't mind if it will soon be forgotten.


Interval: Since the bounce email server is run for free by a university, you're asked to have a long interval between checks.

The check is built with that in mind and designed for a check interval of 20 minutes.

Please configure it like that so you don't spam their servers. The check will behave no better at 1min interval!


The check interval must be set for "normal" checks


And retries: