Mattermost SMTP email setup

Mattermost sends notifications and password reset emails through an SMTP server you configure. This page covers the choices, the DNS records and the container networking that decide whether those emails arrive.

On this page

Mattermost SMTP email setup for notifications and password resets

Your self-hosted Mattermost sends email for two things users notice quickly: notification emails when they are mentioned or receive direct messages, and password reset links when they cannot sign in. Both depend on the SMTP settings in the server configuration. Until those settings point at a working mail service and the sending domain is set up to be trusted, users may see no notifications, get no reset links, or find those messages in spam. Mattermost runs as a single Linux binary with PostgreSQL as its database, so the mail setup lives in the server configuration and in your mail infrastructure, not in a separate mail component that ships with the product.

Plan this work before go-live, when you move to a new mail provider, or when notification or reset emails start landing in spam. Before go-live, test a password reset and a mention notification from a real user account, not only a send test from the console. After a provider change, the old credentials, sending addresses and relay hosts all need review. For spam problems, confirm with your mail administrator which sending domain and address Mattermost uses, then check that SPF and DKIM records exist for that domain and match the sending service. The exact configuration keys, the options each SMTP service supports and the steps for Amazon SES or a local relay are in the Mattermost configuration documentation for your release, so confirm them against the version you run before you change production settings.

Which SMTP option fits your mail setup

This table compares three ways to send Mattermost email: a standards-based SMTP service, Amazon SES, and a local relay inside your network. Read each row against who will operate the mail path and what the Mattermost admin must supply, then match the option to your existing mail governance. The main takeaway is that the mail path decides who owns deliverability, sender records and TLS, so confirm exact setting names and TLS options against the current Mattermost configuration reference before you commit.

Decision pointStandards-based SMTP serviceAmazon SESLocal relay inside your network
Who operates itThe email provider, with your team managing credentials and the sending domainAWS, with your team managing the SES identity, sending limits and credentialsYour mail team, who run the relay host and its upstream routing
Host and portProvider SMTP host and submission port supplied by the providerRegional SES SMTP endpoint and port from your AWS accountInternal relay hostname and port agreed with the mail team
AuthenticationUsername and password or API key issued by the providerSES SMTP credentials generated for an IAM user, not your console loginOften none, if the relay accepts mail from approved Mattermost hosts only
TLS modeConfirm the supported STARTTLS or implicit TLS option in the Mattermost configuration referenceConfirm the TLS option the SES endpoint requires for your region and portOften plain or internal TLS; confirm with the relay team what is allowed inside your network
Sending addressA sender on a domain you control, verified with the providerA verified identity (domain or address) in the SES accountAn address the relay is permitted to forward for your domain
Sender records (SPF and DKIM)Provider gives records to publish for your domainSES gives DKIM records to publish for your domainDepends on the upstream path; the relay usually needs its own records
Best fitTeams that already have a transactional email provider and want vendor supportTeams already running workloads in AWS and comfortable managing SES identitiesOrganizations that keep all mail inside the network and have a mail team to run it

How to configure Mattermost email step by step

This sequence takes a self-hosted Mattermost from an unconfigured mail path to a verified setup where notifications and password reset emails arrive and can be traced in the mail server logs.

  1. Choose the sending domain and mailbox

    The platform owner and the email administrator agree on a sending domain and a dedicated sender address, such as a no-reply mailbox on a domain the organization controls. Confirm with the mail team who owns DNS for that domain, because SPF and DKIM records are added there later. Record the SMTP host, port and encryption method your mail provider requires, and confirm whether the provider uses SMTP authentication or relies on network-based relay rules. Done when the team has a written note with the sender address, the SMTP endpoint and the name of the person who can change DNS records.

  2. Create SMTP credentials or SES identities

    If you use a general SMTP service, create a dedicated sending account or application password so Mattermost does not share a personal login. If you use Amazon SES, verify the sending domain or address as an identity in the correct region and confirm whether your account is still in the SES sandbox, which limits recipients to verified addresses. Store the credentials in your secrets manager, not in a shared document. Done when the sending identity shows as verified in the provider console and the credentials can authenticate with a simple SMTP login test from the Mattermost server.

  3. Publish SPF and DKIM for the sending domain

    The DNS owner adds the SPF record that lists your mail provider as an allowed sender and enables DKIM signing with the record values the provider supplies. Check the current SPF record first, since a domain can only have one SPF TXT record and duplicates cause validation failures. Ask the provider which DMARC policy it recommends before you change one. Done when a DNS lookup returns the expected SPF and DKIM records and the provider console reports DKIM as signing outbound mail. Propagation time varies, so confirm with your DNS team rather than assuming it is immediate.

  4. Enter email settings in the System Console

    A System Administrator opens the System Console, goes to the email settings section, and enters the SMTP server, port, connection security, username, password, and the notification and reply-to addresses. Save the change and keep the page open for the next step. If the server is a local relay rather than an external provider, use the relay address and confirm the relay accepts connections from the Mattermost server's address. If you manage configuration as code, make the same change in the configuration file and restart the service so the file and the console do not disagree. Done when the settings save without a validation error and the console shows the values you entered, with the password masked.

  5. Send a test email from Mattermost

    Use the test email function in the email settings to send a message to an administrator mailbox you can read. Note the time the test was sent so you can match it to logs later. If the send fails, read the error shown in the console and the Mattermost server log, then check the host, port, encryption setting and credentials before changing anything else. Done when the test message arrives in the inbox, is not placed in spam, and shows the sender address and a DKIM pass result in the message headers. Record the message headers in your change record for the audit trail.

  6. Confirm a password reset completes

    Using a non-admin test account, request a password reset from the Mattermost login page and open the email you receive. Follow the link, set a new password and sign in with it. Confirm the reset link points to the correct external URL, which depends on the site URL setting being correct. Done when the reset email arrives, the link opens your Mattermost instance over the expected address, and the new password works. If the link points to the wrong host, correct the site URL and repeat this check before handing the system over.

  7. Check the mail server logs

    The mail administrator reviews the SMTP provider or relay logs for the test send and the reset send, using the timestamps you recorded. Look for an accepted status for each message, the recipient domain, and any bounce, deferral or rejection codes. Confirm that the sending address matches the one configured in Mattermost. Done when both messages show as accepted or delivered in the provider logs and no unexpected rejections appear. Keep a short record of the log entries, and tell the reader to confirm with their provider how long those logs are retained.

How a Mattermost email travels from server to inbox

The Mattermost server builds a notification or password reset email and hands it to an SMTP endpoint, which may be a hosted SMTP service, Amazon SES or a local relay on your own network. The relay signs and sends the message across the public internet, and the recipient's mail server checks SPF and DKIM against DNS for the sending domain before accepting it. Check each hand-off: the relay's credentials and network path from the Mattermost network, and the DNS records for the domain that the relay signs with.

Email hand-offs from the Mattermost server across three trust boundaries to the recipient.

Why SPF and DKIM decide whether Mattermost email is delivered

SPF and DKIM decide whether receiving mail servers trust the notifications and password reset emails that Mattermost sends. SPF is a DNS record that lists which servers may send mail for your sending domain. DKIM attaches a cryptographic signature to each message, and the receiving server checks that signature against a public key published in your DNS. If either check fails, messages can land in spam or be rejected outright, and users may never receive the password reset link they need to get back into the workspace.

The records must match the sending service you chose during setup. A relay run by your mail team, a commercial SMTP provider and Amazon SES each publish different hosts and keys, and a record copied from another guide will not authorize the servers that actually send your mail. Before you change DNS, confirm with the service owner which domain the From address uses, which selector or key they expect, and whether the sending domain is shared with other applications. Ask the mail team to record who owns each DNS change so that a later cleanup does not break Mattermost email.

Test every change with a real mailbox on each major provider your users rely on, and check the message headers for the SPF and DKIM results. Also confirm the DMARC policy already published for the domain with the mail team, because a strict policy turns a small misconfiguration into blocked delivery, while a monitoring-only policy may hide the problem. Treat the DNS changes, the test results and the DMARC decision as part of the Mattermost go-live record, and repeat the check after any change to the sending service.

The Docker relay network quirk that breaks local SMTP

When Mattermost runs in a container, a relay on the host or in a sibling container can be unreachable even though it works from the host itself. The cause is almost always container networking rather than Mattermost, so the checks below move from name resolution to network path to relay policy. Confirm each cause in your own environment before changing the relay or the server configuration.

Resolve the relay name from inside the container

Run a lookup from within the Mattermost container, not from the host, to confirm the SMTP hostname resolves to an address the container can reach. A name that works in your shell may not exist inside the container's network, especially if it depends on a host alias or a local DNS entry. If the name is localhost, it points to the Mattermost container itself, not the host or the relay container. Use the relay's service name or a reachable IP address instead, and confirm the value matches the SMTP server setting in your configuration.

Confirm the port is published or shared

A relay container is only reachable from another container if both share a Docker network or the relay publishes its SMTP port to the host. Check with docker network inspect that both containers attach to the same user-defined network, and check the port mapping with docker ps. Containers on the default bridge network generally cannot reach each other by name. Confirm the SMTP port in your configuration matches the port the relay actually listens on, which may differ from the published host port.

Check host firewall rules

If the relay runs on the host, traffic from the Docker bridge to the host's SMTP port can be blocked by host firewall rules, even when the relay accepts connections from the host itself. Review the active firewall policy on the host for rules that restrict the Docker bridge subnet, and confirm the relay listens on an interface the bridge can reach. Test the connection from inside the Mattermost container with a simple TCP check. A timeout usually points to a filtered path, while an immediate refusal usually points to nothing listening on that port.

Verify the relay accepts the container's address

Many relays restrict which client addresses may submit mail. When Mattermost connects from a container, its source address is the container or bridge address, not the host address you may have allowed earlier. Check the relay's allowed networks or relay access rules and add the subnet the container uses. Confirm with the relay's logs that the connection arrives from the expected address and is not rejected during the SMTP conversation, since a rejection there looks like an authentication or policy error.

Test delivery and read the Mattermost logs

After the network path is open, send a test message from the System Console email settings and watch the Mattermost server log for the result. A successful connection that still fails at authentication or sender validation is a different problem from a network failure, so the log message decides the next check. Ask your team to confirm the exact error and the relay log entry for the same attempt, because the cause of a container relay failure is specific to each environment and cannot be inferred from the symptom alone.

Questions buyers ask about Mattermost SMTP email setup

How much does Mattermost SMTP email setup cost?

Email configuration is part of the server you already run, so the cost sits in the work and the services around it. Configuration itself is one-time labor: setting the server's mail options, publishing DNS records for the sending domain, and testing notifications and password resets. Recurring costs come from the mail provider, which is usually billed by volume or by plan, and from ongoing ownership of DNS records and any local relay, which need updates when providers, domains or addresses change. Ask any partner for a quote that splits these lines: one-time configuration and testing, DNS and provider account work, and any recurring support. Current provider pricing should come from that provider's own terms.

How long does it take to get Mattermost email working?

Basic delivery can move quickly once the provider account and DNS access are in place, but calendar time usually depends on other teams. The slow points are domain verification at the mail provider, DNS changes that pass through change control, firewall or relay rules that need a network team, and testing every message type the server sends, including notifications, password resets and invitations. DNS propagation adds waiting time that no one on the project controls. Ask for a plan that marks which steps need approval from outside the platform team, and confirm verification timelines with your provider before you commit to a date.

What does our internal team need to provide for Mattermost email?

Most of the access comes from four places, and missing any one of them is the usual cause of delay:

  • DNS editing rights for the sending domain, or a DNS owner who can publish the SPF and DKIM records.
  • An account with the SMTP service or Amazon SES, including identity verification for the sending domain and the credentials the server will use.
  • Network rules that let the Mattermost servers reach the relay or provider, and for Docker deployments, a container network path to any local relay.
  • A named mailbox owner who receives bounce notices, provider warnings and abuse reports.

Confirm each item before the work starts, because the people who hold them are often not on the platform team.

Can an admin set up Mattermost SMTP email without outside help?

Yes, for a single server with an approved mail provider, an admin who has server access and DNS rights can usually complete the core steps. Outside help becomes more valuable when the sending domain's DNS is shared across several teams, when the organization runs a local relay or a container network that needs routing changes, when SPF and DKIM must fit an existing mail policy, or when auditors will review the email configuration as evidence. Whoever does the work should follow the email guidance for the Mattermost version you run, since settings and options change between releases, and should test each message type before the change is closed.

Why does Mattermost email go to spam and how do we fix it?

Spam placement usually means the sending domain's authentication does not line up with the messages. Common causes are missing or incomplete SPF records, DKIM signing that is absent or failing, a From address that does not match the verified domain, and notification volume that looks like bulk mail. To fix it, publish SPF and DKIM for the sending domain, confirm the From address belongs to that domain, and send test messages to the major mailbox providers, then read the full message headers to check authentication results. Once alignment is confirmed, a DMARC policy can be added with reporting turned on. Reputation problems at a shared provider may need a provider-side review, so ask how bounces and complaints are handled.

Why can't Mattermost in Docker reach our local mail relay?

The usual cause is network placement: the relay listens on the host or on a network the container cannot route to, so the server either resolves the wrong address or is blocked before it reaches the relay. Start by checking which address the relay uses from inside the container, whether the relay accepts connections from the container's network range, and whether host firewall rules apply to that traffic. The practical fixes are to run the relay on the same Docker network as Mattermost or to allow the bridge subnet explicitly. Test the connection from inside the container before you change the Mattermost email settings, and confirm the networking behavior against the documentation for your container runtime.

How DeployOpen scopes and delivers Mattermost email setup

DeployOpen plans and implements self-hosted open-source platforms inside the client's own infrastructure, including the Mattermost mail path described above. The work starts with a written scope that names the sending domain, the mail provider or relay, the notification and password reset flows to test, and the people who will own the DNS records and the mail account. Deliverables are agreed in the same document before any change is made to the Mattermost server, so the client knows what will be configured, what evidence will be handed over, and what remains theirs to operate.

In practice, the scope usually covers the email settings in the Mattermost configuration, the SPF and DKIM records for the sending domain, the choice between an SMTP service, Amazon SES or a local relay, and a test plan that sends real notifications and password reset messages from each application server. Where the deployment spans several nodes or a Docker network, the scope should also cover how each node reaches the relay. Ask for these items to be listed by name in the written scope, because the cost and effort of this work depend mainly on how many sending paths exist and how many environments must be verified.

DeployOpen does not publish prices. A quote follows from the written scope, so the useful request is a quote that separates one-time setup and testing from any recurring support. Ongoing support, configuration changes after upgrades and continuous checks of mail delivery can be covered by a retainer, which is agreed separately from the initial scope. Confirm with DeployOpen what the retainer includes, how changes are requested and how the handover documentation will be kept current in your environment.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.