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: https://stackoverflow.com/questions/1006650/dummy-smtp-server-for-testing-apps-that-send-email


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

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


  • I take it back, it does support HTML emails. – HTTP500 Feb 9 '12 at 17:32
  • 2
    still the best way to debug! – MarZab Apr 26 '15 at 19:32
  • No support for starttls :( – Att Righ Sep 3 '17 at 15:54
  • 1
    @AttRigh the smtplib has TLS implemented but using that isn't going to be as simple as this. Post the question; maybe someone has a script already? – John Mee Sep 4 '17 at 6:00

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:


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

There is also a ruby gem called mailcatcher.

You can read the emails directly in your browser through the integrated web interface, there's a screenshot from their homepage below.

Mailcatcher interface

  • 1
    We currently use mailcatcher, crashes too much. – Jacob Evans Sep 14 '15 at 13:58

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
  • This is great and much more robust than what I was doing! Thanks. – richo Nov 22 '11 at 23:50
  • I like that they offer a generous free plan (for now). – David Mar 1 '16 at 20:02

smtp4dev has worked well for me. (Windows only)

  • I just installed and used this awesome little tool. Perfect for my needs (no java and a nice UI) – Nick.McDermaid Oct 8 '15 at 1:05


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

  • 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

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.


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


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

  • 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

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