Build your own disposable email server like mailinator

Martin Roldan Araujo
1 min readMay 14, 2020

--

originally posted on https://blog.jutsu.mx

The goal is to have a disposable server for disposable email.

This can be easily done with docker and inbucket

TL;DR

docker run -it — rm — name inbucket -p 9000:9000 -p 25:2500 -p 1100:1100 inbucket/inbucket

Prepare your DNS record

In your domain registrar, go to DNS management and add an entry in case you don’t have one. You can use whatever you want.

In this example, I want to send any emails to `test.softwareinarush.com as in `2308uasdfA@test.softwareinarush.com`

Add an A record that points to your server

On the server, spin up a new container

Simply run:

docker run -it — rm — name inbucket -p 9000:9000 -p 25:2500 -p 1100:1100 inbucket/inbucket

This will start a temporary container with all you need:

* Web UI 9000 to see emails in real time.
* Open port 25to receive email (_could be changed but this works even with the `mail` command in MacOS_)
* Optionally use port 1100 for POP3 (I don’t)

![inbucket](https://drive.google.com/uc?export=view&id=1WOWjuKAnrDjxgdC-s0yeGYlfkq1ifCKh)

#### Test it
Send a test email from command line (or other email service)

mail -s “test emai hashmail” ninjutsu756@test.softwareinarush.com <<< ‘This is a message’

Email should be visible in the `Monitor` page

![monitor inbucket](https://drive.google.com/uc?export=view&id=1AIKOP2BwRik2EHRiq_jbmzQnuRb-52ao)

Once you’re done, you can `Ctrl + C` to terminate the container.

> Written with [StackEdit](https://stackedit.io/).

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Martin Roldan Araujo
Martin Roldan Araujo

Written by Martin Roldan Araujo

I write code 🤖 👾 🍳 🇲🇽 🏍

No responses yet

Write a response