Merge pull request #1036 from cm-schl/master

Rewrite of plugin ldap-mail-accounts
This commit is contained in:
the-djmaze 2023-03-21 15:53:30 +01:00 committed by GitHub
commit 68cf58e9da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 212 additions and 53 deletions

View file

@ -46,25 +46,92 @@ class LdapMailAccounts
$this->Connect();
}
/**
* @inheritDoc
*
* AOverwrite the MainAccount mail address by looking up the new one in the ldap directory
*
* The ldap search string has to be configured in the plugin configuration of the extension (in the SnappyMail Admin Panel)
*
* @param string &$sEmail
* @param string &$sLogin
*/
public function overwriteEmail(&$sEmail, &$sLogin)
{
try {
$this->EnsureBound();
} catch (LdapMailAccountsException $e) {
return false; // exceptions are only thrown from the handle error function that does logging already
}
// Try to get account information. IncLogin() returns the username of the user
// and removes the domainname if this was configured inside the domain config.
$username = $sEmail;
$oActions = \RainLoop\Api::Actions();
$oDomain = $oActions->DomainProvider()->Load(\MailSo\Base\Utils::GetDomainFromEmail($sEmail), true);
if ($oDomain->IncShortLogin()){
$username = @ldap_escape($this->RemoveEventualDomainPart($sEmail), "", LDAP_ESCAPE_FILTER);
}
$searchString = $this->config->search_string;
// Replace placeholders inside the ldap search string with actual values
$searchString = str_replace("#USERNAME#", $username, $searchString);
$searchString = str_replace("#BASE_DN#", $this->config->base, $searchString);
$this->logger->Write("ldap search string after replacement of placeholders: $searchString", \LOG_NOTICE, self::LOG_KEY);
try {
$mailAddressResults = $this->FindLdapResults(
$this->config->field_search,
$searchString,
$this->config->base,
$this->config->objectclass,
$this->config->field_name,
$this->config->field_username,
$this->config->field_domain,
true,
$this->config->field_mail_address_main_account,
);
}
catch (LdapMailAccountsException $e) {
return false; // exceptions are only thrown from the handle error function that does logging already
}
if (count($mailAddressResults) < 1) {
$this->logger->Write("Could not find user $username in LDAP! Overwriting of main mail address not possible.", \LOG_NOTICE, self::LOG_KEY);
return false;
}
foreach($mailAddressResults as $mailAddressResult)
{
if($mailAddressResult->username === $username) {
//$sLogin is already set to be the same as $sEmail by function "resolveLoginCredentials" in /RainLoop/Actions/UserAuth.php
//that called this hook, so we just have to overwrite the mail address
$sEmail = $mailAddressResult->mailMainAccount;
}
}
}
/**
* @inheritDoc
*
* Add additional mail accounts to the given primary account by looking up the ldap directory
*
* The ldap lookup has to be configured in the plugin configuration of the extension (in the SnappyMail Admin Panel)
* The ldap search string has to be configured in the plugin configuration of the extension (in the SnappyMail Admin Panel)
*
* @param MainAccount $oAccount
* @return bool true if additional accounts have been added or no additional accounts where found in . false if an error occured
* @return bool true if additional accounts have been added or no additional accounts where found in ldap. false if an error occured
*/
public function AddLdapMailAccounts(MainAccount $oAccount): bool
{
try {
$this->EnsureBound();
} catch (LdapMailAccountsException $e) {
return false; // exceptions are only thrown from the handleerror function that does logging already
return false; // exceptions are only thrown from the handle error function that does logging already
}
// Try to get account information. Login() returns the username of the user
// Try to get account information. IncLogin() returns the username of the user
// and removes the domainname if this was configured inside the domain config.
$username = @ldap_escape($oAccount->IncLogin(), "", LDAP_ESCAPE_FILTER);
@ -84,11 +151,13 @@ class LdapMailAccounts
$this->config->objectclass,
$this->config->field_name,
$this->config->field_username,
$this->config->field_domain
$this->config->field_domain,
false,
$this->config->field_mail_address_additional_account
);
}
catch (LdapMailAccountsException $e) {
return false; // exceptions are only thrown from the handleerror function that does logging already
return false; // exceptions are only thrown from the handle error function that does logging already
}
if (count($mailAddressResults) < 1) {
$this->logger->Write("Could not find user $username", \LOG_NOTICE, self::LOG_KEY);
@ -109,7 +178,7 @@ class LdapMailAccounts
$aAccounts = $oActions->GetAccounts($oAccount);
//Search for accounts with suffix " (LDAP)" at the end of the name that where created by this plugin and initially remove them from the
//Search for accounts with suffix " (LDAP)" at the end of the name that were created by this plugin and initially remove them from the
//account array. This only removes the visibility but does not delete the config done by the user. So if a user looses access to a
//mailbox the user will not see the account anymore but the configuration can be restored when the user regains access to it
foreach($aAccounts as $key => $aAccount)
@ -125,31 +194,35 @@ class LdapMailAccounts
$sUsername = $mailAddressResult->username;
$sDomain = $mailAddressResult->domain;
$sName = $mailAddressResult->name;
$sEmail = $mailAddressResult->mailAdditionalAccount;
//Check if the domain of the found mail address is in the list of configured domains
if ($oActions->DomainProvider()->Load($sDomain, true))
{
//only execute if the found account isn't already in the list of additional accounts
//and if the found account is different from the main account
if (!isset($aAccounts["$sUsername@$sDomain"]) && $oAccount->Email() !== "$sUsername@$sDomain")
//and if the found account is different from the main account.
//The check if the address is different from the one of the main account when using the Nextcloud integration needs
//to be done twice: directly on the mail address (when Nextcloud is configured to log the user in by mail address)
//or on "$sUsername@$sDomain" for the case Nextcloud logs the user in to SnappyMail by his username and a default domain.
if (!isset($aAccounts[$sEmail]) && $oAccount->Email() !== $sEmail && $oAccount->Email() !== "$sUsername@$sDomain")
{
//Try to login the user with the same password as the primary account has
//if this fails the user will see the new mail addresses but will be asked for the correct password
$sPass = $oAccount->IncPassword();
//After creating the accounts here $sUsername is used as username to login to the IMAP server (see Account.php)
$oNewAccount = RainLoop\Model\AdditionalAccount::NewInstanceFromCredentials($oActions, $sEmail, $sUsername, $sPass);
$oNewAccount = RainLoop\Model\AdditionalAccount::NewInstanceFromCredentials($oActions, "$sUsername@$sDomain", $sUsername, $sPass);
$aAccounts["$sUsername@$sDomain"] = $oNewAccount->asTokenArray($oAccount);
$aAccounts[$sEmail] = $oNewAccount->asTokenArray($oAccount);
}
//Always inject/update the found mailbox names into the array (also if the mailbox already existed)
if (isset($aAccounts["$sUsername@$sDomain"]))
if (isset($aAccounts[$sEmail]))
{
$aAccounts["$sUsername@$sDomain"]['name'] = $sName . " (LDAP)";
$aAccounts[$sEmail]['name'] = $sName . " (LDAP)";
}
}
else {
$this->logger->Write("Domain $sDomain is not part of configured domains in SnappyMail Admin Panel - mail address $sUsername@$sDomain will not be added.", \LOG_NOTICE, self::LOG_KEY);
$this->logger->Write("Domain $sDomain is not part of configured domains in SnappyMail Admin Panel - mail address $sEmail will not be added.", \LOG_NOTICE, self::LOG_KEY);
}
}
@ -264,6 +337,8 @@ class LdapMailAccounts
* @param string $nameField
* @param string $usernameField
* @param string $domainField
* @param bool $overwriteMailMainAccount true if the mail address of the main account should be looked up for overwriting. false if additional mail accounts should be searched
* @param string $mailAddressField The field containing the mail address (of main account or additional mail account)
* @return LdapMailAccountResult[]
* @throws LdapMailAccountsException
*/
@ -274,7 +349,9 @@ class LdapMailAccounts
string $objectClass,
string $nameField,
string $usernameField,
string $domainField): array
string $domainField,
bool $overwriteMailMainAccount,
string $mailAddressField): array
{
$this->EnsureBound();
$nameField = strtolower($nameField);
@ -282,9 +359,12 @@ class LdapMailAccounts
$domainField = strtolower($domainField);
$filter = "(&(objectclass=$objectClass)($searchField=$searchString))";
$this->logger->Write("Used ldap filter to search for additional mail accounts: $filter", \LOG_NOTICE, self::LOG_KEY);
$this->logger->Write("Used ldap filter to search for mail account(s): $filter", \LOG_NOTICE, self::LOG_KEY);
$ldapResult = @ldap_search($this->ldap, $searchBase, $filter, ['dn', $usernameField, $nameField, $domainField]);
//Set together the attributes to search inside the LDAP
$ldapAttributes = ['dn', $usernameField, $nameField, $domainField, $mailAddressField];
$ldapResult = @ldap_search($this->ldap, $searchBase, $filter, $ldapAttributes);
if (!$ldapResult) {
$this->HandleLdapError("Fetch $objectClass");
return [];
@ -311,6 +391,13 @@ class LdapMailAccounts
$result->domain = $this->LdapGetAttribute($entry, $domainField, true, true);
$result->domain = $this->RemoveEventualLocalPart($result->domain);
if($overwriteMailMainAccount) {
$result->mailMainAccount = $this->LdapGetAttribute($entry, $mailAddressField, true, true);
}
else {
$result->mailAdditionalAccount = $this->LdapGetAttribute($entry, $mailAddressField, true, true);
}
$results[] = $result;
}
@ -407,4 +494,10 @@ class LdapMailAccountResult
/** @var string */
public $domain;
/** @var string */
public $mailMainAccount;
/** @var string */
public $mailAdditionalAccount;
}

View file

@ -18,6 +18,9 @@ class LdapMailAccountsConfig
public const CONFIG_FIELD_USERNAME = "field_username";
public const CONFIG_SEARCH_STRING = "search_string";
public const CONFIG_FIELD_MAIL_DOMAIN = "field_domain";
public const CONFIG_FIELD_MAIL_ADDRESS_ADDITIONAL_ACCOUNT = "field_mail_address_additional_account";
public const CONFIG_BOOL_OVERWRITE_MAIL_ADDRESS_MAIN_ACCOUNT = "bool_overwrite_mail_address_main_account";
public const CONFIG_FIELD_MAIL_ADDRESS_MAIN_ACCOUNT = "field_mail_address_main_account";
public $server;
public $protocol;
@ -30,6 +33,9 @@ class LdapMailAccountsConfig
public $field_username;
public $search_string;
public $field_domain;
public $field_mail_address_main_account;
public $field_mail_address_additional_account;
public $bool_overwrite_mail_address_main_account;
public static function MakeConfig(Plugin $config): LdapMailAccountsConfig
{
@ -45,6 +51,9 @@ class LdapMailAccountsConfig
$ldap->field_username = trim($config->Get("plugin", self::CONFIG_FIELD_USERNAME));
$ldap->search_string = trim($config->Get("plugin", self::CONFIG_SEARCH_STRING));
$ldap->field_domain = trim($config->Get("plugin", self::CONFIG_FIELD_MAIL_DOMAIN));
$ldap->field_mail_address_additional_account = trim($config->Get("plugin", self::CONFIG_FIELD_MAIL_ADDRESS_ADDITIONAL_ACCOUNT));
$ldap->bool_overwrite_mail_address_main_account = $config->Get("plugin", self::CONFIG_BOOL_OVERWRITE_MAIL_ADDRESS_MAIN_ACCOUNT);
$ldap->field_mail_address_main_account = trim($config->Get("plugin", self::CONFIG_FIELD_MAIL_ADDRESS_MAIN_ACCOUNT));
return $ldap;
}

View file

@ -4,6 +4,10 @@
This plugin can be used to add additional mail accounts to SnappyMail when a user logs in successfully. The list of additional accounts is retrieved by a ldap query that can be configured inside the plugin settings.\
On a successful login the username of the SnappyMail user is passed to the plugin and will be searched in the ldap. If additional mail accounts are found, the username and domain-part of those will be used to add the new mail account. The plugin tries to log in the user with the same password used to login to SnappyMail - if this fails SnappyMail asks the user to insert his credentials.
Version 2.0.0 changes the way additional mail accounts get their e-mail address: the mail address connected with additional mail accounts is now always the address found inside the ldap.
Now it is also possible to overwrite the mail address of the main account: if a user logs into SnappyMail with a username and SnappyMail added the configured default domain the mail address of the main account could have been some not existing address like "username@default-domain.com". This could have happend when using the Nextcloud SnappyMail integration that offers an automatic login using the Nextcloud username.
The plugin now can be configured to overwrite the username or mail address used at login with a mail address found inside ldap.
### Configuration
- Install and activate the plugin using the SnappyMail Admin Panel -> menu Extensions.
- Click on the gear symbol beside the plugin to open the configration dialog.
@ -11,7 +15,9 @@ On a successful login the username of the SnappyMail user is passed to the plugi
- The fields `Object class`, `Base DN`, `Search field` and `LDAP search string` are used to put together a ldap search filter which will return the additional mail accounts of a user:\
`(&(objectclass=<YOUR OBJECT CLASS>)(<YOUR SEARCH FIELD>=<YOUR SEARCH STRING>))`.\
This filter will be executed on the `Base DN` you have defined. `LDAP search string` can contain the placeholders `#USERNAME#` (will be replaced with the username the user logged in to Snappymail) and `#BASE_DN#` (will be replaced with the value you inserted into the field `Base DN` inside the plugin settings). This will allow you to create more complex search strings like `uid=#USERNAME#`.
- `Username field of additional account`, `Domain name field of additional account` and `Additional account name field` are used to define the ldap attributes to read when the ldap search was successful. For example insert `mail` into the `Username field of additional account` and the `Domain name field of additional account` to use the [local-part](https://en.wikipedia.org/wiki/Email_address#Local-part) of the mail address as username and the [domain-part](https://en.wikipedia.org/wiki/Email_address#Domain) as domain for the additional account.\
`Username field of additional account` and `Domain name field of additional account` before use get checked by the plugin if they contain a mail address and if true only the local-part or domain-part is returned. If no `@` is found the content of the found ldap attribute is returned without modification. This can be usefull if your user should login with something different than the mail address (a username that is diffrent from the local-part of the mail address).
- `Username field`, `Domain name field of additional account`, `Mail address field for additional account` and `Additional account name field` are used to define the ldap attributes to read when the ldap search was successful. For example insert `mail` into the `Username field` and the `Domain name field of additional account` to use the [local-part](https://en.wikipedia.org/wiki/Email_address#Local-part) of the mail address as username and the [domain-part](https://en.wikipedia.org/wiki/Email_address#Domain) as domain for the additional account.\
`Username field` and `Domain name field of additional account` before use get checked by the plugin if they contain a mail address and if true only the local-part or domain-part is returned. If no `@` is found the content of the found ldap attribute is returned without modification. This can be usefull if your user should login with something different than the mail address (a username that is diffrent from the local-part of the mail address).
**Important:** keep in mind, that SnappyMail normally needs a mail address as username. In some special circumstances (login with an ldap username, not a mail address) this can mean that you have to configure the plugin to put together a 'fake' mail address like `<LDAP-USERNAME>@<YOUR-DOMAIN>`.
Section `Overwrite mail address of main account` can be used to overwrite the username or mail address used at login with a value found in ldap. If activated, the username or mail address used at login will be looked up inside the `Username field` in ldap (for details see how a search for additional accounts is made). If the username is found, the value of the field `Mail address field for main account` will be used to overwrite the mail address of the main account.
**Important:** SnappyMail normally needs a mail address as username. This plugin handles some special circumstances (login with an ldap username, not a mail address) so that you can login to your IMAP server with the ldap username but send mails with a mail address connected to this ldap user.

View file

@ -12,11 +12,11 @@ class LdapMailAccountsPlugin extends AbstractPlugin
{
const
NAME = 'LDAP Mail Accounts',
VERSION = '1.1',
VERSION = '2.0.0',
AUTHOR = 'cm-schl',
URL = 'https://github.com/cm-sch',
RELEASE = '2022-12-08',
REQUIRED = '2.23.0',
RELEASE = '2023-03-14',
REQUIRED = '2.25.4',
CATEGORY = 'Accounts',
DESCRIPTION = 'Add additional mail accounts the SnappyMail user has access to by a LDAP query. Basing on the work of FWest98 (https://github.com/FWest98).';
@ -32,6 +32,30 @@ class LdapMailAccountsPlugin extends AbstractPlugin
public function Init(): void
{
$this->addHook("login.success", 'AddAdditionalLdapMailAccounts');
$this->addHook('login.credentials', 'overwriteMainAccountEmail');
}
// Function gets called by RainLoop/Actions/UserAuth.php
/**
* Overwrite the MainAccount mail address by looking up the new one in the ldap directory
*
* @param string &$sEmail
* @param string &$sLogin
*/
public function overwriteMainAccountEmail(&$sEmail, &$sLogin)
{
$this->Manager()->Actions()->Logger()->Write("Login DATA: login: $sLogin email: $sEmail", \LOG_WARNING, "LDAP MAIL ACCOUNTS PLUGIN");
// Set up config
$config = LdapMailAccountsConfig::MakeConfig($this->Config());
if ($config->bool_overwrite_mail_address_main_account)
{
$oldapMailAccounts = new LdapMailAccounts($config, $this->Manager()->Actions()->Logger());
$oldapMailAccounts->overwriteEmail($sEmail, $sLogin);
}
$this->Manager()->Actions()->Logger()->Write("Login DATA: login: $sLogin email: $sEmail", \LOG_WARNING, "LDAP MAIL ACCOUNTS PLUGIN");
}
// Function gets called by RainLoop/Actions/User.php
@ -44,9 +68,7 @@ class LdapMailAccountsPlugin extends AbstractPlugin
{
// Set up config
$config = LdapMailAccountsConfig::MakeConfig($this->Config());
$oldapMailAccounts = new LdapMailAccounts($config, $this->Manager()->Actions()->Logger());
$oldapMailAccounts->AddLdapMailAccounts($oAccount);
}
@ -55,73 +77,102 @@ class LdapMailAccountsPlugin extends AbstractPlugin
*/
protected function configMapping(): array
{
$groupOverwriteMainAccount = new \RainLoop\Plugins\PropertyCollection('Overwrite mail address of main account');
$groupOverwriteMainAccount->exchangeArray([
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_BOOL_OVERWRITE_MAIL_ADDRESS_MAIN_ACCOUNT)->SetLabel('Enabled')
->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL)
->SetDefaultValue(false),
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_MAIL_ADDRESS_MAIN_ACCOUNT)
->SetLabel("Mail address field for main account")
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The ldap field containing the mail address to use on the SnappyMail main account.
\nThe value found inside ldap will overwrite the mail address of the SnappyMail main account (the account the user logged in at SnappyMail)
\nThe mail address used at login will still be used to login to the servers.")
->SetDefaultValue("mail"),
]);
return [
Property::NewInstance(LdapMailAccountsConfig::CONFIG_SERVER)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_SERVER)
->SetLabel("LDAP Server URL")
->SetPlaceholder("ldap://server:port")
->SetType(PluginPropertyType::STRING),
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_PROTOCOL_VERSION)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_PROTOCOL_VERSION)
->SetLabel("LDAP Protocol Version")
->SetType(PluginPropertyType::SELECTION)
->SetType(RainLoop\Enumerations\PluginPropertyType::SELECTION)
->SetDefaultValue([2, 3]),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_BIND_USER)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_BIND_USER)
->SetLabel("LDAP Username")
->SetDescription("The user to use for binding to the LDAP server. Should be a DN or RDN. Leave empty for anonymous bind.")
->SetType(PluginPropertyType::STRING),
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_BIND_PASSWORD)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_BIND_PASSWORD)
->SetLabel("LDAP Password")
->SetDescription("Leave empty for anonymous bind.")
->SetType(PluginPropertyType::PASSWORD),
->SetType(RainLoop\Enumerations\PluginPropertyType::PASSWORD),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_OBJECTCLASS)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_OBJECTCLASS)
->SetLabel("Object class")
->SetType(PluginPropertyType::STRING)
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The object class to use when searching for additional mail accounts of the logged in SnappyMail user")
->SetDefaultValue("user"),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_BASE)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_BASE)
->SetLabel("Base DN")
->SetType(PluginPropertyType::STRING)
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The base DN to search in for additional mail accounts of the logged in SnappyMail user"),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_SEARCH)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_SEARCH)
->SetLabel("Search field")
->SetType(PluginPropertyType::STRING)
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The name of the ldap attribute that has to contain the here defined 'LDAP search string'.")
->SetDefaultValue("member"),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_SEARCH_STRING)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_SEARCH_STRING)
->SetLabel("LDAP search string")
->SetType(PluginPropertyType::STRING)
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The search string used to find ldap objects of mail accounts the user has access to.
\nPossible placeholers:\n#USERNAME# - replaced with the username of the actual SnappyMail user
\n#BASE_DN# - replaced with the value inside the field 'User base DN'.")
->SetDefaultValue("uid=#USERNAME#"),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_USERNAME)
->SetLabel("Username field of additional account")
->SetType(PluginPropertyType::STRING)
->SetDescription("The field containing the username of the found additional mail account.
\nThis username gets used by SnappyMail to login to the additional mail account.
\nIf this field contains an email address, only the local-part before the @ is used.")
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_USERNAME)
->SetLabel("Username field")
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("Used when searching for additional accounts or when overwriting the mail address of the main account.
\nThe field containing the username of the mail account.
\nWhen looking up additional accounts:
\nIf this field contains an email address, only the local-part before the @ is used. The domain part is retrieved configuring the field below. This username gets used by SnappyMail to login to the additional mail account
\nWhen overwriting the main account mail address:
\nThe username from SnappyMail login gets used to search an LDAP entry containig a field with the same username.")
->SetDefaultValue("uid"),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_MAIL_DOMAIN)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_MAIL_DOMAIN)
->SetLabel("Domain name field of additional account")
->SetType(PluginPropertyType::STRING)
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The field containing the domain name of the found additional mail account.
\nThis domain gets looked up by SnappyMail to choose the right connection parameters at logging in to the additional mail account.
\nIf this field contains an email address, only the domain-part after the @ is used.")
->SetDefaultValue("mail"),
Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_NAME)
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_MAIL_ADDRESS_ADDITIONAL_ACCOUNT)
->SetLabel("Mail address field for additional account")
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The ldap field containing the mail address to use on the found additional mail account.
\nThe value found inside ldap will be used as mail address of the additional mail accounts created by this plugin.
\nIn most cases this could be the same ldap field as in \"Domain name field of additional account\"")
->SetDefaultValue("mail"),
\RainLoop\Plugins\Property::NewInstance(LdapMailAccountsConfig::CONFIG_FIELD_NAME)
->SetLabel("Additional account name field")
->SetType(PluginPropertyType::STRING)
->SetType(RainLoop\Enumerations\PluginPropertyType::STRING)
->SetDescription("The field containing the default sender name of the found additional mail account.")
->SetDefaultValue("displayName")
->SetDefaultValue("displayName"),
$groupOverwriteMainAccount
];
}
}