Sunday, February 14, 2010


The other day I set out to find a mail server that would accept all mail coming to it and not then display it back to whoever wanted. The idea was so that instead of setting up fake email address for people to check the results of various different black box testing scenarios we could all see the email that was generated from the application. I was 100% sure that such a thing existed, and honestly surprised when I found that it did not (at least I could not find anything).
There is a fair amount of software out there that comes close to what I want, dumpster and wiser for unit testing and a myriad of tools (papercut looked like a neat one but I never tried it having a mac and all) that will sit on a desktop and intercept email; but nothing that was suitable for a server used by multiple people.

I decided therefore to make one. I had been looking for a small grails project to do in order to really understand how grails would work beyond a tutorial level understanding. A couple weekends later and mockemail is in a useable albeit rough around the edges form. It is open source and runs on the grails framework. I have deployed it and we are using it internally and nothing has crashed so at least in this I am successful. I can also say it was a nice departure to actually develop something for a change, even on a small scale.

Mockemail is a web based server that is very easy to setup and run. You download it and turn it on (maybe change the port number to 25). Any mail that is sent to it will be stored locally and not delivered to the final recipient. No checks are done against the address, it simply accepts it and stores it. The mail can be then be viewed and displayed back to anyone who is interested with no need to log out and log in, in other words any email that the server receives is viewable by anyone who wants to see it. It is open sourced and has been made available here for free on source forge in the hopes that someone else finds it useful.

In a later post I hope to talk about what I did and the problems I ran into while building it.