emailgen.py is a small Python script for generating throwaway email addresses by creating aliases on a Mailcow server.
Note: this script creates ALIASES not full mailboxes, because I use this to generate steam accounts and have all the 2fa confirmations in a single mailbox.
python emailgen.py --new
python emailgen.py --new --custom-name myalias
- Python 3.7+
- A running Mailcow instance
- An API key with permission to create aliases
Install dependencies:
pip install requests pyyaml
Set required values in config.yml
#base domain to create addresses for. change to your own domain
BASE_DOMAIN: example.com
#the public-facing address of your mailcow instance
MAILCOW_ENDPOINT: mailcow.example.com
#api key for your mailcow user
MAILCOW_API_KEY: 000000-000000-000000-000000-000000
#the destination mailbox for the alias, since this script works by creating aliases and not full mailboxes
DEST_MAILBOX: [email protected]
- Automatic clearing of aliases older than a given time period
- Check if alias exists before attempting to add
- Ability to delete and edit aliases
- Ability to add a full mailbox