Originally published on: Fri, 08 Jan 2010 23:03:44 +0000
In the late 90's, I wrote a commercial command-line SMTP e-mail utility called MailSend. In order to test the behavior of certain operations, I needed a program that would simulate an SMTP server. This simulator needed to allow me to quickly alter behaviors to generate conditions that customers might be seeing with their SMTP servers.
At the time, I wrote the tool in my utility language of choice: Perl.
smtpsim.pl
Running the above simulator yields the following output:
I then use my MailSend utility to send an email using localhost as the SMTP server address:
The smtpsim.pl console then displays the following conversation:
The console window for MailSend displays the following;
If I need to try and introduce specific behavior for a given SMTP command, I alter the if statements in the while loop to send back something other than a 200 status code.
The simulator can be used to test any SMTP client.
Unless otherwise noted, all code and text entries are Copyright ©2010 by James K. Lawless
Save to del.icio.us
Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Subscribe!
Auto Save Clipboard Images Redux
Extending SpiderMonkey JavaScript on Windows
Rhino JavaScript to EXE with launch4j
Compiling Rhino JavaScript to Java
Directory Traversal in Rhino JavaScript
A Command-Line MP3 Player for Windows
Auto Save Images from the Clipboard
Java in a Windows EXE with launch4j
An Interview with Tom Zimmer: Forth System Developer
Setting Windows Console Text Colors in C
Preventing Windows Screen-Saver Activation
Embedding JavaScript in a Batch File
Mad Schemes : Learning Lisp via SICP
An Interview with the Author of the French Silk Assembler
Scrolling GIF Banners with PerlMagick
A Simple Parser for a Small Command Line Interface
Jim Butterfield : The Commodore Guru
A TCP Command Line Interface in Rhino JavaScript
MicroISV on a Shoestring
DadHacker
The Bottom Feeder
Writin' That Code!
The Recursive ISV
The Thomsen Blog
Prototypically Speaking
The Reinvigorated Programmer