Thursday, March 15, 2012

check_email_delivery and SMTP SSL

For all of you who want/need/have to monitor an email server's performance or delay, there is a nice plugin for nagios out there written by Jonathan Buhacoff. It's not only a single plugin either, but a suite of scripts to check various smtp- and imap-related things.


I've set up a gmail account to send emails to my own email server to check its functions and - more importantly - to log its delay. I found out that there are problems with perl and Net::SMTP::TLS in Centos 5.7. Using SMTP::SSL worked fine. Jonathan's script check_email_delivery doesn't support sending mails via SSL however, although the underlying script does.

Here's a quick patch that adds a new parameter "--smtpssl" which enables sending emails via SSL.
31d30
< my $smtp_ssl = "";
86d84
<       "smtpssl!"=>\$smtp_ssl,
190d187
< $smtp_options .= "--ssl " if defined $smtp_ssl and $smtp_ssl;
Please bear in mind that this is a quick and dirty hack, and that I take no responsibility in any unwanted or ill effects whatsoever. Use purely on your own risk!

No comments: