Ask HN: how to unit/integration test app that sends email?
2 points| tapostrophemo | 17 years ago | reply
I don't want to actually send emails. In fact, I'd like to keep all this local to my machine (or at least to my home network). And if I can avoid it, I don't want to install/configure sendmail/qmail/postfix/etc.; i.e., I don't want to install a real email server.
Is there a test SMTP server anyone knows of that's quick and easy to install (on Linux)? Or a clever hack using honeyd to fake out the SMTP communication?
[+] [-] SwellJoe|17 years ago|reply
So, any mail server will do. Just configure it to only accept mail from/for localhost. I know that Perl and Python both have good small SMTP servers available, and I imagine most dynamic languages would also (if it even matters what language it is in). So, you could use one of those, fire it up on a high port as part of your test process and send a message to the user running the test (which would then deliver to the users Maildir or whatever, based on configuration).
But I would just use Postfix. It's small, really easy to configure, and can be installed on most modern Linux distros with one command. It can easily be configured as I've suggested (set it to listen only on loopback, and set the destination to only localhost, and then send mail to "joe" rather than "[email protected]").
[+] [-] jedediah|17 years ago|reply