|
23 | 23 | - [External Redis Server](#external-redis-server) |
24 | 24 | - [Linking to Redis Container](#linking-to-redis-container) |
25 | 25 | - [Mail](#mail) |
| 26 | + - [Microsoft Graph Mailer](#microsoft-graph-mailer) |
26 | 27 | - [Reply by email](#reply-by-email) |
27 | 28 | - [SSL](#ssl) |
28 | 29 | - [Generation of a Self Signed Certificate](#generation-of-a-self-signed-certificate) |
@@ -437,6 +438,26 @@ docker run --name gitlab -d \ |
437 | 438 |
|
438 | 439 | Please refer the [Available Configuration Parameters](#available-configuration-parameters) section for the list of SMTP parameters that can be specified. |
439 | 440 |
|
| 441 | +##### Microsoft Graph Mailer |
| 442 | + |
| 443 | +As Microsoft is retiring basic authentication for SMTP AUTH on Exchange Online, mail delivery via SMTP using a Microsoft 365 mailbox is no longer viable for many tenants. The image supports GitLab's native Microsoft Graph Mailer, which sends emails via the Microsoft Graph API using OAuth 2.0 client credentials. |
| 444 | + |
| 445 | +To enable it, register an application in Azure AD, grant it the `Mail.Send` **Application** permission (not Delegated), and have an administrator consent to it. Then start the container with: |
| 446 | + |
| 447 | +```bash |
| 448 | +docker run --name gitlab -d \ |
| 449 | + --env 'MICROSOFT_GRAPH_MAILER_ENABLED=true' \ |
| 450 | + --env 'MICROSOFT_GRAPH_MAILER_USER_ID=00000000-0000-0000-0000-000000000000' \ |
| 451 | + --env 'MICROSOFT_GRAPH_MAILER_TENANT=contoso.onmicrosoft.com' \ |
| 452 | + --env 'MICROSOFT_GRAPH_MAILER_CLIENT_ID=11111111-1111-1111-1111-111111111111' \ |
| 453 | + --env 'MICROSOFT_GRAPH_MAILER_CLIENT_SECRET=YOUR_CLIENT_SECRET' \ |
| 454 | + --env 'GITLAB_EMAIL=sender@contoso.com' \ |
| 455 | + --volume /srv/docker/gitlab/gitlab:/home/git/data \ |
| 456 | + sameersbn/gitlab:18.11.0 |
| 457 | +``` |
| 458 | + |
| 459 | +`MICROSOFT_GRAPH_MAILER_USER_ID` is the Object ID of the Microsoft 365 user whose mailbox will be used, and `GITLAB_EMAIL` must be that user's primary email address. `SMTP_ENABLED` should stay at its default (`false`) when Graph Mailer is used. Please refer the [Available Configuration Parameters](#available-configuration-parameters) section for the list of Microsoft Graph Mailer parameters that can be specified. |
| 460 | + |
440 | 461 | ##### Reply by email |
441 | 462 |
|
442 | 463 | Since version `8.0.0` GitLab adds support for commenting on issues by replying to emails. |
@@ -2019,6 +2040,34 @@ Specify the `ca_path` parameter for SMTP email configuration. Defaults to `/home |
2019 | 2040 |
|
2020 | 2041 | Specify the `ca_file` parameter for SMTP email configuration. Defaults to `/home/git/data/certs/ca.crt`. |
2021 | 2042 |
|
| 2043 | +##### `MICROSOFT_GRAPH_MAILER_ENABLED` |
| 2044 | + |
| 2045 | +Enable mail delivery via Microsoft Graph API. Defaults to `false`. When enabled, emails are sent using OAuth 2.0 client credentials via the Microsoft Graph `sendMail` endpoint instead of SMTP. Requires an Azure App Registration with the `Mail.Send` Application permission granted and admin-consented. When both `SMTP_ENABLED` and `MICROSOFT_GRAPH_MAILER_ENABLED` are `false`, GitLab mail delivery is disabled. |
| 2046 | + |
| 2047 | +##### `MICROSOFT_GRAPH_MAILER_USER_ID` |
| 2048 | + |
| 2049 | +The Object ID (GUID) of the Microsoft 365 user to send mail as. This must match the user whose mailbox the emails are sent from. `GITLAB_EMAIL` should match the primary email address of this user. |
| 2050 | + |
| 2051 | +##### `MICROSOFT_GRAPH_MAILER_TENANT` |
| 2052 | + |
| 2053 | +The Azure AD tenant ID (GUID) or tenant domain (e.g. `contoso.onmicrosoft.com`). |
| 2054 | + |
| 2055 | +##### `MICROSOFT_GRAPH_MAILER_CLIENT_ID` |
| 2056 | + |
| 2057 | +The Application (client) ID from the Azure App Registration. |
| 2058 | + |
| 2059 | +##### `MICROSOFT_GRAPH_MAILER_CLIENT_SECRET` |
| 2060 | + |
| 2061 | +The client secret value from the Azure App Registration. |
| 2062 | + |
| 2063 | +##### `MICROSOFT_GRAPH_MAILER_AZURE_AD_ENDPOINT` |
| 2064 | + |
| 2065 | +Azure AD authority endpoint used to obtain an access token. Defaults to `https://login.microsoftonline.com`. Override for sovereign clouds (e.g. `https://login.microsoftonline.us` for Azure Government). |
| 2066 | + |
| 2067 | +##### `MICROSOFT_GRAPH_MAILER_GRAPH_ENDPOINT` |
| 2068 | + |
| 2069 | +Microsoft Graph API endpoint. Defaults to `https://graph.microsoft.com`. Override for sovereign clouds (e.g. `https://graph.microsoft.us` for Azure Government). |
| 2070 | + |
2022 | 2071 | ##### `IMAP_ENABLED` |
2023 | 2072 |
|
2024 | 2073 | Enable mail delivery via IMAP. Defaults to `true` if `IMAP_USER` is defined, else defaults to `false`. |
|
0 commit comments