This page is for operators who connect Adiutor to a mail server. It covers where the mail server is set, the sender address, TLS, the connections Adiutor keeps open and what happens when there is no mail server.
Adiutor sends sign-in links and codes, password resets, invitations and reminders, security notices and the emails about requests. See Emails for each one. Sign-in links and codes travel by email, so whoever controls the mail server can read them: choose it with care.
Where the mail server is set
Section titled “Where the mail server is set”There are two places, and the environment wins:
- Settings. A staff Admin sets the mail server on Settings › Integrations, in the Mail server card, and presses Test and save mail server. Adiutor sends a test email through it to the staff Admin who saves it, and only then keeps it. The card is described in Mail server.
- The environment.
SMTP_URLsets the mail server andEMAIL_FROMthe sender. WhenSMTP_URLis set, Settings only shows the mail server, without its password. WhenEMAIL_FROMis set, it wins over the sender saved in Settings, even with the mail server saved there.
Why you might set SMTP_URL yourself: a mail server saved in Settings lets staff Admins choose where every email goes, sign-in links included, and makes the server connect to any address it can reach. If you don’t want your staff Admins to have that power, set SMTP_URL in the environment.
Saving a mail server in Settings is protected: it needs the staff Admin’s second step from the last 15 minutes, it is in the audit log, and every staff Admin is told by email. That email goes out straight away through the mail server that was in use before the change, which the new one can’t hold back. When there was none, or the old one fails, it goes through the new one. The password is encrypted with the auth secret (see Secrets and incidents), is never shown again, and is kept only for the server it was saved for: another host, port or username has to be given it again.
The sender
Section titled “The sender”Set the sender to an address on a domain you control, such as Adiutor <[email protected]>, in EMAIL_FROM or in the Sender name and Sender address fields in Settings.
Without one, emails come from an address on adiutor.dev. That isn’t yours, and mail providers that check who a sender is reject it. Ask your mail provider how to authorise your domain (SPF and DKIM records are the usual way) so that the emails reach inboxes. A DMARC record then tells the receiving servers what to do with an email that fails those checks.
To see whether they pass, send yourself an email from Adiutor, such as a sign-in link, and look at its headers: Authentication-Results should say spf=pass, dkim=pass and dmarc=pass.
Use TLS
Section titled “Use TLS”Emails carry sign-in links, so the connection must be encrypted. Use one of:
- TLS from the start, usually on port 465:
smtps://user:[email protected]:465 - STARTTLS that has to succeed, usually on port 587:
smtp://user:[email protected]:587?requireTLS=true
In Settings, choose TLS or STARTTLS under Security.
Without either, the connection only uses STARTTLS when the server offers it, so someone on the network could strip it and read the links. In production, Adiutor refuses a mail server without TLS, both in Settings and in SMTP_URL, unless the mail server is on this computer (localhost, 127.0.0.1, [::1] or a .localhost name). A Docker Compose service name such as mail is not this computer.
Connections
Section titled “Connections”Adiutor keeps up to 3 connections to the mail server open and reuses them, so inviting many people at once doesn’t connect and sign in once per email. Settings in the URL win: add ?maxConnections=1 for a provider that allows only one connection, or ?pool=false to connect for every email.
When no mail server is set
Section titled “When no mail server is set”Without a mail server, in the environment or in Settings, every email fails: nobody gets sign-in links, password resets or invitations. A production server still starts, and logs this warning when it does:
No mail server is set up (SMTP_URL, or the Integrations tab of Settings), so Adiutor can't send email: sign-in links, password resets, invitations and security notices fail until one is. See https://docs.adiutor.dev/self-hosting/email/Emails that were queued are tried again, and the ones that keep failing show up on Logs › Jobs (see Logs and errors).
Set the mail server right after setting Adiutor up. Never set EMAIL_OUTBOX_DIR: it is only for tests.
Example
Section titled “Example”Adiutor runs at https://adiutor.dev and the mail provider’s server is smtp.adiutor.dev. In .env:
SMTP_URL=smtps://no-reply%40adiutor.dev:<password>@smtp.adiutor.dev:465EMAIL_FROM=Adiutor <[email protected]>Restart Adiutor and whatever runs the jobs, which send the queued emails (with Docker Compose, docker compose up -d; docker compose restart keeps the old settings). Then invite someone: the invitation goes through smtp.adiutor.dev.
Good to know
Section titled “Good to know”- The mail server in Settings is tried before it is saved, and the error says what went wrong (couldn’t connect, didn’t answer in time, couldn’t secure the connection, refused the login, the address or the email), never the server’s own reply.
- Changing the auth secret doesn’t lose the saved password: see Secrets and incidents.
Related
Section titled “Related”- Mail server in Settings
- Emails
- Environment variables
- Background jobs
Adiutor's code is released under the MIT License. The Adiutor name and logo aren’t covered by it; see the notice.
Set in Inter and JetBrains Mono, under the SIL Open Font License (Inter, JetBrains Mono).