roundcube on virtualmin GPL

I’ve installed roundcube on my ubuntu server. It seems to work well with a few problems:

  • i have to enter the domain at login, but i fixed this in with:

[code:1]$sn = $_SERVER[‘SERVER_NAME’];
$t = substr($sn, 0, strrpos($sn, ‘.’));
$pos = strpos($t, ‘.’);
if ($pos !== false) $sn = substr($sn, $pos+1);
$rcmail_config[‘default_host’] = $sn;
This basically makes it when accessing by

The problem i’m having now is with the usernames that Virtualmin makes. For example, I make a new (email/ftp) user for a domain, and i name him “jonas”. It makes the username “jonas.domain”. I can log in, but roundcube then displays the sender as “” instead of “”.

Any ideas how to fix this? Also is it possible for "jonas.domain" to login as "jonas", so as to avoid confusion with customers?


duplicate,ignore<br><br>Post edited by: mrbrdo, at: 2009/03/28 20:57

Well, "jonas.domain" is the username on the system, and RoundCube is correctly using the system names for authentication.

The way to fix that would be to generate different usernames :slight_smile:

You can tweak how Virtualmin names them by looking at System Settings -> Module Config -> Defaults for new domains, and change "Include domain name in usernames" to be "Only to avoid a clash".

Well, with those settings i pasted above, it works ok for ‘additional’ users (they have to login with username.domain, but i can live with that). The problem is the first user that virtualmin adds by itself does not have the domain suffix, but the even bigger problem is that if you login to roundcube using that username, the ‘sender’ email is set to “username@localhost”.
With the other names it works correctly as “”, i think because of the line in config:

[code:1]$rcmail_config[‘virtuser_file’] = ‘/etc/postfix/virtual’;[/code:1]

So any idea how to make it work with the first username aswell?

If you are using Postfix and have “Domain mapping lookup tables” set to hash:/etc/postfix/virtual (default I believe), then there isn’t much you can do since the virtual alias table has only two entries per address, the email address and the username that is by default formatted as user.domain. Roundcube is reading this table to get its information regarding the email account. As was already mentioned, it is reading this correctly.

What I did to get around this problem was to edit program/include/rcube_user.php and change:

  • version 0.2.2
    line 389 from:




  • version .2-stable
    lines 389 and 402 from:




What this does is force the identity to use the email address since RoundCube cannot know based on the virtual alias table what the identity should really be

Hope that helps,