Set up SMTP for self-hosted Appwrite
Self-hosted Appwrite sends email verification, magic URL logins, password recovery and team invites with the `_APP_SMTP_*` variables in the `.env` file of your install. `_APP_SMTP_SECURE` must be set: left empty, Appwrite connects without TLS and never tries STARTTLS, and Unitpost refuses to log in on an unencrypted connection.
Create a send-only key
In Unitpost, open Settings → SMTP and create a send-only key.
_APP_SYSTEM_EMAIL_ADDRESSdefaults toteam@appwrite.io; change it to an address on a verified domain.Set the SMTP variables
In Appwrite,
tlsmeans STARTTLS (port 587) andsslmeans implicit TLS (port 465).Env_APP_SMTP_HOST=smtp.unitpost.com _APP_SMTP_PORT=587 _APP_SMTP_SECURE=tls _APP_SMTP_USERNAME=unitpost _APP_SMTP_PASSWORD=pk_live_... _APP_SYSTEM_EMAIL_ADDRESS=no-reply@yourdomain.comFor port 465, use
_APP_SMTP_PORT=465and_APP_SMTP_SECURE=ssl.Apply the changes
Recreate the containers, then confirm the values loaded. If they didn't, run
docker compose up -d --build --force-recreate.Shelldocker compose up -d docker compose exec appwrite varsSend a test
Sign out of the Console and request a password recovery, or invite someone to a team. Follow the mail worker with
docker compose logs -f appwrite-worker(appwrite-worker-mailsif you run workers separately), and look for the send in Unitpost Emails.If it fails
538in the worker log means_APP_SMTP_SECUREis empty, so the login went out before TLS.550 5.7.1means_APP_SYSTEM_EMAIL_ADDRESSis stillteam@appwrite.ioor another unverified domain.