A self-hosted web app for automating Purelymail domain and user setup.
Mailamator eliminates the manual process of setting up mail domains and users on Purelymail. Add a domain, get the exact DNS records you need, push them to Cloudflare with one click, register the domain, and bulk-create users with generated passwords — all from a single interface.
- Guided domain setup — 3-step workflow: get DNS records, set up DNS, register on Purelymail
- Cloudflare integration — Push DNS records directly via the Cloudflare API, or download a BIND zone file
- Bulk user creation — Create multiple mail users at once with auto-generated 24-character passwords
- Credential history — Searchable log of all created domains and users with stored credentials
- Multiple accounts — Manage multiple Purelymail accounts from one interface
- Encrypted storage — API keys and passwords are encrypted at rest with Fernet
- Dark/light mode — Automatic theme detection with manual toggle
- Self-hosted — Single Docker container, SQLite database, no external dependencies
git clone https://github.com/kgNatx/mailamator.git
cd mailamator
echo "MAILAMATOR_SECRET=$(openssl rand -hex 32)" > .env
docker compose up -dOpen http://localhost:8080 and add your Purelymail account to get started.
Go to Settings and add your Purelymail API key. Optionally add a Cloudflare API token for automatic DNS record creation.
On the Domains tab, enter your domain name and click Get DNS Records. Mailamator fetches your Purelymail ownership code and generates all 7 required DNS records (MX, SPF, DKIM, DMARC, ownership TXT, and routing records).
You can then:
- Download a zone file to import into any DNS provider
- Push to Cloudflare to create all records automatically (requires a Cloudflare token and your domain using Cloudflare nameservers)
Once DNS records are in place, click Register on Purelymail to complete the domain setup.
On the Users tab, select a domain, enter usernames (one per line), and click Create Users. Each user gets a secure 24-character generated password. Credentials are displayed once and saved to the searchable history.
Create a .env file in the project root:
MAILAMATOR_SECRET=your-secret-key-here
MAILAMATOR_PORT=8080| Variable | Description | Default |
|---|---|---|
MAILAMATOR_SECRET |
Encryption key for stored API keys and passwords | Required |
MAILAMATOR_PORT |
Port to expose the web UI | 8080 |
MAILAMATOR_DB |
Path to SQLite database file (inside container) | /data/mailamator.db |
- Log in to Purelymail
- Go to Account Settings
- Click Refresh API Key
- Copy the key and add it in Mailamator's Settings page
To use the "Push to Cloudflare" feature, your domain must already be using Cloudflare's nameservers. Then:
- Go to Cloudflare API Tokens
- Create a token with Zone:DNS:Edit permission for your domains
- Add the token alongside your Purelymail account in Mailamator's Settings page
A Traefik override file is included:
docker compose -f docker-compose.yml -f docker-compose.traefik.yml up -dEdit docker-compose.traefik.yml to set your domain. For other reverse proxies (Nginx, Caddy), proxy to port 8080 on the container.
- Python 3.12+
pip install -r requirements.txt
MAILAMATOR_SECRET=dev-secret MAILAMATOR_DB=./dev.db flask --app app.main run --debugpip install pytest
pytest tests/ -vAll external API calls are mocked — no real API keys needed to run tests.