diff --git a/CHANGELOG.md b/CHANGELOG.md index c2ec653..196d92f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.3.0 - 2026-11-20 + +- `MAILVIEW_USERS` entries can be email addresses (`alice@example.com=alice`), matched case-insensitively and only + when the provider marks the address verified. No more looking up a provider's user id (with Google, only a refused + sign-in shows it). User ids work as before; with no email entries, only the `openid` scope is requested. +- The "sign-in refused" log line says why (not listed, no verified email, or no key) and never logs the email. + ## 0.2.0 - 2026-11-14 First public release. diff --git a/README.md b/README.md index 0138030..378715b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ mailview is an independent project, not part of Mail-Archiver. key, so **Mail-Archiver decides what each person may see**, and its Access Log names the person. mailview adds no access rules of its own beyond "who is signed in". - Sign-in uses any **OpenID Connect** provider (Keycloak, Authentik, Authelia, Google, ...). An allowlist maps each - provider user id to a label, and each label to that person's API key. Anyone not on the list is turned away. + person's email address (only if the provider says it's verified) or provider user id to a label, and each label to + that person's API key. Anyone not on the list is turned away. - Email HTML is shown in a sandboxed frame with a strict Content Security Policy: scripts never run. Pictures from the internet are blocked until the reader asks for them, unless you set `REMOTE_IMAGES=allow`. - Inline (`cid:`) images and the "Original" download are read from the stored original message, so these work best @@ -39,7 +40,7 @@ Create a confidential client (client id + secret) with: - Redirect URI: `https:///auth/callback` - Post-logout redirect URI: `https:///` -- Scope: `openid` (nothing else is requested) +- Scope: `openid`, plus `email` when `MAILVIEW_USERS` lists email addresses (nothing else is requested) ### 2. One Mail-Archiver user and API key per person @@ -47,11 +48,12 @@ For each person: 1. In Mail-Archiver, create a normal (non-admin) user and assign their mailbox(es) to it. 2. Sign in to Mail-Archiver as that user and create an API key (API keys are per user and self-service). -3. Find the person's user id at your OpenID Connect provider: the `sub` claim of their ID token (Keycloak: Users → - user → ID). If you don't know it, let them try to sign in: mailview logs - `sign-in refused: user is not set up`. -4. Pick a label for them (lowercase letters, digits and `-`, e.g. `alice`), add `=alice` to `MAILVIEW_USERS` - and set `MAILVIEW_KEY_ALICE` to their key. Restart mailview. +3. Pick a label for them (lowercase letters, digits and `-`, e.g. `alice`) and add them to `MAILVIEW_USERS`, either + by **email**, `alice@example.com=alice` (the address they sign in with; it must be marked verified by the + provider, as Google and most others do), or by **user id**, `=alice` (the `sub` claim of their ID token, e.g. + Keycloak: Users → user → ID; if you don't know it, let them try to sign in: mailview logs + `sign-in refused: user is not set up`). +4. Set `MAILVIEW_KEY_ALICE` to their key. Restart mailview. ### 3. Run it @@ -66,7 +68,7 @@ services: OIDC_ISSUER: https://auth.example.com/realms/home OIDC_CLIENT_ID: mailview MAILARCHIVER_API_URL: http://mailarchive-app:5000/api/v1 - MAILVIEW_USERS: "3f2a1b4c-0000-4000-8000-000000000001=alice;3f2a1b4c-0000-4000-8000-000000000002=bob" + MAILVIEW_USERS: "alice@example.com=alice;3f2a1b4c-0000-4000-8000-000000000002=bob" read_only: true tmpfs: - /tmp @@ -87,7 +89,7 @@ services: | `OIDC_CLIENT_ID` | yes | | | | `OIDC_CLIENT_SECRET` | yes | | Keep it in an env file, not in the compose file | | `MAILARCHIVER_API_URL` | yes | | Mail-Archiver's API base, e.g. `http://mailarchive-app:5000/api/v1` | -| `MAILVIEW_USERS` | yes | | `=