So, a few years back, I consulted at NASA doing some work on a really cool system for storing and retrieving documentation on systems in flight. Basically, it was a very customized Bugzilla that winds up saving the American taxpayer millions of dollars every year. There’s a post I wrote at the time about how to print to PDF from Perl that is still the single most popular blog post I’ve ever written. It still gets traffic, and that tells me that the library is still terrible at telling you how to use it. Anyway, that’s not what I want to talk about today. Today, I’m advertising another application that arose from the same gig: a dummy SMTP/POP3 server.
One of the things that Bugzilla does is to send emails. It needs to notify people who are interested in issues that those issues have been updated. This is not all that uncommon; think of every ecommerce website – whenever you complete an order, you get an email confirming that the order was processed. Anyway, when one is working on a system that generates email, one wants to have a testing email server so that emails can get generated and sent without spamming a real email account. (Hey, did I ever tell you about how Uber’s Australian developers wound up using my Gmail account as their “fake” email address for development? After I notified them and they didn’t do anything, I used the password recovery feature to log in to their system and change the associated account’s preferences and password, locking their developers out of their own test account until they fixed their system. Ha!)
In the early days of LinkedIn, Jean-Luc whipped up a simple SMTP service in Python so that we could test sending invitation emails. When I was working at NASA I thought about that and tried to replicate it, only to discover two obstacles: it’s not straightforward to code up a service in Python, and I hate Python. After a couple of hours (I was on the clock and spending the taxpayers’ money, so I didn’t want to take forever) I decided to look for a Java solution. I found one in dumbster, but it’s really only half a solution. It allows you to send emails, but it doesn’t let you fetch them (so you can’t preview them in an email client, to see what your custom template emails look like when a customer gets them).
Periodically, when I’m bored or working on something else, I pull up dumbster and do a bit of work on it. I’ve got a lot of personal projects going, and I got tired of trying to be clever coming up with names for them. So now, I just name them after fruit – alphabetically. The email test framework is named, “haw,” which is the fruit of a hawthorn. It’s now a full SMTP server (so your application that sends email can send to it) and a POP3 server (so you can use an email client like Apple Mail or Outlook or mutt to look at the emails that get sent) as well as affording you the ability to paste in emails so you can work on services that parse inbound email.
I’ve found it very helpful in developing various applications, and I’ve shared it with the world but I realized today that I never made any kind of announcement about it. So. Here you go: if you need an email server for testing, try haw.