WebMail Pro 7 documentation

Custom mapping of email address to login

By default, WebMail Pro uses email address as login for mail server. It's also possible to get username as part of email address before @ character and use it as login.

If none of these suits your needs, there's one more option - you can use Change email-to-username mapping on login plugin which allows for custom email-to-login mapping.

By default, the plugin holds the code which creates mailserver login by taking email address and replacing @ with . character:

public function PluginIntegratorLoginToAccount(&$sEmail, &$sIncPassword, &$sIncLogin, &$sLanguage)
{
	if (empty($sIncLogin))
	{
		$sIncLogin = str_replace('@', '.', $sEmail);
	}
	else
	{
		$sIncLogin = str_replace('@', '.', $sIncLogin);
	}
}

You can implement any other logic of mapping email address to mailserver login. It can involve map included directly in the plugin code, or obtaiend by accessing external storage - LDAP server, MySQL database, etc.