roundcube on virtualmin GPL

5 posts / 0 new
Last post
#1 Sat, 03/28/2009 - 15:45
mrbrdo

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 main.inc.php 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; [/code:1] This basically makes it domain.com when accessing by http://www.domain.com/roundcube-webmail

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 "jonas.domain@domain.com" instead of "jonas@domain.com".

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

Thanks!

Sat, 03/28/2009 - 15:50
mrbrdo

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

Sat, 03/28/2009 - 16:28 (Reply to #2)
andreychek

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 :-)

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".
-Eric

Sat, 03/28/2009 - 20:55 (Reply to #3)
mrbrdo

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 "username@domain.com", 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?

Tue, 06/30/2009 - 17:56 (Reply to #4)
clwheatley

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:
    strip_newlines($user_name),
    to:
    strip_newlines($user_email),

  • version .2-stable lines 389 and 402 from:
    strip_newlines($user_name),
    to:
    strip_newlines($user_email),

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,

Chris

Topic locked