Disposable-mailbox Docker
A self hosted yopmail like server running in a docker
What is Yopmail ?
Yopmail is a light webmail client designed to receive mails only (no sending !) using on the fly email addresses. Its goal is to be able to use infinite email addresses without any account or password. It can be useful for online one time subscription, creating multiple accounts, trying email reception..
Why Disposable-mailbox Docker ?
Yopmail like services are public, but for privacy you can run your own. You just need to install a mail receiver, a mail transfer agent and an HTTP server; then configure them all. This may be a bit long and complicated for unexperienced system administrators.
The easiest thing to solve the problem is to have everything installed and configured in a regular Docker. That's what is Disposable-mailbox Docker.
Project architecture
This project uses Docker and docker-compose.
The docker-compose runs 2 docker containers: one for the email agents and one for the web server.
The email agents in use for this project are Dovecot and Postfix. Those services are well known and well documented. Postfix receives the emails and Dovecot allows the web server to retrieve them through IMAP protocol.
The web server is a simple Apache2 running synox/disposable-mailbox open source project.
The web server uses both HTTP and HTTPS, but redirects HTTP to HTTPS. The certificate is auto-generated using Let's Encrypt.
Installation
- Clone this repo
- Edit the
.env
file. Change theFQDN
value by your domain and theEMAIL
value by your email address. If your service is accessible through the Internet, you can change the value ofLETSENCRYPT
toyes
to get a recognized HTTPS certificate. - Save the file
- Run
docker-compose up -d
and let docker build the project. - Open your browser on the localhost/chosen domain port
80
or443
and you should see the landing page. - Run some tests using your favorite mail client to send mails to your Disposable-mailbox Docker addresses.
Optional:
- Edit the
web/disposable-mailbox.conf
file to add your IPs authorized to access the application in theAllow from
lines and uncomment it. All the IPs out of theAllow from
won't be able to access the web service (but can send emails to the mail server).
Troubleshoot
If you encounter troubles, here are ways to debug:
Get logs from syslog:
- run
docker-compose logs -f <container name>
List the mails received:
- run interactively a container using
docker exec -it <container id> /bin/bash
- go to
/var/mail/vmail
- list the content
cur
:ls -l cur
Connect a web client:
- edit the
docker-compose.yml
to remove the "#" from therainloop
part - run the docker-compose
- open your browser on
localhost:8888
- connect using
vmail@<yourdomain>
and the password defined in theweb/www/disposable-mailbox/config.php
Credits
- Docker: https://www.docker.com/
- Docker-compose: https://docs.docker.com/compose/
- Dovecot: https://www.dovecot.org/
- Postfix: http://www.postfix.org/
- Apache: https://httpd.apache.org/
- Synox/Disposable-mailbox: https://github.com/synox/disposable-mailbox
- Let's Encrypt: https://letsencrypt.org/
- OpenSSL: https://www.openssl.org/