Skip to content

feat(open-xchange): add mail filter properties and Keycloak sync via … - #101

Open
MAVRICK-1 wants to merge 6 commits into
masterfrom
feat/open-xchange-mail-filter-properties
Open

feat(open-xchange): add mail filter properties and Keycloak sync via …#101
MAVRICK-1 wants to merge 6 commits into
masterfrom
feat/open-xchange-mail-filter-properties

Conversation

@MAVRICK-1

@MAVRICK-1 MAVRICK-1 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Adds two things to the open-xchange chart:

Mail filter (Sieve) properties - enables Settings > Mail > Filter Rules in the App Suite UI. Points at your IMAP server's ManageSieve port; blank by default until wired to a real mail backend.

Keycloak → OX user sync CronJob - OX's OIDC login has no JIT auto-provisioning; a login for a Keycloak user with no matching OX account just fails (USR-0015), it doesn't create one. This CronJob is the actual mechanism keeping OX accounts (and optionally Dovecot mailboxes) in sync with Keycloak, so new hires get an account without a manual createuser per person.

  • Auth reuses the OIDC client's own credentials (client_credentials grant) instead of a separate admin account.
  • User provisioning goes through OX's own SOAP admin API (OXUserService) - verified live against a real cluster, all accounts recreated cleanly via SOAP with zero failures.
  • Optional mailbox provisioning still uses kubectl exec for Dovecot, since there's no SOAP/REST equivalent for that.
  • The password set on account creation (never used as a login credential - real login is OIDC) is sourced from a Secret rather than a hardcoded value.

@MAVRICK-1
MAVRICK-1 marked this pull request as draft July 17, 2026 17:59
@MAVRICK-1
MAVRICK-1 marked this pull request as ready for review July 18, 2026 18:53
@MAVRICK-1
MAVRICK-1 force-pushed the feat/open-xchange-mail-filter-properties branch 2 times, most recently from 475f744 to 525d894 Compare July 22, 2026 05:09
case "$EMAIL" in
*@{{ required "appsuite.keycloakSync.emailDomain is required" $sync.emailDomain }}) ;;
*) continue ;;
esac

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not seems like a good way ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it , now it only updates names, not email

@ashish1099 ashish1099 added the question Further information is requested label Jul 23, 2026
…SOAP admin API

Adds mail filter (Sieve) property placeholders, enabling Settings >
Mail > Filter Rules in the App Suite UI.

Templatizes the Keycloak user sync + mail provisioning CronJob into
the chart itself (previously lived as raw manifests in the config
repo). Auth is via the OIDC client's own secret (client_credentials
grant) — OX has no JIT auto-provisioning on login, so this CronJob is
the actual mechanism keeping OX accounts and Dovecot mailboxes in sync
with Keycloak.

User provisioning goes through OX's own SOAP admin API (OXUserService,
see docs linked inline), not kubectl exec + CLI tools — verified live
against a real cluster: wiped all existing accounts and re-ran the
sync fresh, all users recreated cleanly via SOAP with zero failures.
Mail provisioning still uses kubectl exec since Dovecot has no
SOAP/REST equivalent.

Signed-off-by: Rishi <rishi@obmondo.com>
…accounts

Every account created by the Keycloak-sync CronJob got its OX password
hardcoded to the literal string 'admin' in the SOAP create request.
Real login always goes through OIDC, so this password is never used
as a login credential directly - but shipping a chart where every
account gets a guessable, shared literal baked in is still a real
security smell, not something to leave as-is.

Adds keycloakSync.userPassword (required, no default) - set to
something random per deployment instead.

Signed-off-by: Rishi <rishi@obmondo.com>
Switches userPassword from a plain values-driven env var to
userPasswordExistingSecret/userPasswordSecretKey, sourced via
secretKeyRef - same convention as oidcExistingSecret. Keeps the actual
password value out of values files entirely.

Signed-off-by: Rishi <rishi@obmondo.com>
… every run

The change SOAP call (runs every 15 min, for existing accounts) was
unconditionally resetting primaryEmail/email1 back to Keycloak's
email on every sync - silently undoing any account customized to use
a different mail identity than the Keycloak login domain (hit this in
production: kept reverting kubeaid.io swaps back to obmondo.com every
15 minutes, had to suspend the CronJob entirely to stop it).

change now only touches name fields (given_name/sur_name/display_name)
- its actual job, keeping display names in sync. create (for genuinely
new accounts) still sets primaryEmail/email1 once, unaffected.

Signed-off-by: Rishi <rishi@obmondo.com>
ServiceAccount/Role/RoleBinding were bundled into keycloak-sync-cronjob.yaml
alongside the ConfigMap+CronJob, which is odd for a file named "cronjob".
Moved RBAC out to keycloak-sync-rbac.yaml, no logic change.

Signed-off-by: Rishi <rishi@obmondo.com>
@MAVRICK-1
MAVRICK-1 force-pushed the feat/open-xchange-mail-filter-properties branch from 1823c17 to a04af32 Compare July 26, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants