Skip to main content

Email

This page covers both configuring authentik to send email and testing that email delivery is working.

Global email settings are used for administrator notifications, release and configuration alerts, notification rules, and any Email stage configured to use global settings.

Email stages can be configured to use their own stage-specific SMTP settings if you need them to send mail through a different server than the one used by the rest of authentik.

warning

Some hosting providers block outgoing SMTP ports, in which case you will need to host an SMTP relay on a different port with a different provider.

Before you begin

Have the following values ready:

  • SMTP server hostname or IP address
  • SMTP port
  • SMTP server username and password, if authentication is required
  • The sender address for AUTHENTIK_EMAIL__FROM
  • The TLS mode required by your provider

Configure global email settings

Set the global SMTP configuration in your deployment, then redeploy authentik.

Follow your mail provider's documentation and configure TLS mode as follows:

  • STARTTLS, also called explicit TLS, often uses port 587. Set AUTHENTIK_EMAIL__USE_TLS=true and leave AUTHENTIK_EMAIL__USE_SSL=false.
  • SSL or implicit TLS often uses port 465. Set AUTHENTIK_EMAIL__USE_SSL=true and leave AUTHENTIK_EMAIL__USE_TLS=false.
  • Plain SMTP without TLS should leave both settings disabled.

Never enable USE_TLS and USE_SSL at the same time. In the Helm chart, apply the same rules to email.use_tls and email.use_ssl.

To configure global email settings, append the following block to your .env file:

# SMTP server
AUTHENTIK_EMAIL__HOST=localhost
AUTHENTIK_EMAIL__PORT=25
# Optionally authenticate (don't add quotation marks to your password)
AUTHENTIK_EMAIL__USERNAME=
AUTHENTIK_EMAIL__PASSWORD=
# STARTTLS / explicit TLS, usually on port 587
AUTHENTIK_EMAIL__USE_TLS=false
# Implicit TLS/SSL on the SMTP connection (`USE_SSL` is the variable name), usually on port 465
AUTHENTIK_EMAIL__USE_SSL=false
AUTHENTIK_EMAIL__TIMEOUT=10
# Sender email address; verify that the domain is valid.
AUTHENTIK_EMAIL__FROM=authentik@example.com

When to use stage-specific settings

Email stages can either:

  • use the global SMTP settings described above, or
  • use their own stage-specific SMTP host, port, credentials, and TLS settings

Test email delivery

After configuring SMTP, send a test message from the authentik server:

ak test_email <to_address>

To test a specific Email stage instead of the global settings, include -S:

ak test_email <to_address> [-S <stage_name>]

To run this command with Docker Compose:

docker compose exec worker ak test_email [...]

Google Workspace SMTP relay configuration

One reliable way to send email through Google is Google's SMTP relay service. Google also documents the broader setup flow in Send email from a printer, scanner, or app.

First, determine the outbound IP address used by authentik to send emails and add it to the Google Workspace SMTP relay service settings. Then configure the relay with these options:

  • Set Allowed Senders to Only addresses in my domains.
  • Set Authentication to Only accept mail from the specified IP addresses.
  • Do not set Require SMTP Authentication.
  • Select Require TLS encryption.

If you are using Docker Compose, set the following environment variables for authentik:

AUTHENTIK_EMAIL__HOST=smtp-relay.gmail.com
AUTHENTIK_EMAIL__PORT=587
AUTHENTIK_EMAIL__USE_TLS=true
AUTHENTIK_EMAIL__USE_SSL=false
AUTHENTIK_EMAIL__TIMEOUT=30

Redeploy the authentik containers, then use the ak test_email command to confirm that email delivery works.

SMTP server with TLS verification

If you are configuring authentik to send email via an SMTP server with TLS enabled, mount the certificate used for authentication in your authentik server and worker containers (for example a private CA bundle) and point SSL_CERT_FILE at it.

  1. Add the following configuration to the server and worker services in your Docker Compose file:
volumes:
- /path/to/<cert_name>.crt:/etc/ssl/certs/<cert_name>.crt:ro
environment:
- SSL_CERT_FILE="/etc/ssl/certs/<cert_name>.crt"
  1. Redeploy the containers for the changes to take effect.