Override domain settings

This plugin is for version 7 of the product and has not been ported to version 8 yet. We'll eventually be rewriting the existing plugins to v8 platform, please let us know if you require this particular plugin there.
To find out which plugins have already been ported to v8, click here.

This plugin allows for supplying custom configuration for the domain used.

Upon downloading and extracting plugin package, rename its main directory from:

plugin-override-domain-settings-master

to:

override-domain-settings

Then you'll need to deploy the plugin so that its index file is available at the following location:

data/plugins/override-domain-settings/index.php

To enable the plugin, add the following to array defined in data/settings/config.php file:

'plugins.override-domain-settings' => true, 

By default, plugin contains the following sample code:

$oAccount->Domain->AllowUsersAddNewAccounts = false;
$oAccount->Domain->AllowUsersChangeEmailSettings = false;

which disallows users to add new accounts or change account access settings.

Certainly, you can replace that code with anything else according to your requirements. You might need to apply custom settings depending on domain, which can be obtained as follows:

$sEmailDomain = api_Utils::GetDomainFromEmail($oAccount->Email);

Note that the plugin only takes effect when account is created on first login, so if the account already exists in WebMail database, no changes will be made to it, you would need to delete the account first for custom changes to apply for it.