DatMail is the SMTP mailing-list forwarder for @fredagscafeen.dk.
The current master branch is a hybrid SMTP + HTTP + object-storage system:
- Postfix receives inbound mail and relays outbound mail.
- DatMail applies mailing-list policy, spam checks, header rewriting, and resend handling.
- Mailing-list membership and spam-filter rules come from a Django API.
- Raw inbound
.emlfiles are archived to S3-compatible storage. - Processed and dropped mail is reported back to the Django backend.
| Location | Purpose |
|---|---|
| GitHub wiki | Published developer docs, architecture, message flows, and API reference |
| Architecture | Docs for architecture, flows, and code map |
| Message Flows | Docs for message flows |
| API Reference | Docs for API reference |
Recommended reading order:
The wiki is a separate Git repository:
git clone git@github.com:fredagscafeen/mail.wiki.git
cd mail.wiki
git pull --rebase origin masterAfter editing the wiki pages:
git add .
git commit -m "docs: update wiki"
git push origin masterIf the push is rejected, rebase on the latest wiki changes and push again:
git pull --rebase origin master
git push origin mastercp datmail/config.local.py datmail/config.py
docker-compose up --buildDatMail listens on port 9000 and relays outbound mail to host.docker.internal:25.
The resend control endpoint listens on port 9001 inside the container by default.
Useful commands:
docker-compose up -d --build
docker-compose logs -f app
docker-compose downPython 3.8.10 is the expected runtime version.
python3 -m venv ~/.cache/venvs/fredagscafeen-mail
source ~/.cache/venvs/fredagscafeen-mail/bin/activate
pip install pip-tools
pip-sync requirements.txt dev-requirements.txt
pre-commit installThen start DatMail with:
python3 -m datmailCreate datmail/config.py from the checked-in sample:
cp datmail/config.local.py datmail/config.pyAt minimum, configure:
SRS_SECRETS3_ENDPOINT_URL,S3_ACCESS_KEY_ID,S3_SECRET_ACCESS_KEYDATMAIL_CONTROL_HOST,DATMAIL_CONTROL_PORT,DATMAIL_CONTROL_TOKEN- the Django API base URL and token used by
datmail/django_api_client.py
For the detailed API contracts and payload shapes, use the GitHub wiki API Reference.
The legacy monitoring job is still used for local error digests:
python3 -m datmail.monitorIt reads error/, emails an admin digest when the threshold is reached, and archives handled reports into errorarchive/.