First of all, the quickest way (if you use a single domain) might be to follow the instructions from Brett about listing the domains in a drop down or adding a single domain to the config file. His instructions can be found here:
http://roundcubeforum.net/forum/index.php?topic=212.msg1078#msg1078However, our company hosts several domains on one server. When implementing a software such as roundcube, we like to have one central install that eases the pains of configuring and maintaining. Each domain hosted simply references the central install via sym-links.
Anyways, whether that makes sense or not, I wanted to setup a way that the login screen would figure out the mail server domain name without me having to manually set it in a config file or the user inputting it at each login. So, I basically switched out line 33 of main.inc.php with this line:
$rcmail_config['default_host'] = 'mail.' . '' . str_replace("[url]www."[/url], "", $_SERVER['HTTP_HOST']);
Basically, it takes the address in the address bar, removes the "
http://www." and adds "mail." to the beginning of the domain name.
Ex)
http://www.yourname.com to yourname.com to mail.yourname.com
I am sure this all seems very basic and straight forward to the more seasoned programmer, but I was excited about getting it to work.
We also then use the same principal to generate the SMTP server address and the username. It looks as follows:
// use this host for sending mails.
// to use SSL connection, set ssl://smtp.host.com
// if left blank, the PHP mail() function is used
$rcmail_config['smtp_server'] = 'mail.' . '' . str_replace("[url]www."[/url], "", $_SERVER['HTTP_HOST']);
// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_config['smtp_user'] = '%u' . '@' . '' . str_replace("[url]www."[/url], "", $_SERVER['HTTP_HOST']);
// SMTP password (if required) if you use %p as the password RoundCube
// will use the current user's password for login
$rcmail_config['smtp_pass'] = '%p';
Hope it helps in some way.
Kevin L.