• Stars
    star
    473
  • Rank 89,915 (Top 2 %)
  • Language
    PHP
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open Source standalone trashmail solution that ships its own mail server

Open Trashmail

Open Trashmail

Apache License Hits

Selfhosted trashmail solution - Receive Emails via Web UI, JSON API and RSS feed

Screenshot of Open Trashmail

Features

  • Python-powered mail server that works out of the box for any domain you throw at it
  • API for integrating it in your own projects. Can be used to give users individual email addresses and read what they send to it
  • Handles attachments
  • Web interface to manage emails
  • Generates random email addresses
  • 100% file based, no database needed
  • Can be used as Email Honeypot

[INFO] March '23

Since Docker Hub won't allow team Organizations anymore, we moved our images to GitHub Container Registry. So if you want to use the latest version, please use the new image ghcr.io/hascheksolutions/opentrashmail instead of hascheksolutions/opentrashmail

Configuration

Just edit the config.ini You can use the following settings

  • DOMAINS -> Comma separated list of domains this mail server will be receiving emails on. It's just so the web interface can generate random addresses
  • MAILPORT-> The port the Python-powered SMTP server will listen on. Default: 25
  • ADMIN -> An email address (doesn't have to exist, just has to be valid) that will list all emails of all addresses the server has received. Kind of a catch-all
  • DATEFORMAT -> How should timestamps be shown on the web interface (moment.js syntax)

Roadmap

  • Mail server
    • Storing received mails in JSON
    • Storing file attachments
  • Docker files and configs
  • Web interface
    • Choose email
    • Get random email address
    • Download attachments safely
    • Display Text/HTML
    • API so all features from the site can also be automated and integrated
    • Automatically check for new emails while on site
    • Admin overview for all available email addresses
    • Option to show raw email
    • Delete messages
    • Secure HTML, so no malicious things can be loaded
    • Display embedded images inline using Content-ID
    • Make better theme
  • Configurable settings
    • Choose domains for random generation
    • Choose if out-of-scope emails are discarded
    • Automated cleanup of old mails
    • Honeypot mode where all emails are also saved for a catchall account
    • Optionally secure whole site with a password
    • Optionally allow site to be seen only from specific IP Range

Quick start

Simple start with no persistence

docker run -it -p 25:25 -p 80:80 ghcr.io/hascheksolutions/opentrashmail

Saving data directory on host machine

docker run -p 80:80 -p 25:25 -v /path/on/host/where/to/save/data:/var/www/opentrashmail/data ghcr.io/hascheksolutions/opentrashmail

Complete example with running as daemon, persistence, a domain for auto-generation of emails, acceptng only emails for configured domains, cleanup for mails older than 90 days and auto restart

docker run -d --restart=unless-stopped --name opentrashmail -e "DOMAINS=mydomain.eu" -e "DATEFORMAT='D.M.YYYY HH:mm'" -e "DISCARD_UNKNOWN=false" -e "DELETE_OLDER_THAN_DAYS=90" -p 80:80 -p 25:25 -v /path/on/host/where/to/save/data:/var/www/opentrashmail/data ghcr.io/hascheksolutions/opentrashmail

How it works

The heart of Open Trashmail is a Python-powered SMTP server that listens on incoming emails and stores them as JSON files. The server doesn't have to know the right email domain, it will just catch everything it receives. You only have to expose port 25 to the web and set an MX record of your domain pointing to the IP address of your machine.