I have users from many different domains logging into Roundcube webmail. Because of this I left this blank in main.inc.php:
$rcmail_config['default_host'] = '';
The problem is users find this really confusing when they have an emails address, password and host to fill out during the log in page. What I'd like to do is get the domain from the email loggin and place is in the $rcmail_config['default_host'] value. So for example, when someone logs in as
john@fundomain.com, the host should automatically be valued at fundomain.com.
In the wiki it says:
// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
// $serverut = $_SERVER['SERVER_NAME']; <<< get the server name example
http://www.site.com// $wsrt = '
http://www.'; <<< string to replace
// $serverput = str_replace($wsrt,'',$serverut); <<< replace the host address deleting the www in this case
// $rcmail_config['username_domain'] = $serverput; <<< and the var is ready!
The problem with this is that SERVER_NAME is already figured out before the users fills it their information. I want to fill the host value after the user has filled their information. How would I implement this?