Dummy SMTP server for development purposes

at. picture at. · Apr 28, 2011 · Viewed 17.4k times · Source

I've been using a dummy smtp server called DevNull SMTP so that I can test my app which sends out notification emails. It has a nice simple GUI, very helpful, but can't be scripted easily. I can't even start it listening to port 25. I have to run the app and then click on the start button...

Is there a similar app that can be scripted easily? Scripted in the sense that I can control it from a bash script or windows batch file and possibly even query the emails from my unit/functional tests.

Answer

Mic picture Mic · Jun 14, 2011

there is a nice trick with python: http://muffinresearch.co.uk/archives/2010/10/15/fake-smtp-server-with-python/

Just one liner can do the job:

sudo python -m smtpd -n -c DebuggingServer localhost:25