Skip to content

feat(aliases): add admin setting to disable alias creation#12764

Open
bromiesTM wants to merge 1 commit intonextcloud:mainfrom
IONOS-Productivity:feature/configure-alias-creation
Open

feat(aliases): add admin setting to disable alias creation#12764
bromiesTM wants to merge 1 commit intonextcloud:mainfrom
IONOS-Productivity:feature/configure-alias-creation

Conversation

@bromiesTM
Copy link
Copy Markdown

@bromiesTM bromiesTM commented Apr 16, 2026

Introduces an allow_new_mail_aliases app config flag (default: yes) that lets administrators prevent users from creating new mail aliases. This is useful for providers who want to prevent alias creation or manage it elsewhere.

  • Backend: guard in AliasesService::create() throws ClientException when disabled
  • Admin UI: toggle switch in AdminSettings, mirroring the existing "allow new mail accounts" setting
  • Frontend: hides the "Add alias" button when disabled + (warning) description for setting
  • Exposed via PageController initial state and storable via occ config:app:set

Extends existing unit tests for AliasesService, AdminSettings, and PageController to cover the new setting.

@ChristophWurst
Copy link
Copy Markdown
Member

Thank you for sending a pull request

@ChristophWurst
Copy link
Copy Markdown
Member

Please point your agent to https://github.com/nextcloud/mail/blob/main/AGENTS.md#git-workflow in case you didn't open it from this repo's root. Agentic AI has to be transparent in commit messages.

@bromiesTM bromiesTM force-pushed the feature/configure-alias-creation branch 2 times, most recently from 93543cf to eea743b Compare April 16, 2026 12:50
Comment thread src/components/AccountSettings.vue Outdated
Copy link
Copy Markdown
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Just giving the design-ok for the record. This is useful for providers who want to prevent alias creation or manage it elsewhere.

@bromiesTM for future pull requests please also always include the use-case or the issue the pull request tackles. That helps with deciding how to go ahead with it. Thank you! :)

@bromiesTM bromiesTM force-pushed the feature/configure-alias-creation branch 2 times, most recently from a7d30b0 to e5a83f4 Compare April 21, 2026 08:04
@bromiesTM bromiesTM marked this pull request as ready for review April 21, 2026 08:27
Introduces an `allow_new_mail_aliases` app config flag (default: yes)
that lets administrators prevent users from creating new mail aliases.

- Backend: guard in AliasesService::create() throws ClientException when disabled
- Admin UI: toggle switch in AdminSettings, mirroring the existing
  "allow new mail accounts" setting
- Frontend: hides the "Add alias" button when disabled
- Exposed via PageController initial state and storable via occ config:app:set

Extends existing unit tests for AliasesService, AdminSettings, and
PageController to cover the new setting.

AI-assisted: Claude Code (Claude Sonnet 4.6)
Co-Authored-By: Kai Henseler <kai.henseler@strato.de>
Signed-off-by: Matthias Sauer <sauerm@strato.de>
@bromiesTM bromiesTM force-pushed the feature/configure-alias-creation branch from e5a83f4 to aca5dd0 Compare April 22, 2026 13:34
@ChristophWurst
Copy link
Copy Markdown
Member

What about the Alias to S/MIME certificate mapping section? It will still be shown when aliases are disabled by the admin. Should it be hidden?

@ChristophWurst
Copy link
Copy Markdown
Member

Tested and works otherwise. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants