Settings
Users
Only people listed here can sign in (with the Microsoft 365 address they sign in with). viewer can read, editor can also add, change, import and delete data, admin can also change settings and users. You cannot change your own role.
| Name | Role | Active | Last sign-in |
|---|
Office 365 connection (Microsoft Graph)
These values are set on the server in the .env file (or the server's protected environment), never in this page. The client secret is never shown or stored in the database.
| Tenant ID | GRAPH_TENANT_ID | |
|---|---|---|
| Client ID | GRAPH_CLIENT_ID | |
| Client secret | GRAPH_CLIENT_SECRET |
| Sign-in to Microsoft | |
|---|---|
| Permission Mail.Send | |
| Permission Mail.Read / Mail.ReadWrite |
| Mailbox | Result |
|---|
Mailboxes the application may use
Only addresses listed here and active are used. The Microsoft side must also be restricted to the same mailboxes (see the setup steps below).
| Name | Active |
|---|
How to set it up on the Microsoft side
Short version below; full details and troubleshooting are in docs/office365-setup.md. You need a Microsoft 365 / Entra administrator account.
1. Register the application
- Go to entra.microsoft.com → Identity → Applications → App registrations → New registration.
- Name:
Mailings. Supported account types: Single tenant. No redirect URI. Register. - On the Overview page copy Directory (tenant) ID and Application (client) ID into
.env.
2. Give it mail permissions
- API permissions → Add a permission → Microsoft Graph → Application permissions.
- Add
Mail.SendandMail.ReadWrite(useMail.Readinstead if replies should only be read). - Click Grant admin consent for your organisation. Both rows must show a green check.
3. Create a client secret
- Certificates & secrets → New client secret → pick an expiry (e.g. 12 months).
- Copy the Value immediately (it is shown only once) into
GRAPH_CLIENT_SECRETin.env. Put a reminder in your calendar before it expires.
4. Restrict the app to the two mailboxes (important)
Application permissions normally reach every mailbox in the organisation. Limit them in Exchange Online PowerShell:
- Create a mail-enabled security group (e.g.
mailings-allowed@paradisskolekorps.no) containing only the approved mailboxes. New-ApplicationAccessPolicy -AppId <client id> -PolicyScopeGroupId mailings-allowed@paradisskolekorps.no -AccessRight RestrictAccess -Description "Mailings app"Test-ApplicationAccessPolicy -Identity programm@paradisskolekorps.no -AppId <client id>should say Granted; a mailbox outside the group should say Denied.- The policy can take up to an hour to take effect.
5. Apply and test
- Save
.env, then on the server rundocker compose up -d(local) or restart the web service so the values are loaded. - Reload this page and press Test connection.