Self-Hosted Email

Set up and configure email notifications for your self-hosted Sentry instance

Sentry sends all outbound email over SMTP. It does not support provider HTTP APIs (such as the SendGrid, Mailgun, or AWS SES APIs) for sending mail. Every configuration option below is therefore SMTP under the hood — they differ only in what delivers your mail to the internet.

Without a working email configuration, Sentry can't send verification emails. This means:

  • Users can't verify their primary email address
  • Users can't add secondary or backup emails
  • Password reset flows won't work

Email verification confirms that a user owns the address on their account, which protects against unauthorized access. Even if you don't need alert notifications, we recommend configuring email for account security.

For evaluation, development, or internal/low-volume instances, the built-in SMTP server is the fastest way to get email working with no extra infrastructure.

This is the default configuration for self-hosted Sentry, powered by egos-tech/smtp.

All you need to do is set a valid address for the mail.from setting in config.yml, and the FQDN of your Sentry instance for SENTRY_MAIL_HOST in .env.

For production, keep using SMTP but relay your mail through a service that handles deliverability (sender reputation, SPF, DKIM, DMARC). Both options below are still SMTP from Sentry's perspective.

Recommended if you are using AWS SES for sending emails. AWS SES exposes an SMTP endpoint, and the built-in server relays your mail to it.

Provide SES_USER, SES_PASSWORD, and SES_REGION values in your .env file, and leave the mail configuration in sentry/config.yml as it is.

Recommended if you have an external SMTP server for sending emails. There are two ways to configure Sentry to use an external SMTP server:

  1. Set the relevant mail.* settings in config.yml file to point directly to your external SMTP server. Refer to our email service documentation for all the details on what each setting means and does.
  2. Use the built-in SMTP server as a relay by setting a few environment variables on the docker-compose.yml file. You will need to leave the configuration on sentry/config.yml file as it is.

For the second option, it is preferred to modify through docker-compose.override.yml file so that your changes are not lost when updating self-hosted Sentry installation. Here is an example configuration:

Copied
x-restart-policy: &restart_policy
  restart: unless-stopped

services:
  smtp:
    <<: *restart_policy
    image: registry.gitlab.com/egos-tech/smtp
    volumes:
      - "sentry-smtp:/var/spool/exim4"
      - "sentry-smtp-log:/var/log/exim4"
    environment:
      MAILNAME: ${SENTRY_MAIL_HOST:-}
      SMARTHOST_ADDRESS: "mail.example.com"
      SMARTHOST_PORT: "587"
      SMARTHOST_USER: "smtp_user"
      SMARTHOST_PASSWORD: "smtp_password"
      SMARTHOST_ALIASES: "*.example.com"

Sentry has very limited inbound mail support through Mailgun. You can find all the information regarding how to set this up over at our inbound email service documentation.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").