A small Flask service that receives contact-form submissions, emails them to the configured recipient, and optionally sends a Telegram notification.
Copy .env.example to .env and fill in the values:
cp .env.example .envRequired: MAIL_SERVER, MAIL_USERNAME, MAIL_PASSWORD, MAIL_DEFAULT_SENDER,
DOMAIN_EMAIL_MAP, and CORS_ORIGINS. Telegram variables are optional.
DOMAIN_EMAIL_MAP is a JSON object mapping a domain (matched against the request
Referer header) to the recipient address(es):
{"yourdomain.com": ["you@yourdomain.com"]}docker compose up -d --buildThe container runs under gunicorn as a non-root user, exposes port 8004, and
ships a /health endpoint used by the Docker healthcheck.
POST /submit— JSON body with arbitrary form fields; every field is included in the notification email.email(if present) is used as Reply-To andnamein the subject. The requestReferermust match a configured domain. Returns200on success,400for invalid input,403for an unauthorized domain. See docs/SUBMITTING.md for the full contract.GET /health— liveness probe, returns{"status": "ok"}.
pip install -r requirements.txt
python main.py # dev server on 127.0.0.1:8004