| /rss/`[email-address]` | Renders RSS XML for rss clients to render emails | [![](https://pictshare.net/ysu5qp.png)](https://pictshare.net/ysu5qp.png) |
| /api/raw/`[email-address]/[id]` | Returns the raw email of the address. Warning: Output can be as large as the email itself so might be up to 20mb for mails with large attachments | [![](https://pictshare.net/pkb49p.png)](https://pictshare.net/pkb49p.png) |
| /api/attachment`[email-address]/[attachment-id]` | Returns the attachment with the correct mime type as header | |
| /api/delete/`[email-address]/[id]` | Deletes a specific email message and their attachments | |
| /api/deleteaccount/`[email-address]`| Deletes all messages and attachments of this email account | |
| /json/`[email-address]` | Returns an array of received emails with links to the attachments and the parsed text based body of the email. If `ADMIN` email is entered, will return all emails of all accounts | [![](https://pictshare.net/100x100/sflw6t.png)](https://pictshare.net/sflw6t.png) |
| /json/`[email-address]/[id]` | To see all the data of a received email, take the ID from the previous call and poll this to get the raw and HTML body of the email. Can be huge since the body can contain all attachments in base64 | [![](https://pictshare.net/100x100/eltku4.png)](https://pictshare.net/eltku4.png) |
| /json/listaccounts | If `SHOW_ACCOUNT_LIST` is set to true in the config.ini, this endpoint will return an array of all email addresses which have received at least one email | [![](https://pictshare.net/100x100/u6agji.png)](https://pictshare.net/u6agji.png) |
-`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](https://momentjs.com/docs/#/displaying/))
In Docker you can use the following environment variables:
| ENV var | What it does | Example values |
| --------|--------------|----------|
| URL | The URL of the web interface. Used by the API and RSS feed | http://localhost:8080 |
| DISCARD_UNKNOWN | Tells the Mailserver to wether or not delete emails that are addressed to domains that are not configured | true, false |
| DOMAINS | The whitelisted Domains the server will listen for. If DISCARD_UNKNOWN is set to false, this will only be used to generate random emails in the webinterface |
| SHOW_ACCOUNT_LIST | If set to `true`, all accounts that have previously received emails can be listed via API or webinterface | true,false |
| ADMIN | If set to a valid email address and this address is entered in the API or webinterface, will show all emails of all accounts. Kind-of catch-all | test@test.com
| DATEFORMAT | Will format the received date in the web interface based on [moment.js](https://momentjs.com/) syntax | "MMMM Do YYYY, h:mm:ss a" |
| SKIP_FILEPERMISSIONS | If set to `true`, won't fix file permissions for the code data folder in the container. Useful for local dev. Default `false` | true,false |
In your DNS panel create a MX record for your domain pointing to the IP of the server hosting OpenTrashmail.
The following example will allow you to send emails to example.com
```zonefile
mail.example.com. IN A 93.184.216.34
example.com. 14400 IN MX 10 mail.example.com.
```
This advanced example will allow you to use a wildcard domain:
```zonefile
mail.example.com. IN A 93.184.216.34
*.example.com. 14400 IN MX 10 mail.example.com.
```
This in combination with the configuration option "DOMAINS" (eg docker parameter `-e DOMAINS="*.example.com"`) will allow you to use any address with any subdomain of example.com (eg test@robot.example.com, john@lynn.example.com, etc..)
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
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.