Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SMTP Credentials

Get credentials for an account that can send mail — from Forward Email, Amazon SES, Gmail, Mailgun, Proton Mail or SendGrid — for StartOS, a Stalwart relay, or any app.

What They’re For

SMTP credentials let software hand mail to a provider for delivery. You need them for:

  • StartOS and its services — Nextcloud, Vaultwarden, Gitea and others send notifications and password resets. Enter the credentials once under System › SMTP in StartOS, then point each service at them. See SMTP in the StartOS docs.
  • A Stalwart relay — Stalwart hands your outgoing mail to the provider, which delivers it from its established servers. The credentials must authorize every From address the server will use; a credential for one alias cannot necessarily relay mail for the whole domain. See Using a Relay for a Whole Domain and the relay section of Stalwart’s instructions.
  • Any other app that sends mail, with the same values.

Every provider gives you the same handful of values: a host, a port and connection security, a username and password, and the From address you’re allowed to send as.

Choosing a Provider

We recommend Forward Email: it is open source and privacy-focused, and sends from your own domain. If you already host your domain’s mail there (see Hosted Email on Your Domain), you already have what you need.

  • Sending as your own domain looks more trustworthy to recipients and keeps working if you change providers. Forward Email, Amazon SES, Mailgun, SendGrid and Proton all support it.
  • Gmail is the quickest to set up if you have an account, but sends only as your Gmail address.
  • Amazon SES, Mailgun and SendGrid are built for apps sending in volume: newsletters, a business’s automated mail.

Getting Credentials

To use Amazon SES you will need:

  • An Amazon Web Services (AWS) account. If you don’t have one, you can register here for free.
  • Amazon Simple Email Service (SES) set up from inside your AWS console, free for a time within certain limits.
  • A verified identity to send from: either your own domain name (add the DNS records Amazon gives you) or a single email address, under Identities in the SES console.

New SES accounts start in the sandbox, which can only send to addresses you have also verified. To send to anyone else, request production access from the SES Account dashboard.

  1. Open the SES console and check the region selected in the top bar. Credentials, verified identities, and the SMTP host are all specific to this region, so use the same one throughout.

  2. Choose SMTP settings in the left navigation pane. The page shows two cards: Mail Manager SMTP (marked “Recommended”) and IAM SMTP credentials.

  3. In the IAM SMTP credentials card, click Create IAM credentials. The IAM console opens. Do not use the Mail Manager card’s Create SMTP credentials button: it creates an ingress endpoint, a separately billed product that is not needed.

  4. Enter a user name (or keep the default) and click Create user.

  5. Click Show under SMTP password, then Download .csv file. The SMTP user name and password are shown only once; save them somewhere secure, such as your Vaultwarden password manager. The user name is an access key ID (starts with AKIA); the password is not your AWS secret access key.

  6. Use these values:

    ParameterValue
    Hostemail-smtp.<region>.amazonaws.com, e.g. email-smtp.us-east-1.amazonaws.com
    Connection SecurityTLS
    Port465
    From Addressan address at your verified domain, or your verified email address
    Usernameyour SMTP user name (from above)
    Passwordyour SMTP password (from above)

    Note

    Replace <region> in the Host with the region you created the credentials in, e.g. email-smtp.eu-west-1.amazonaws.com. The SMTP settings page in the SES console shows the exact hostname for that region. For STARTTLS instead, use port 587.

Using a Relay for a Whole Domain

Choose credentials that authorize all of the domain’s sending addresses. Forward Email’s alias password above authorizes only that alias: putting it in Stalwart’s default relay route rejects other users’ From addresses. Forward Email offers domain-wide catch-all passwords for SMTP sending; follow its documentation for obtaining domain-wide credentials. Alternatively, configure separate authenticated relay routes for each sending alias. Protect domain-wide credentials as secrets that can send as anyone on the domain.

Publish every DNS record the relay provider requests, including its DKIM and verification records where required. Add the provider to the domain’s SPF record with the include: value it gives you, keeping a single SPF record. See Your Own Domain.