ViMbAdmin icon indicating copy to clipboard operation
ViMbAdmin copied to clipboard

Mailbox Automatic Aliases 2.0

Open PhrozenByte opened this issue 2 years ago • 1 comments

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 [email protected] -> [email protected]), as well as domain wildcards (defaultMapping.abuse = "@example.net" creates an alias [email protected] -> [email protected]). Additionally there's a wildcard mapping to simplify configuration (defaultMapping.* = "[email protected]" causes all automatic aliases without explicit default mapping to redirect to [email protected]). 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

PhrozenByte avatar Jul 20 '22 18:07 PhrozenByte

Quite hard to believe this was 6 years ago @mfechner... :+1:

By using wildcard mapping (e.g. defaultMapping.* = "[email protected]") 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 = "[email protected]"
vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.* = "admin"

PhrozenByte avatar Jul 20 '22 18:07 PhrozenByte