Finally a Dummy SMTP for Linux

Okay picture this: You’re building your awesome web app and suddenly, you have to verify that emails are being sent properly. You’d want some kind of app that would drop emails in a folder, right?

If you were on Windows, that would be fairly easy. Just hit a web search and install one of the many dummy SMTP servers out there.

But you’re probably on Linux (why else would you be reading this). And on Linux, there is no such app. You’ll have to hack your way out of this.

Well not anymore. Thanks to this awesome script by Stuart Colville, I was able to create a dummy SMTP server in Python. I’ve posted the code on github :

https://github.com/jevin/Dummy-SMTP

It’s really simple to use :

  1. Download the .zip
  2. Extract it
  3. Make “listen.py” executable
  4. Kill any process using port 25 (usually “sudo pkill sendmail” is enough)
  5. Type “sudo ./listen.py” on your console
  6. Tada! All emails sent will be dropped in the “mails” folder.

I’ve only tested this with Sendmail. So if you see something weird with other MTAs, let me know!

8 thoughts on “Finally a Dummy SMTP for Linux”

  1. Awesome! Really interested in trying it out. Out of curiosity, why not just tar and gzip the file to preserve the executable permissions? I’d say this is more or less the norm on Linux.

    1. I don’t think it will make any difference. But, since I never worked with anything other than Sendmail, I’m not very sure. These MTAs can be a pain at times!

Leave a Reply

Your email address will not be published. Required fields are marked *

captcha

Please enter the CAPTCHA text