Skip to content

Mailbox Automatic Aliases 2.0#290

Merged
barryo merged 1 commit intoopensolutions:masterfrom
PhrozenByte:enhancement/AutoAliases2
Feb 23, 2023
Merged

Mailbox Automatic Aliases 2.0#290
barryo merged 1 commit intoopensolutions:masterfrom
PhrozenByte:enhancement/AutoAliases2

Conversation

@PhrozenByte
Copy link
Copy Markdown
Contributor

@PhrozenByte PhrozenByte commented Jul 20, 2022

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

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.
@PhrozenByte
Copy link
Copy Markdown
Contributor Author

Quite hard to believe this was 6 years ago @mfechner... 👍

By using wildcard mapping (e.g. defaultMapping.* = "root@example.com") one can assure that the plugin never assumes the first created mailbox or alias to be an administrative address. This solves the concerns I had 6 years ago.

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"

@barryo barryo merged commit 91cd43d into opensolutions:master Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants