Fake SMTP Server for testing

When you develop a website or an application, you may need to use a fake SMTP server for debugging. Fake SMTP servers access emails, but they won’t deliver emails to the recipient’s email address.

The simplest way to run a debugging SMTP server is using the following python code

python3 -m smtpd -n -c DebuggingServer 0.0.0.0:2525

This will start an SMTP server on port 2525. It does not support SMTP authentication.

If you want to run a Fake SMTP server with Authentication support, use

https://github.com/rnwood/smtp4dev

You can install it using docker.

First you need to install Docker. On Ubuntu, run

apt install docker.io

Run smtp4dev with the command

docker run -d -it -p 3000:80 -p 2525:25 --restart=unless-stopped rnwood/smtp4dev

SMTP Server will listen on port 2525. On port 3000, you have a web interface to read the mails

Fake SMTP Server

See SMTP

Comments

Leave a Reply

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