Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm looking for an smtp service that essentially obeys the RFC, except rather than sending mail it simply logs to a file

[date] sent mail to <address>

Or whatever. I can bash this together with the bare minimum of functionality I need in python in about half an hour I reckon but if there's an existing project that works better I'd rather use that.

The reason for needing it is debugging an app that keeps sending 7* the amount of mail it's supposed to.

EDIT: And already asked: http://stackoverflow.com/questions/1006650/dummy-smtp-server-for-testing-apps-that-send-email

share|improve this question

8 Answers 8

up vote 16 down vote accepted

If you have python lying around this will write the SMTP conversation to stdout.

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


share|improve this answer
I take it back, it does support HTML emails. –  HTTP500 Feb 9 '12 at 17:32

You should have a look at smtp-sink which is a part of Postfix. You don't have to run Postfix to make it work. Just install it to have the executable. Everything you need can be configured via command line parameters:


share|improve this answer
Thanks mailq. This is more or less exactly what I was after! –  richo Apr 14 '11 at 0:18

We use http://mailtrap.io web service in developement and staging environment. It is platform-independent and doesn't require you to run your own SMTP.

It offers:

  • All emails in one place
  • Shared access for dev team to the inbox
  • Developer tools to analyze emails
  • Flexible configuration
share|improve this answer
This is great and much more robust than what I was doing! Thanks. –  richo Nov 22 '11 at 23:50


This looks like a it'll probably do the job, for anyone else who stumbles upon this.

share|improve this answer
Too bad it requires a javavm. Plus someone has forked and worked on it more recently... github.com/rjo1970/dumbster –  John Mee Mar 16 '11 at 23:32
Cheers John. Java based was enough to put me off in the end, I wound up just writing something myself. –  richo Mar 17 '11 at 23:44

I just fork up just about any smtp service then send the result to a bit bucket!

share|improve this answer
I'm talking about bulk emails though, and with live customer data involved. I need to be positive that I'm not going to flood the intertrons with mail. –  richo Dec 1 '10 at 1:00
I wound up extending python's smtpd.SMTPServer class, I'll release the project publically in a week or so when I'm happy with it (I'm bundling it with an httpd test suite I wrote a while back). I've tentatively named the suite sdb. –  richo Dec 1 '10 at 1:01
@Richo: there are lots of ways to stop a SMTP server from sending emails - most allow you turn off outgoing connections or reroute all messages, or you can block outgoing connections to port 25....nobody would bother writing a dummy mailserver whwn its trivial to configure a real one to behave in this way. –  symcbean Dec 1 '10 at 10:41
@symcbean: those are all valid points. Personally I find it easier to stop my usual mail service, start my debugging service, do my debugging and then fire up the live environment again. Kludges like dumping all port 25 traffic then prevents anything else from sending mail. Thanks for the help though, –  richo Dec 1 '10 at 22:40
none of this makes sense, all smtp gateways will give you this exact functionality without losing any of the outbound live emails! –  tony roth Dec 2 '10 at 3:09

Disclaimer: This is a late answer, but I genuinely believe it will help out future viewers. Also note that I worked on this product.

We built Mailosaur in order to solve this exact problem. We've since built it out to add test email addresses as well as SMTP.

share|improve this answer

smtp4dev has worked well for me. (Windows only)

share|improve this answer

FakeSMTP https://nilhcem.github.io/FakeSMTP/ is cross-platform and open-source.

share|improve this answer

protected by Michael Hampton Jan 21 at 13:51

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.