nextcloud / nextcloud/mail

Account provisioning for large user directories

Open
#9,784 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Is your feature request related to a problem? Please describe.

The ProvisionAccounts repair step runs on occ maintenance:repair or occ upgrade.

This means we use IUserManager.callForAllUsers to loop over all users and check for each if there's a matching provisioning configuration.

  • IUserManager.callForAllUsers is, with large user directories, slow.
  • While running the provisioning we don't have access to the user's password, unless a master password is used, and therefore it's not necessary to create the account upfront because we cannot run a sync/quota/training job.
  • OCA\Mail\Service\Provisioning\Manager uses MailAccountMapper to create/update/delete a mail account, but the background jobs are never scheduled somewhere? For non-provisioned account's that's done in AccountService.save. However, there's a repair step to add the background jobs when missing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/Migration/ProvisionAccounts.php and trace the occ maintenance:repair and upgrade paths using IUserManager.callForAllUsers. Then inspect OCA\Mail\Service\Provisioning\Manager, MailAccountMapper, and AccountService.save, focusing on account creation and background-job scheduling. Done means the provisioning behavior addresses large directories and the stated job-scheduling gap without relying on unavailable user passwords.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.