My work requires me to test various email functions throughout a broad range of systems. I often do this testing from the commandline, but there are times when you want to automate the testing, to repeat the same task many times to make sure that things are behaving reliably.
What follows is a bit of perl code I have developed over the years to test the SMTP engine on a particular host. The code requires the CPAN modules Net::SMTP, Email::MessageID, Email::Address, Time::HiRes. I use this code for all kinds of email testing– anti-spam, mail redirection, anti-virus, mail routing. The script connects directly to a defined mailserver and dumps appropriate data to it. I change that data depending on the needs of the test. The script listed below is set to send 3 messages. That is easily adjustable by redefining the value of the $count variable.
I am positive there are more efficient ways of doing this. I like my script because it is transparent. I am able to see what it is doing and understand every element of it. It makes sense to me. And when troubleshooting, that is an important quality.
Tuesday night, Whirl, Liz, and I attended the Dropkick Murphys’ concert at the