Mailbox Automatic Aliases 2.0#290
Merged
barryo merged 1 commit intoopensolutions:masterfrom Feb 23, 2023
Merged
Conversation
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.
Contributor
Author
|
Quite hard to believe this was 6 years ago @mfechner... 👍 By using wildcard mapping (e.g. I'm using this plugin myself now, too. Just for the record, here's my config: vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "abuse"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "admin"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "administrator"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "hostmaster"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "postmaster"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "root"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "security"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "webmaster"
vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.admin = "admin@example.com"
vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.* = "admin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_preToggleevent and fixes the output of thealias_toggleActive_preToggleevent.Also see #179