When running in Docker, use the following environment variables to configure the instance:
| 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` |
| `PASSWORD` | If configured, site and API can't be used without providing it via form, POST/GET variable `password` or http header `PWD` | `yourstrongpassword` |
| `ALLOWED_IPS` | Comma separated list of IPv4 or IPv6 CIDR addresses that are allowed to use the web UI or API | `192.168.5.0/24,2a02:ab:cd:ef::/60,172.16.0.0/16` |
| `ATTACHMENTS_MAX_SIZE` | Max size for each individual attachment of an email in Bytes | `2000000` = 2MB |
| `MAILPORT_TLS` | If set to something higher than 0, this port will be used for TLSC (TLS on Connect). Which means plaintext auth will not be possible. Usually set to `465`. Needs `TLS_CERTIFICATE` and `TLS_PRIVATE_KEY` to work | `465` |
| `TLS_CERTIFICATE` | Path to the certificate (chain). Can be relative to the /python directory or absolute | `/certs/cert.pem` or `cert.pem` if it's inside the python directory |
| `TLS_PRIVATE_KEY` | Path to the private key of the certificate. Can be relative to the /python directory or absolute | `/certs/privkey.pem` or `key.pem` if it's inside the python directory |
| `WEBHOOK_URL` | If set, will send a POST request to this URL with the JSON data of the email as body. Can be used to integrate OpenTrashmail in your own projects | `https://example.com/webhook` |
| `ADMIN_ENABLED` | Enables the admin menu. Default `false` | `false` / `true` |
| `ADMIN_PASSWORD` | If set, needs this password to access the admin menu | `123456` |