New Roundcube identities get a '@localhost' domain part for their Email address. That is kind of useless. I would rather have Roundcube take the Apache HTTP host (minus a possible 'www.'), since my users will use 'their' associated domain for getting to the Roundcube interface. How can I configure this?

4 Answers 4


Found the solution to my problem. In the main config of roundcube (/var/lib/roundcube/config/main.inc.php) you can set the mail_domain variable:

$rcmail_config['mail_domain'] = '%d';

There are multiple placeholders, but %d will use the web server domain, which is fine for me.

  • In the current version (1.1.3), it would be $config['mail_domain'] = '%d'; in the file roundcube/config/config.inc.php.
    – mivk
    Oct 31, 2015 at 18:12

Look here:

    grep -nR -B9 mail_domain defaults.inc.php
    441-// This domain will be used to form e-mail addresses of new users
    442-// Specify an array with 'host' => 'domain' values to support multiple hosts
    443-// Supported replacement variables:
    444-// %h - user's IMAP hostname
    445-// %n - http hostname ($_SERVER['SERVER_NAME'])
    446-// %d - domain (http hostname without the first part)
    447-// %z - IMAP domain (IMAP hostname without the first part)
    448-// For example %n = mail.domain.tld, %t = domain.tld
    449:$config['mail_domain'] = '';

So, you could add

$config['mail_domain'] = '%d';

to your roundcube/config/config.inc.php file. (not to the defaults.inc.php file which may be overwritten by upgrades)


In "WHM Home » Server Configuration » Tweak Settings", under the "Mail" tab, you can disable the other Webmail clients by ensuring the following options are not selected:

"Enable Horde Webmail" "Enable SquirrelMail webmail"

Or you can directly login using the below URLS:



If proxy sub-domains are enabled, the following URLs, using the "webmail." sub-domain, will also go directly to Roundcube; replace "domain" with your cPanel account domain name:



  • The OP didn't say anything about cPanel.
    – jordanm
    Jan 9, 2014 at 20:38

this is an old thread but you should be able to set the server name using this command

dpkg-reconfigure roundcube-core

In my case I have isp3config, my server is set up as debian.example.com, my two sites are example.com and example.net.

When it asks for the server name I put in debian.example.com, if you leave it blank it will ask you the server on the log in page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.