[PR #290] [MERGED] Mailbox Automatic Aliases 2.0 #311

Closed
opened 2026-02-26 10:30:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/opensolutions/ViMbAdmin/pull/290
Author: @PhrozenByte
Created: 7/20/2022
Status: Merged
Merged: 2/23/2023
Merged by: @barryo

Base: masterHead: enhancement/AutoAliases2


📝 Commits (1)

  • 713e5ed Mailbox Automatic Aliases 2.0

📊 Changes

5 files changed (+436 additions, -227 deletions)

View changed files

📝 application/configs/application.ini.dist (+3 -12)
📝 application/configs/application.ini.vagrant (+14 -8)
📝 application/controllers/AliasController.php (+1 -1)
📝 application/controllers/MailboxController.php (+14 -10)
📝 application/plugins/MailboxAutomaticAliases.php (+404 -196)

📄 Description

Refactors @mfechner's ViMbAdminPlugin_MailboxAutomaticAliases. The new plugin is fully backwards compatible, but adds a whole lot of flexibility.

One can now use plain usernames as default mapping (defaultMapping.abuse = "postmaster" creates an alias abuse@example.com -> postmaster@example.com), as well as domain wildcards (defaultMapping.abuse = "@example.net" creates an alias abuse@example.com -> abuse@example.net). Additionally there's a wildcard mapping to simplify configuration (defaultMapping.* = "root@example.com" causes all automatic aliases without explicit default mapping to redirect to root@example.com). The plugin will furthermore respect full domain aliases (@example.com -> @example.net), bypassing the need to create distinct automatic aliases, since they are caught by the domain alias anyway.

Protection rules are now fully enforced. Next to preventing domain admins to delete mailboxes that are used as goto address for an automatic alias, the plugin now enforces the same when disabling a mailbox, and when deleting or disabling another alias that is used as goto address. The plugin no longer relies on the default mappings for these checks, but actually checks the alias' goto address. As before, the actual automatic aliases are protected as well. The same now applies to domain aliases when there are no distinct automatic aliases.

Please note that protection rules aren't enforced recursively and not accross domain boundaries. These checks didn't exist before and IMHO aren't really worth the effort.

Also adds the mailbox_toggleActive_preToggle event and fixes the output of the alias_toggleActive_preToggle event.

Also see #179


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/opensolutions/ViMbAdmin/pull/290 **Author:** [@PhrozenByte](https://github.com/PhrozenByte) **Created:** 7/20/2022 **Status:** ✅ Merged **Merged:** 2/23/2023 **Merged by:** [@barryo](https://github.com/barryo) **Base:** `master` ← **Head:** `enhancement/AutoAliases2` --- ### 📝 Commits (1) - [`713e5ed`](https://github.com/opensolutions/ViMbAdmin/commit/713e5edc5df9b6636e62643f02f0cfcfdad365a3) Mailbox Automatic Aliases 2.0 ### 📊 Changes **5 files changed** (+436 additions, -227 deletions) <details> <summary>View changed files</summary> 📝 `application/configs/application.ini.dist` (+3 -12) 📝 `application/configs/application.ini.vagrant` (+14 -8) 📝 `application/controllers/AliasController.php` (+1 -1) 📝 `application/controllers/MailboxController.php` (+14 -10) 📝 `application/plugins/MailboxAutomaticAliases.php` (+404 -196) </details> ### 📄 Description Refactors @mfechner's `ViMbAdminPlugin_MailboxAutomaticAliases`. The new plugin is fully backwards compatible, but adds a whole lot of flexibility. One can now use plain usernames as default mapping (`defaultMapping.abuse = "postmaster"` creates an alias abuse@example.com -> postmaster@example.com), as well as domain wildcards (`defaultMapping.abuse = "@example.net"` creates an alias abuse@example.com -> abuse@example.net). Additionally there's a wildcard mapping to simplify configuration (`defaultMapping.* = "root@example.com"` causes all automatic aliases without explicit default mapping to redirect to root@example.com). The plugin will furthermore respect full domain aliases (@example.com -> @example.net), bypassing the need to create distinct automatic aliases, since they are caught by the domain alias anyway. Protection rules are now fully enforced. Next to preventing domain admins to delete mailboxes that are used as goto address for an automatic alias, the plugin now enforces the same when disabling a mailbox, and when deleting or disabling another alias that is used as goto address. The plugin no longer relies on the default mappings for these checks, but actually checks the alias' goto address. As before, the actual automatic aliases are protected as well. The same now applies to domain aliases when there are no distinct automatic aliases. Please note that protection rules aren't enforced recursively and not accross domain boundaries. These checks didn't exist before and IMHO aren't really worth the effort. Also adds the `mailbox_toggleActive_preToggle` event and fixes the output of the `alias_toggleActive_preToggle` event. Also see #179 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 10:30:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#311
No description provided.