Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: robmorin on July 01, 2015, 02:51:28 PM

Title: One instance of Roundcube with 2 IMAP servers?
Post by: robmorin on July 01, 2015, 02:51:28 PM
Hello all, I have searching around to accomplish the below, but the more i searched the more i got confused...lol

So i have my roundcube setup on a web server, the main.inc.php is setup like so...

$rcmail_config['default_host'] = 'mail2.domain.com';

So currently my webserver(web2.domain.com) goes to mail2.domain.com for the email, all works great.

Now i have another a special domain, lets say special.com, this is hosted on mail.domain.com. I would like that if the user logs on with [email protected] that roundcube goes to mail.domain.com for the email rather than my default host of mail2.domain.com

I think its possible via the $rcmail_config[;default_host'] but not sure how to config it?

Any suggestions??

Thanks , and to all a great day!

Rob
Montreal, Canada

Thanks..
Title: Re: One instance of Roundcube with 2 IMAP servers?
Post by: SKaero on July 02, 2015, 12:21:34 AM
First I'd recommend that you upgrade Roundcube, your clearly using an old version since main.inc.php is no longer used. Here are the configuration options for the default_host config option, I think %s may work for what you want to do.

// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
//          required to match old user data records with the new host.
$config['default_host'] = 'localhost';
Title: Re: One instance of Roundcube with 2 IMAP servers?
Post by: robmorin on July 02, 2015, 08:07:36 AM
Thanks for the input SKaero, i will upgrade , however that still leaves me with the same issue on how to code the default_host string.... as i have those options in the version i have now, any help is appreciated...
Title: Re: One instance of Roundcube with 2 IMAP servers?
Post by: SKaero on July 02, 2015, 05:08:59 PM
Wouldn't %s work for what you want to do?
Title: Re: One instance of Roundcube with 2 IMAP servers?
Post by: robmorin on July 03, 2015, 01:30:17 PM
can you be a bit more specific, i am not a roundcube guru... lol 

Right now i only have my maill server hostname in

$rcmail_config['default_host'] = 'mail2.domain.com';

So what would the syntax be and how does it know to go to the other imap server and not localhost?

Thanks..
Title: Re: One instance of Roundcube with 2 IMAP servers?
Post by: SKaero on July 14, 2015, 12:44:49 AM
%s takes the domain from the email address that is entered on the login form, so for example if [email protected] was entered %s would be replaced with example.com.