Skip to content

triauth for mailcowOIDC

Let your team open mailcow and its webmail with one approval on their own device, and no mailbox passwords in the browser.

  • Email
  • Open source
Sign-in through
OpenID Connect bridge
Available in
mailcow 2025-03 and newer
Set up in
System › Configuration › Access › Identity Provider

About mailcow

mailcow is a complete self-hosted mail server packaged as Docker containers: mail delivery, spam filtering, the SOGo webmail and calendar, and a web interface for domains and mailboxes. Small teams run it to own their email.

Connect mailcow to triauth

mailcow signs people in through the triauth OpenID Connect bridge, as its generic identity provider. Once connected, the login page shows Single Sign-On under "or login with". People on your team click it, type their username, and approve on their own device, and land in the webmail. Nobody types a mailbox password in the browser, and when someone leaves, removing their identity records at your domain ends their access to mailcow as well.

How it works

  1. Open oidc.triauth.org and enter your domain. Paste mailcow's redirect address, the address of the web interface itself, https://mail.example.com with your own in place of mail.example.com, and click Connect app. The bridge gives you a client ID and a client secret.

  2. In mailcow, as administrator, open System › Configuration › Access › Identity Provider, choose Generic-OIDC, and fill in the fields below with your domain in place of example.com. Choose a Default Template for new mailboxes, turn on Auto-create users on login, click Test Connection, and save.

    FieldValue
    Authorization endpointhttps://oidc.triauth.org/example.com/authorize
    Token endpointhttps://oidc.triauth.org/example.com/token
    User info endpointhttps://oidc.triauth.org/example.com/userinfo
    Client ID and Client Secretfrom the bridge
    Redirect Urlhttps://mail.example.com
    Client Scopesopenid profile email
  3. For each existing mailbox, open E-Mail › Configuration › Mailboxes, edit it, and set Identity Provider to Generic-OIDC.

  4. Open mailcow's login page and click Single Sign-On.

Checkpoint

mailcow's login page shows Single Sign-On under "or login with". Choosing it opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve. mailcow then opens the webmail.

Good to know

  • The mailbox is the identifier itself, so mailcow must host your domain. With auto-creation on, everyone with an identity at your domain gets a mailbox from the default template the first time they sign in. To let only one team in, limit the app to a group when you connect it.
  • Mail apps on phones and desktops keep using an app password, which each person creates under their mailbox settings. The groups published at your domain are not used.
  • Since mailcow 2025-03, the webmail is reached through the mailcow login, so this one sign-in covers both.

For the person who connects the app

SettingValue
Redirect addressthe web interface's address exactly, with no path. One hostname per redirect address
Where in mailcowSystem › Configuration › Access › Identity Provider, then each mailbox's Identity Provider setting
Addressesthe three addresses go in one by one, as above, since mailcow does not read the discovery document. It takes the identity from the userinfo response and does not check the ID token
Clientmailcow keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge
Scopeswithout the mailcow_template scope of the default, since the bridge has no such claim. The default template fills in for it
Sessionsmailcow's own, usually three hours without activity. Adding offline_access to the scopes makes mailcow re-check the sign-in with the bridge each time the login page or the user settings page loads, and sign the person out when the identity is gone. The price is a new sign-in whenever the bridge cannot be reached at that moment

mailcow's Generic-OIDC guide explains every field and the attribute mapping.

Next steps

All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.