opentrashmail/README.md

100 lines
4.8 KiB
Markdown
Raw Normal View History

2019-08-14 14:18:49 +00:00
<p align="center">
<a href="" rel="noopener">
<img height=200px src="https://raw.githubusercontent.com/HaschekSolutions/opentrashmail/master/web/imgs/logo_300_roundbg.png" alt="Open Trashmail"></a>
2019-08-14 14:18:49 +00:00
</p>
<h1 align="center">Open Trashmail</h1>
2021-11-18 22:08:04 +00:00
<div align="center">
2019-08-14 14:18:49 +00:00
![](https://img.shields.io/badge/php-7.1%2B-brightgreen.svg)
![](https://img.shields.io/badge/python-2.7%2B-brightgreen.svg)
2019-08-16 13:06:42 +00:00
[![](https://img.shields.io/docker/pulls/hascheksolutions/opentrashmail?color=brightgreen)](https://hub.docker.com/r/hascheksolutions/opentrashmail)
2019-08-16 13:07:43 +00:00
[![](https://img.shields.io/docker/cloud/build/hascheksolutions/opentrashmail?color=brightgreen)](https://hub.docker.com/r/hascheksolutions/opentrashmail/builds)
2019-08-14 14:18:49 +00:00
[![Apache License](https://img.shields.io/badge/license-Apache-blue.svg?style=flat)](https://github.com/HaschekSolutions/opentrashmail/blob/master/LICENSE)
2021-11-10 22:10:20 +00:00
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FHaschekSolutions%2Fopentrashmail&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
2019-08-14 14:18:49 +00:00
[![](https://img.shields.io/github/stars/HaschekSolutions/opentrashmail.svg?label=Stars&style=social)](https://github.com/HaschekSolutions/opentrashmail)
2021-11-18 22:08:04 +00:00
#### Selfhosted `trashmail` solution - Receive Emails via `Web UI`, `JSON API` and `RSS feed`
2019-08-14 14:18:49 +00:00
</div>
2021-11-18 22:08:04 +00:00
2019-08-15 19:43:55 +00:00
![Screenshot of Open Trashmail](https://pictshare.net/shz4tq.png)
2019-09-27 08:55:03 +00:00
# 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
2019-09-27 08:55:03 +00:00
- Handles attachments
- Web interface to manage emails
- Generates random email addresses
2019-09-27 08:55:03 +00:00
- 100% file based, no database needed
- Can be used as Email Honeypot
# JSON API
2023-03-23 09:09:03 +00:00
## [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
2019-10-06 17:07:22 +00:00
# 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`
2019-10-06 17:07:22 +00:00
- `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](https://momentjs.com/docs/#/displaying/))
2019-08-14 14:18:49 +00:00
# Roadmap
- [x] Mail server
2019-08-14 14:18:49 +00:00
- [x] Storing received mails in JSON
- [x] Storing file attachments
2019-08-16 13:06:42 +00:00
- [x] Docker files and configs
2019-08-14 14:18:49 +00:00
- [ ] Web interface
2019-08-15 19:43:55 +00:00
- [x] Choose email
- [x] Get random email address
- [x] Download attachments safely
2019-08-15 19:43:55 +00:00
- [x] Display Text/HTML
2019-08-15 19:45:49 +00:00
- [x] API so all features from the site can also be automated and integrated
2019-08-16 08:30:23 +00:00
- [x] Automatically check for new emails while on site
2019-08-18 19:02:51 +00:00
- [x] Admin overview for all available email addresses
2021-11-15 11:17:59 +00:00
- [x] Option to show raw email
- [x] Delete messages
- [x] Make better theme
- [x] Secure HTML, so no malicious things can be loaded
2021-11-18 22:08:04 +00:00
- [ ] Display embedded images inline using Content-ID
2019-08-15 19:43:55 +00:00
- [ ] Configurable settings
2019-08-15 19:45:49 +00:00
- [x] Choose domains for random generation
- [x] Choose if out-of-scope emails are discarded
- [x] Automated cleanup of old mails
2019-08-15 19:43:55 +00:00
- [ ] Honeypot mode where all emails are also saved for a catchall account
2019-08-16 08:30:23 +00:00
- [ ] Optionally secure whole site with a password
- [ ] Optionally allow site to be seen only from specific IP Range
2019-08-13 21:35:40 +00:00
2019-08-16 13:06:42 +00:00
# Quick start
Simple start with no persistence
2019-08-16 13:06:42 +00:00
```bash
docker run -it -p 25:25 -p 80:80 ghcr.io/hascheksolutions/opentrashmail
2019-08-16 13:06:42 +00:00
```
Saving data directory on host machine
```bash
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
```bash
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
```
2019-08-15 19:43:55 +00:00
# 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.