Le 25/11/2012 20:43, Thomas Bruederli a écrit :
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?
I used %d but before my last update I remember now that I had specified a unique domain here...
So ok, corrected this and now it's working like I wanted, of course, I also remembered that I wanted to force my users typing their complete email addresses...

But I might change it soon...

I'll change the fixed default_host in config/main.inc.php to use the domain from the provided addresse at login, I think that it's the %s option.

To keep the RC accounts settings  I would have to update my DB to change the mail_host value to the host inherited from the username :
username = contact@domain.net | mail_host = mainsite.net would become : username = contact@domain.net | mail_host = domain.net

Doing so users will be allowed to use whatever configured host to acces my RC but they'll keep uniques accounts and the "legacies" for this accounts, right ?
And in bonus I would be able to use my RC install with third parties servers (gmail or whatever) but in that case I suppose that I could encounter some speific config issues...
Next step would be to combine multiple IMAP accounts in one RC account just like a local email client... Maybe already doable ?

Thanks for your precious and precise help.
(In case that could help some one to understand I answered you question bellow)

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.
Well guessed a unique dedicated server hosting a unique IMAP server...
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.
Of course ! I've forgotten that point..
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#AlternateSolutionfortheMultipleHostDomaindynamic
1KTHX