Athanaƫl Guitard wrote:
Hi RCU,
I've just found a problem with my multi domains install of RCU 0.8.4 on my dedicte server (gentoo@OVH)... RCU is installed on a vhost which is pointed by many sub domains lets say 100 sub domains formed like this wm.domain.net, wm.dn2.org, wm.site42.fr, wm.nota1337.com, etc...
Do you have configured 'default_host' as array or do you use host-specific config files for Roundcube?
People can login for any email adresse using any of this sub domains, example : login for contact@domain.net through wm.domain.netAND wm.dn2.org ; and this is what I need (some of my clients have multiples sites but will stay ont the same host for both, ...)
Problem is in the user account management, when some one logs in for contact@domain.net through wm.domain.net and then throughwm.dn2.org this creates 2 distincts users in the DB (table users) :
- user_id = 1 | username =contact@domain.net |mail_host = domain.net
- user_id = 2 | username = contact@domain.net | mail_host = dn2.org
If both of these logins are same account, I assume all email accounts are hosted on one IMAP server which serves all domains. If this is the case, you should use host-specific configs [1] and set 'default_host' to a fixed host name.
I don't know exactly what is the use of the mail_host in DB but what would be perfect is either to ignore the mail_host when loging (and have a unique constraint on the username DB field) or to use a mail_host from the mail used as login instead of the host on which the user is...
One Roundcube instance can connect to multiple IMAP servers and some email systems do not use full email addresses as usernames for IMAP logins. This is where mail_host is used to distinguish such accounts. Roundcube needs to know to which host it has to connect. That isn't necessarily the host from the email address.
I've spend hours on this without finding any lead on how to configure RCU to have "uniques accounts" no matter what the host is... Is anyone having a clue for me ?
See above. Set 'default_host' to a fixed value in your config(s). This is what goes into the mail_host field.
If you still want users to be able to log-in with a short username (e.g. contact instead of contact@dn2.org) on wm.dn2.org, you can set the 'username_domain' config option to dn2.org. This is automatically appended to the username isn't a full email address.
Regards, Thomas
[1] http://trac.roundcube.net/wiki/Howto_Config#AlternateSolutionfortheMultipleH...