Why Synapse and MAS need email configured separately
Synapse and Matrix Authentication Service each send their own email, so each must be configured separately. If you are deploying a Matrix homeserver for an organization, password resets and address verification will not work until both components have their own working mail settings. Enabling the Synapse mail settings does not configure MAS, and the reverse is also true. Treat mail as a two-part task in your deployment plan, not as a single setting you turn on once.
Synapse uses email for the account flows it handles itself, such as password reset and verifying a user's email address for notifications. MAS takes over the account lifecycle in a MAS-linked deployment, so the flows it owns, including account-related emails it sends, depend on its own mail configuration. Confirm in the current MAS and Synapse configuration documentation exactly which flows each one sends, because the split depends on your version and whether MAS is in front of Synapse. Write that list down before you test anything, so you know which messages your users should expect to receive.
The timing matters. Registration and recovery are the moments when users first depend on email, and if either service cannot send mail when registration opens, users will be stuck with unverified accounts or unrecoverable passwords. Before ESS registration is enabled, send a test message from each component to a mailbox you control, check the delivery and the links inside, and confirm that the sending addresses and domain match what your mail administrators have approved. Ask your mail team which relay will carry this traffic and who owns its sending policy, since a mismatch here is a common cause of messages that never arrive.
How mail flows between users, Synapse, MAS and your SMTP relay
The diagram starts with a user who requests a password reset or an address verification in a Matrix client. Synapse sends reset and notification mail for password-based accounts, while MAS sends the mail for its own account flows once it handles login. Both hand the message to your SMTP relay, and the relay delivers it to the mailbox. The trust boundary sits between the homeserver network and the outbound relay, so confirm which service owns each mail type and that the relay accepts connections only from those hosts.
Which component sends each mail type, and where the trust boundary sits.
Which mail settings belong to Synapse and which to MAS
Synapse sends email for the flows it still handles itself, such as password resets, address verification and notifications. Its outbound mail is configured in the homeserver configuration file, in an email section that names the SMTP host, port, transport security and sender address. Before you rely on any of this, confirm the exact key names and their defaults against the Synapse configuration manual for the release you run, because keys have changed across versions.
- SMTP relay details: Host, port, TLS or STARTTLS mode, and credentials for the relay your organization approves.
- Sender identity: The notification address and display name that users see and that your mail filters must accept.
- Flows that use mail: Confirm which account and notification features are enabled on your server, since each one depends on mail being configured.
- Secrets handling: Store SMTP passwords in a file or secret store that the configuration reads at start, not in version control.
- Test path: Send a real password reset and a notification to a test mailbox from the production host, not from a laptop.
Check that the Synapse email section matches your relay and that a test message arrives with valid sender authentication.
Matrix Authentication Service handles login, registration and account management through an upstream OpenID Connect provider, so it takes over several account flows from Synapse. Mail for those flows is configured in the MAS configuration file, not in Synapse. If you enable MAS, an email setup in Synapse alone will not cover verification or recovery steps that MAS now performs, so you need a separate mail block in MAS. Confirm the section and key names in the MAS documentation for your version.
- Separate file and process: MAS reads its own configuration, so changes in the Synapse file do not reach MAS.
- Account flows that move: Confirm which email-based steps your MAS version performs, such as registration confirmation or recovery, against its documentation.
- Upstream identity provider: Where the identity provider sends its own mail, document which system owns each message.
- Sender and domain alignment: Use a sender address on your domain that your SPF, DKIM and DMARC records already cover.
- Registration gate: Users cannot complete registration through ESS until MAS mail works, so test that path end to end.
Check the MAS mail block separately, then send a test through each account flow MAS handles.
The two configurations can drift apart after an upgrade, a relay change or a credential rotation. Because each component has its own file and its own restart, a successful Synapse test says nothing about MAS, and the reverse is also true. Treat the pair as one change with two checklists. Record which sender address, relay and credential each component uses, so that an audit or an incident review can trace every outbound message.
- Single source of truth: Keep a shared document that lists the relay host, sender address and secret location for both components.
- Coordinated changes: Update both files in the same change window and restart each component afterward.
- Credential rotation: Rotate the SMTP credential in both places, then confirm both still send.
- Version checks: Re-read the configuration manual and MAS documentation after each upgrade, since key names can change.
- Log review: Watch both logs for delivery errors after changes, because a failure in one component may be silent to users.
Check that both documents name the same relay and sender before going live.
Verification proves that each component sends mail on its own path. A test that only confirms the process started does not show that the relay accepts the messages or that they reach an inbox. Plan tests for each flow that sends email, and record the results for your operations team. Use a mailbox you control on the same domain users will see, and check headers as well as the message body.
- Per-flow tests: Trigger each mail-producing action in Synapse and in MAS and note the outcome.
- Header checks: Confirm the sender, return path and authentication results match your published records.
- Relay logs: Ask the relay operator or your mail team for the accept and reject records for the test messages.
- Spam placement: Check the junk folder in at least one common mailbox provider before you announce registration.
- Failure handling: Decide who receives alerts when mail fails, and how users are told to retry.
Check that each flow has a passing test and a recorded result before users depend on it.
Email options for Synapse and MAS and when each fits
This table compares the four mail paths an operator can choose for Synapse password resets, verification and notifications, and the mail settings MAS needs before registration works. Read each row against your own mail team's constraints, then confirm the sending domain, TLS and rate limits before you commit to a path.
| Option | When it fits | What it needs from the mail team | What to confirm in your environment |
|---|---|---|---|
| Organization SMTP relay with authentication | Your organization already runs an internal mail relay that can send to external addresses for a named service account | A dedicated sending account, an allowed sender address, and a decision on which host and port Synapse and MAS may use | Whether the relay accepts submissions from the homeserver network, the required TLS mode, and any per-account sending limits |
| Managed transactional mail service | You have no internal relay suited to automated messages, or you want bounce and delivery reporting outside your mail system | A verified sending domain, DNS records for signing and return paths, and an API or SMTP credential stored as a secret | Who owns the sending domain, the provider's data location terms, and the plan's rate limits and retention of message logs |
| Relay inside an isolated network | The homeserver has no internet route, so mail must go to an internal host that hands off to a controlled gateway | A reachable internal relay address, an allow rule for the Matrix hosts, and a documented path for any outbound delivery | Whether the internal relay can reach external recipients at all, and how bounces and failed deliveries are reported back to operators |
| Disable email-based flows | Users sign in only through single sign-on, or your policy forbids email-based password reset and notifications | Agreement that password resets and email verification are handled by the identity provider, and that MAS registration by email is turned off | Whether the upstream identity provider covers all account recovery paths, and whether notifications your policy requires have another channel |
Configuring SMTP in Synapse and MAS step by step
This sequence takes a Matrix deployment from a confirmed sending domain to working password reset and verification emails, with a check at each step so mail problems surface before users hit them.
Confirm the sending domain and DNS records
Agree with the mail team which domain and address Synapse and MAS will send from, such as a no-reply address on your primary domain. Confirm the SPF, DKIM and DMARC records that the mail provider or relay requires, and confirm that the public hostname used for links resolves to the Element Web or MAS address your users will open. Write the sender address, the relay host and the link hostname into a shared change record. Done when the mail team confirms the records are published and the link hostname resolves from outside your network.
Create the mail account or relay credentials
Ask the mail team to create a dedicated sending account or relay credential for the homeserver, limited to sending from the agreed address. Store the username and password in your secrets store, not in a plain configuration file in version control. Confirm the port, TLS mode and authentication method the relay expects. Check that you can authenticate to the relay from the host that will run Synapse, using a test client or the relay's own diagnostic tool, before you touch Synapse configuration.
Set the Synapse email block
Add the email section to the Synapse configuration file, setting the SMTP host, port, TLS options, credentials, the sender address and the notification and password reset options you need. Synapse reads these settings from its configuration file, so the credentials should come from a file or secret mounted at runtime where your deployment method supports it. Validate the YAML syntax and confirm the sender address matches the one agreed in step one. Done when the file parses and the configuration check passes on restart.
Configure MAS mail settings
Because ESS and MAS handle account registration and recovery flows, set the mail configuration in the MAS configuration file as well, using the same relay and sender address. MAS sends its own verification and recovery messages, so Synapse email settings alone do not cover every flow. Confirm the public URL MAS uses for generated links matches the hostname your users reach. Done when MAS starts with the mail section loaded and its logs show no configuration errors for the mail transport.
Restart services and check the logs
Restart Synapse and MAS in the order your deployment expects, then read the startup logs for both services. Look for transport errors, authentication failures, TLS handshake problems or unreadable credential files. Confirm the sender address reported in startup or debug output matches the agreed address. Done when both services report a clean start and no mail transport errors appear during the first minutes of operation.
Send a test password reset
From a test account, request a password reset through the client or the MAS recovery page. Confirm the message arrives in a mailbox outside your network, with the sender address you configured. Open the reset link and check that its hostname is the public name of your MAS or Element deployment, not an internal name or localhost. If the message does not arrive, check the Synapse and MAS logs for the relay response and the mail provider's bounce or rejection records. Done when the link opens the correct page.
Send a test verification and notification email
Trigger an email verification flow on a second test account and confirm the message arrives and the verification link points at the correct public hostname. If you have enabled notification emails in Synapse, generate one with a test event and confirm delivery. Record the message headers, sender, and delivery status in your change record. Done when the verification and notification messages arrive, the links are correct, and the logs show successful delivery with no unresolved errors. Confirm with the mail team that the sending domain shows passing SPF and DKIM results for these messages.
Securing the mail path and protecting account recovery
Password resets, verification emails and notifications all pass through your mail path, so a weak relay setup can expose credentials or let someone else claim an account. The cards below cover the controls you own on the Synapse and MAS side and the checks to confirm with your mail provider before users rely on email for recovery.
Store SMTP credentials safely
The SMTP username and password sit in the Synapse and MAS configuration files, so anyone who can read those files can send mail as your domain. Keep the values out of version control, load them from a secrets store or a root-owned file with restricted permissions, and use a dedicated sending account rather than a personal mailbox. Ask your provider whether the account can be scoped to sending only and how credentials are rotated.
Require TLS to the relay
Credentials and message content are exposed if the connection to the relay is not encrypted. Confirm the SMTP port and TLS mode your provider requires, enable STARTTLS or implicit TLS as that provider specifies, and verify that the server certificate is validated rather than skipped. Test the connection from the same host and network that Synapse uses, because egress rules often differ between containers and the host.
Publish SPF for the sending domain
An SPF record tells receiving servers which hosts may send mail for your domain. Without one, reset emails for your users are easier to forge and more likely to be filtered as spam. List the relay your provider gives you and nothing broader, and confirm with the provider that the record matches the IP addresses or includes they use for outbound traffic.
Align DKIM and DMARC with the From address
DKIM signs messages and DMARC requires the signed domain to align with the visible From address. Set the From address in the Synapse or MAS email settings to a domain you control and that your provider can sign for, then publish the DKIM key and a DMARC policy. Start DMARC in monitoring mode, review reports, and tighten the policy only after legitimate Matrix mail passes.
Protect reset links from takeover
A password reset or verification link is a bearer credential for the account. Anyone who reads a mailbox or intercepts a forwarded message can complete the flow. Keep link lifetimes short, make sure the public base URL in the configuration points only to your own domain, and make sure users know that reset mail should never be forwarded. Decide with your security team whether email is the only recovery path for accounts that hold encrypted history.
Limit addresses in logs
Mail logs and application logs can record recipient addresses, subjects and delivery results, which is personal data. Decide what your logging pipeline keeps and for how long, confirm that debug logging of mail content is off, and ask your provider what it stores on its side, including message retention and access by its staff. Document the answers so your data protection team can review them.
Why MAS mail must work before ESS opens registration
Registration on an ESS deployment is only as reliable as the mail path behind it. When open registration is enabled, new users typically confirm their email address before they can finish setting up an account, and existing users depend on email to reset a forgotten password. Matrix Authentication Service handles these account flows for ESS, so its mail settings are separate from the Synapse email block that many teams configure first. A homeserver that sends test notifications correctly can still leave new users stuck at the verification step if MAS cannot deliver its own messages. Treat mail as a launch dependency, not a later tidy-up, and do not send invitations until the full registration path has been exercised end to end.
In the test environment, confirm that a brand-new account can register, receive the verification message, complete it, and sign in from Element Web and a mobile client. Then test the recovery path: request a password reset for a test user, follow the link, set a new password, and confirm that older sessions behave as your policy expects. Check that messages arrive at more than one mailbox provider you expect your users to have, that sender addresses and reply-to values are the ones your mail team has approved, and that links in the messages point to the public hostnames your users will actually open. Record which mail server, relay or transactional provider sends each message so a support engineer can trace a failure later.
Limits to confirm in your environment before go-live
Email settings look finished once a test message arrives, but the limits that break password resets usually sit outside Synapse and MAS. The cards below list what to confirm with your mail provider, network team and security reviewers before users depend on reset and verification mail.
Mail flows each version sends
Before go-live, confirm which messages the Synapse and MAS versions you installed actually send. Password reset, address verification and notification mail come from different settings and may change between releases, so check the upgrade notes for the exact version rather than assuming a flow exists. Test each flow you plan to offer, including the one for a new registration, and record which templates reach a real inbox. A flow that is not configured will fail silently for users, so the test list should match the features you have enabled.
Synapse upgrade notesRelay acceptance of the sender address
Many relays accept mail only from a sender address on a domain the account owns, and some reject messages whose envelope sender does not match the authenticated account. Ask the mail provider which From address, return path and authentication method it requires, and confirm that the address configured for Synapse and MAS meets those rules. Mismatches often look like successful sends in logs while the relay drops or quarantines the message. Ask the provider for its rejection and bounce reporting so you can see these failures.
Outbound port and firewall rules
Confirm the SMTP port your relay uses and whether the Synapse and MAS hosts can reach it through the firewall, security groups and any egress proxy. Container networks, Kubernetes network policies and host firewalls frequently block outbound SMTP by default, and the failure shows up only when a user requests a reset. Ask the network team to test the connection from the same network namespace that runs each service, not from an administrator workstation.
Provider rate limits and quotas
Mail providers apply sending limits per account, per domain and per time window, and these limits are set by the provider, not by Synapse or MAS. Ask for the limits that apply to your account, what happens when you exceed them, and whether transactional mail has a separate pool from marketing mail. Registration waves, bulk verification and repeated reset requests all draw on the same quota, so plan how many messages a busy launch day could generate and confirm the provider can absorb them.
Air-gapped and isolated network constraints
If the deployment runs in an isolated network, a standard public relay may be unreachable or prohibited. Confirm whether your security policy allows any outbound mail path, and if it does, whether it must be an internal relay that forwards to external recipients. In a fully air-gapped setup, mail may not leave the network at all, so decide early whether users can rely on email for recovery or whether another verification method is needed. Record that decision in the design document before configuration starts.
Element Server SuiteEmail setup questions buyers ask before hiring help
How much effort does SMTP setup for Synapse usually take?
The effort depends less on Synapse than on the mail platform and DNS the organization already runs. Synapse needs an SMTP relay, a sending address, credentials, and a TLS mode that matches the relay, and the configuration itself is short. The longer work is proving that verification and reset emails actually arrive, which means testing with several mailbox providers, checking spam placement, and confirming that links point at the right public hostname. Teams with an existing relay and clear DNS ownership usually move quickly. Teams that must create a sending domain, wait on approvals, or build a relay from scratch should plan for more time. Ask any partner to break the work into relay setup, DNS records, Synapse and MAS configuration, and deliverability testing.
Can our team set up email for Synapse and MAS without outside help?
Yes, a team with Linux administration and Matrix experience can complete the work alone, and the official documentation covers the settings. The risk sits in the parts that cross team boundaries. Synapse sends email through its own email block, while MAS needs its own mail settings before ESS lets users register, so a change in one place can leave the other sending nothing. Teams new to Matrix often miss the second configuration, the sender address policy, or the test of a full registration and reset flow. Outside help is most useful for a fixed-scope review of both services, a written test plan, and a checklist the internal team can rerun after upgrades.
What do we need from our mail and DNS owners?
Before any configuration starts, the team needs decisions and records from the people who own mail and DNS. The usual list covers:
- A sending address and display name that the organization accepts for system email
- SMTP host, port, authentication method and TLS mode from the relay owner
- Permission to publish SPF, DKIM and DMARC records for the sending domain
- A rule for bounce handling and who receives postmaster mail
- Approval for a DNS change window, since records can take time to propagate
Without these, configuration usually stalls at credentials or deliverability. Confirm the exact record requirements with your mail provider, because they change with provider policies.
How does the cost of SMTP setup change with the mail provider and scope?
Most of the cost is labor, and the provider affects how much labor is needed. A managed transactional mail service with an existing account usually needs only credentials and DNS records. An internal relay run by your mail team may need firewall rules, relay permissions and allowlisting for the Matrix hosts. A new relay or a hosted mail platform adds procurement and ongoing service fees, which recur. Scope also matters: testing only verification email costs less than covering password resets, notifications, MAS sign-in emails, and a documented rollback. Ask for a quote that lists each provider dependency, one-time configuration work, recurring mail service costs (paid to the provider, not to DeployOpen), and what testing is included.
Do we still need SMTP if our users sign in only through SAML?
Yes in most deployments, because email still carries account events even when sign-in is handled elsewhere. Synapse supports SAML2 and OpenID Connect through its configuration, but MAS does not support SAML directly and recommends a bridge such as Dex for SAML or LDAP. In a SAML-only setup, the identity provider usually owns passwords, so password reset email is not needed for those users. Notifications, device or session alerts, and any email-based flows that remain enabled still depend on SMTP. Confirm with the identity owner which flows will stay enabled before deciding to skip mail configuration.
What changes if we disable email entirely on Synapse and MAS?
Disabling email removes password reset by email and any verification step that relies on a mailed link, so account recovery must move to another path. Administrators then need a documented process for resetting or re-verifying users, usually through an identity provider or an admin workflow. Registration controls must also be reviewed, because an open registration flow without email verification changes the abuse profile of the server. Turning email off is a policy decision with user support and security effects, and it should be tested for every flow that still appears in the client. Ask for a written list of affected flows before the change.
What should we test before letting users register on ESS?
Test the full path a new user takes, not only whether a message leaves the server. Send a verification email to at least three mailbox providers your users employ, check the sender, links and headers, and confirm that the link opens the correct hostname. Run a password reset, confirm that a failed relay login appears in the logs without exposing credentials, and verify that a rejected address produces a clear error. Repeat the checks after any DNS or relay change. A partner can write these steps into a fixed test plan, and your team can rerun them after upgrades.
How DeployOpen scopes email work on a Matrix server
Email work on a Matrix server is agreed as a fixed-scope engagement, with the scope, deliverables and exclusions written down before any configuration changes are made. The client supplies the inputs that decide the design: the server name and the public hostnames for Synapse and Matrix Authentication Service (MAS), the SMTP relay the organization already operates with its sending domain, the sender address and reply-to policy, the TLS mode the relay requires, and the list of notification types the business wants enabled. The client also confirms whether Synapse and MAS are already running, which PostgreSQL instances hold their databases, and who owns the mail account and its credentials. Before work starts, DeployOpen and the client agree on who can read the SMTP secret, where it is stored, and how the Synapse and MAS configuration files receive it. Those decisions go in the statement of work, not in a chat thread.
The deliverables are a tested configuration for each service, covering the Synapse email settings for password resets, verification and notifications, and the separate mail settings MAS needs before users can register. DeployOpen also delivers a runbook that covers test messages, delivery checks, log locations, credential rotation and the steps for changing the relay. Excluded unless the written scope adds them: mailbox provisioning, DNS and SPF, DKIM and DMARC record publication at the client's DNS host, changes to the upstream identity provider, deliverability tuning for a third-party relay, and any compliance evidence about how mail is handled. Those items depend on systems and teams outside the Matrix deployment, so the client should confirm who owns each one. Timelines and fees follow from this written scope and are quoted separately.
How DeployOpen delivers Matrix email configuration
DeployOpen plans and configures outbound email for Synapse and Matrix Authentication Service inside your own infrastructure, so password resets, verification and notifications work before users register. The work is fixed-scope, with deliverables and timelines agreed in writing before configuration starts.
How we scope
- Confirm which mail flows you need: password resets, email verification, notifications and MAS account emails.
- Record the SMTP relay, sending domain, TLS mode and authentication method your mail team approves.
- Agree in writing which secrets, sender addresses and test accounts are in scope and who owns them.
How we build
- Configure the Synapse email settings and the separate MAS mail settings, then check that each service reads its own block.
- Test delivery to internal and external mailboxes, including spam filtering results and bounce handling.
- Keep SMTP credentials out of plain configuration files and document where each secret is stored.
How we hand over
- Deliver the written configuration record, a test log and a runbook for changing relays or rotating credentials.
- Walk your operators through the registration and password reset flows so they can reproduce each test.
- List the settings you must confirm with your mail provider, such as sender reputation and allowed sending hosts.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Retesting after Synapse or MAS upgrades can confirm that mail still sends with the updated configuration.
- Support requests can cover relay changes, deliverability problems and new notification types.

