I want a high-level test that ensures that both incoming and outgoing email services are operating normally. I've achieved this by writing a python script which does this:
- Send a message with a unique hash through my mail server to [email protected]
- The gmail account is configured to auto-reply back to the same address and then delete the message.
- My script polls IMAP until it finds an email with the correct hash sitting in its inbox, or times out.
- It reports the elapsed time to my monitoring software (Zabbix)
My question: Is gmail the best third-party to use? Should I add a couple others as well such as hotmail and yahoo? Is there anyone more official that will auto-reply to these sorts of "mail pings"? Any other recommendations for this type of test?
I had something similar but got frustrated with false positives (any of the free email services is going to be decent about mail delivery but there were occasional delays with Gmail). I ended up splitting this into two monitors: one to send an email to my server via SMTP and then check the mailbox via IMAP to make sure it arrived (that covers inbound) and the other just watches the outbound mail queue and alerts if it gets above x messages. Assuming your server is loaded 24x7, the outbound queue will fill if outbound delivery isn't working.
I would send a test to as many free accounts as you can to pass the "we're not a spammer" test: that is, if your SPF records are in place and accurate, your content is ok, rDNS, attachments accepted, HTML formatting ok, etc. as more often than not, that's the cause of mail interruption these days.
I want to have more than one third-party email account to bounce my email test off of. Here's the result of my research:
For now, I have both Gmail and Yahoo set up, but I may look at some other services from this list.