Help

Integration

Mailcow OIDC Integration

Updated 1 Nov 2026 9 min read

This document explains how to implement Monosign with mailcow: dockerized, the open-source mail server suite with a web interface and SOGo webmail. It covers Single Sign-On with OpenID Connect (OIDC), which is built into mailcow as the Generic-OIDC identity provider. Mailcow uses the Authorization Code flow, so the OIDC/OpenID access key of Monosign is used. Before you continue, it is better to read the mailcow documentation (opens in a new tab) about the identity provider.

This configuration was tested with mailcow 2026-10. If your version is different, please check the mailcow documentation.

Mailcow supports OpenID Connect (Generic-OIDC and Keycloak) and LDAP as external identity providers. SAML is not available. The provider is configured in the mailcow admin interface (System → Configuration → Access → Identity Provider).

Monofor has no responsibility to do mailcow configurations. If you need support please contact the mailcow community or your mailcow support provider.

Mailcow is free and open source (GPLv3). Single sign-on with OpenID Connect is not limited by a license key.

Instructions

This documentation contains 5 main steps for integration.

  1. Creating an application on Monosign

  2. Configuring the OIDC/OpenID settings on Monosign

  3. Assign a user to the mailcow application

  4. Configuration Single Sign-On for mailcow

  5. Sign In Test

1- Creating an Application on Monosign

Create your application on Monosign first. Open the Applications page from the left menu and click Add New.

image-20261030-191725.png

Mailcow is not in the application catalog, so click Create from scratch.

image-20261030-191750.png

Fill in the application details on the Application tab and click Next.

image-20261101-205203.png

Property

Value

Description

Name

Mailcow

Name of the application shown to users on the Monosign portal and on the Monosign sign-in page.

Type

Web

Mailcow is accessed through a web browser. Options: Web, Mobile, Desktop, API.

Url

Optional

Leave empty or enter the address of mailcow (for example https://<mailcow-address>). The sign-in is started from the mailcow login page with the Single Sign-On button (see step 5).

Logo

Optional

Browse and upload a logo; it is also shown on the Monosign sign-in page.

Users can see this application on their list

Enabled

Displays the application on the user portal.

On the Access tab define who can reach the application and click Create Application.

image-20261030-192040.png

Property

Value

Description

User Access Type

System Default

Defines which users can access this application. Options: Only Assigned Users, All Users, System Default.

User Group Access Type

System Default

Defines the application’s user group access.

Source Using Type

System Default

Defines which user sources the application can use.

Profile Access Type

All

Defines which user profile attributes are available to the application (Options: Restricted, All). Mailcow needs the e-mail address and the name of the user.

With Auto-create users on login enabled (step 4), mailcow creates a mailbox for every Monosign user who signs in for the first time. Make sure the effective User Access Type is Only Assigned Users and give access only to the users you assign in step 3.

After the application is created, click Keys and add a new Access Key for OIDC/OpenID access.

image-20261030-192203.png

Select OIDC/OpenID as the key type and click Create. Monosign generates the Client Id and Client Secret automatically.

image-20261018-104856.png

Property

Value

Options

Type

OIDC/OpenID

Rest API, OAuth 2.0, JWT, OIDC/OpenID, SAML, RADIUS, Access Gateway, LDAP, AuthN/Z Server

Client Id / Client Secret

Generated automatically

Use the eye icon next to the secret to reveal it. Both values are required in step 4.

Session

System Default

System Default, On-demand, Permanent

State

Enabled

Enabled, Disabled

Never Expires

Yes

Turn off to define a specific expiration date for the key.

Configuration details for the Mailcow application are provided as follows:

image-20261031-211130.png

Monosign value

Example

Used in mailcow as

Client Id

<client-id>

Client ID

Client Secret

<client-secret>

Client Secret

Auth Url

https://<monosign-host>/openid/authorize

Authorization endpoint

Access Token Url

https://<monosign-host>/openid/token

Token endpoint

User Info Url

https://<monosign-host>/openid/userinfo

User info endpoint

Mailcow does not read the OIDC discovery document, so the three addresses are entered one by one. Copy them from the Monosign Access Key Details.

2- Configuring the OIDC/OpenID Settings on Monosign

Open the Keys tab of the application and click the Configure button of the OpenID Connect (OIDC) key to open the OIDC/OpenID settings.

image-20261101-205425.png

Add the redirect address of mailcow to Allowed Redirect URIs, enter the scopes in the Scope field, then press Update.

image-20261101-211028.png

Property

Value

Description

Allowed Redirect URIs

https://<mailcow-address>

The address where Monosign sends the user back after sign-in. Mailcow uses its main address without a path and without a slash at the end. It must be exactly the Redirect Url that is entered in the mailcow identity provider settings (step 4). Use the public (HTTPS) address of mailcow.

Scope

openid profile email

Enter the three scopes one by one. They must be the same as the Client Scopes of mailcow (step 4).

Other fields

Empty / default

The other fields (Signing Key, Issuer, Audience, Resource, token lifetimes, CORS, Initiate Login URI) are not needed. Do not enter the redirect address in the Resource field.

Mailcow identifies the user by the email claim of the user information and uses the name of the user for the mailbox. Monosign returns them by default, so a claim mapping is not required.

3- Assign a User to the Mailcow Application

Open the application in Monosign, click the Assignments tab and click Assign a User.

image-20261030-193315.png

Search and select the users who can sign in to mailcow, check the Expiration Date and save. You can select more than one user.

image-20261030-193652.png

Property

Value

Description

User(s)

Selected users

Users who can sign in to mailcow with Monosign.

Expiration Date

Default one year

The assignment expires on this date.

4- Configuration Single Sign-On for Mailcow

As we mentioned at the start, please check out the mailcow documentation first. Before the first sign-in add the e-mail domain of your users in mailcow under E-Mail → Configuration → Domains (for example the part after the @ of the e-mail address in Monosign). Then log in to the mailcow admin interface, open System → Configuration → Access → Identity Provider, select Generic-OIDC, fill in the fields below and click Save changes.

image-20261101-205817.png

Field

Value

Description

Identity Provider

Generic-OIDC

Options: Keycloak, Generic-OIDC, LDAP.

Authorization endpoint

https://<monosign-host>/openid/authorize

Auth Url of the Monosign access key (step 1).

Token endpoint

https://<monosign-host>/openid/token

Access Token Url of the Monosign access key.

User info endpoint

https://<monosign-host>/openid/userinfo

User Info Url of the Monosign access key. Mailcow reads the e-mail address and the name from it.

Client ID / Client Secret

Client Id / Client Secret

Copied from the Monosign OIDC/OpenID Access Key Details created in the first step.

Redirect Url

https://<mailcow-address>

Public HTTPS address of mailcow, without a path. It must match the Allowed Redirect URI of step 2.

Client Scopes

openid profile email

The default of mailcow is openid profile email mailcow_template. Remove mailcow_template; it is not a scope of Monosign.

Attribute Mapping → Default Template

Default

Mailbox template that is used for new mailboxes (quota, permissions). No attribute mapping row is needed.

Ignore SSL Errors

Disabled

Keep it off; mailcow must be able to verify the certificate of Monosign.

Auto-create users on login

Enabled

Creates the mailbox at the first sign-in. The domain of the e-mail address of the user must exist in mailcow and be active.

The Test Connection button of mailcow reports an error with Monosign. For Generic-OIDC it sends an OPTIONS request to the token endpoint and expects the answer 200, which Monosign does not give. This does not affect the sign-in; ignore it and test the sign-in itself (step 5).

The Disable mailcow Login and show only Single Sign-On option of the same page hides the user name and password form on the login page. Use it only after the single sign-on works, otherwise you can lock yourself out of the admin interface. A mailbox that is created by the single sign-on has no mailcow password; the user signs in only with Monosign.

5- Sign In Test

Now try to log in to mailcow using Monosign SSO. Open a new browser window (or a private window) and type the address of mailcow. The login page shows the Single Sign-On button below or login with.

image-20261101-205507.png
  1. Click the Single Sign-On button.

  2. On the Monosign sign-in page log in passwordless with your QR code (Monofor Identity), with a Passkey or with your user name and password (Sign in with Password). If you are already signed in to Monosign, the page is skipped.

  3. After the sign-in Monosign redirects the browser back to mailcow. At the first sign-in mailcow creates the mailbox of the user (the e-mail address and the name come from Monosign) and opens the webmail (SOGo) of the new mailbox.

image-20261101-210852.png

Troubleshooting

Symptom

Cause

Solution

The Single Sign-On button is not shown

The identity provider is not saved, or one of the required fields (endpoints, Client ID, Client Secret, Redirect Url) is empty.

Fill in all fields (step 4) and click Save changes.

Monosign shows a redirect URI error

The Redirect Url of mailcow does not exactly match the Allowed Redirect URIs of Monosign (for example a slash or a path at the end), or it was entered in another field such as Resource.

Use the same address, without a path, in both places (steps 2 and 4).

Monosign shows an invalid scope error

The default scope mailcow_template of mailcow is not known by Monosign.

Set Client Scopes to openid profile email (step 4).

Mailcow shows only login failed after returning from Monosign

The e-mail domain of the user is not a mailcow domain or is inactive, so the mailbox cannot be created. Mailcow does not show the reason.

Add the domain of the e-mail address in E-Mail → Configuration → Domains and try again (step 4).

Mailcow refuses the sign-in for another reason

Auto-create users on login is off and the mailbox does not exist, a mailbox with the same address exists but was not created by the single sign-on, or the user information has no email claim.

Enable the option, set Profile Access Type to All (step 1) and check the mailboxes in E-Mail → Configuration → Mailboxes.

The Test Connection button shows an error

Mailcow tests the token endpoint with an OPTIONS request, which Monosign does not answer with 200.

Ignore the test; it does not affect the sign-in.

A user cannot sign in

The user is not assigned to the application.

Assign the user in step 3.

After completing the configuration on mailcow and Monosign, it is better to test in a new private browser window if the OIDC SSO doesn’t work, because old session cookies may cause errors.

Permanent link