How to setup a fake SMTP server to catch all mails

debuggingsmtp

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

Best Answer

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

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

http://docs.python.org/library/smtpd.html#debuggingserver-objects

Related Topic