Send mail¶
This page is for the sysop. It shows how to let the instance send mail: sign-in links, address confirmations and the watch digest. At the end a test mail has reached your inbox.
Before you start¶
- A sender address on a domain you control, for example
noreply@aprs.example.net. - One way to send from it: an SMTP server (your own, or a hosted mailbox) or a Resend account.
- A shell on the gateway host, and the instance's
OPERATOR_SECRETfor the test.
Choose the transport¶
The gateway picks one transport, by this rule:
SMTP_HOSTset: mail goes out over that SMTP server.- Else
EMAIL_API_KEYset: mail goes out over the Resend API. - Else no mail. Members sign in with passkeys, or with a one-time link you mint.
EMAIL_FROM is the sender for both transports. Without it the instance sends no mail.
Steps¶
-
Run the wizard and answer the mail question, or set the keys in
deploy/.envyourself:For a hosted mailbox the settings are typically port 587, STARTTLS, and the full address as the login:
EMAIL_FROM='APRScaching <noreply@aprs.example.net>' SMTP_HOST=mail.example.net SMTP_PORT=587 SMTP_SECURE=starttls SMTP_USER=noreply@aprs.example.net SMTP_PASS='the mailbox password'Port 465 takes
SMTP_SECURE=tls; it is the default there.nonesends in the clear: use it only for a relay on the same box or a trusted LAN. For Resend, setEMAIL_FROMandEMAIL_API_KEYinstead, and leaveSMTP_HOSTunset. Without the wizard,./setup.sh --non-interactive --mail smtp …takes the same answers as flags (CLI). -
Publish SPF, DKIM and DMARC records for the sender's domain that name the server you send through. Your mail provider lists the records to add. Without them, receiving servers file the mail as spam or refuse it.
- Restart the gateway so it reads the new settings:
docker compose up -dindeploy/.
Send a test mail¶
docker compose exec gateway node tools/admin/mail-test.mjs you@example.net # Docker stack, from deploy/
BASE=http://127.0.0.1:8787 OPERATOR_SECRET=… node tools/admin/mail-test.mjs you@example.net # from a checkout
The tool asks the gateway to send one mail over its transport. It prints the transport on success. On a
refusal it prints the server's reason, such as EAUTH 535 authentication failed for a wrong password or
ETIMEDOUT for a server that does not answer. The gateway gives up on a silent server after 10 seconds, so a
dead mail server never holds a sign-in for long.
Check that it worked¶
- The test mail is in your inbox, not in the spam folder.
deploy/aprscaching doctornames the transport undermail.transport, andmail.smtppasses when the SMTP server answers (Troubleshooting).- Instance admin → Setup shows Email delivery as met, with the transport.
/privacynames the mail server's host as a recipient of members' addresses (A public instance's duties).
Next¶
- One-time sign-in links: the way in when the instance sends no mail.
- Secrets and credentials: where
SMTP_PASSlives and who must never hold it.