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.
- 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
Open oidc.triauth.org and enter your domain. Paste mailcow's redirect address, the address of the web interface itself,
https://mail.example.comwith your own in place ofmail.example.com, and click Connect app. The bridge gives you a client ID and a client secret.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.Field Value Authorization endpoint https://oidc.triauth.org/example.com/authorizeToken endpoint https://oidc.triauth.org/example.com/tokenUser info endpoint https://oidc.triauth.org/example.com/userinfoClient ID and Client Secret from the bridge Redirect Url https://mail.example.comClient Scopes openid profile emailFor each existing mailbox, open E-Mail › Configuration › Mailboxes, edit it, and set Identity Provider to Generic-OIDC.
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
| Setting | Value |
|---|---|
| Redirect address | the web interface's address exactly, with no path. One hostname per redirect address |
| Where in mailcow | System › Configuration › Access › Identity Provider, then each mailbox's Identity Provider setting |
| Addresses | the 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 |
| Client | mailcow keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge |
| Scopes | without the mailcow_template scope of the default, since the bridge has no such claim. The default template fills in for it |
| Sessions | mailcow'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
- Read the OpenID Connect bridge page for what every connected app gets and what the bridge keeps private.
- Read Roll out to your team to give everyone in your organization an identifier at your domain.
- Read Groups to limit mailcow to one team when you connect it.
- Read mailcow's Generic-OIDC guide for every setting mailcow offers.
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.