Author Topic: Usernames in DB advice.  (Read 2343 times)

Offline rdugaue

  • Newbie
  • *
  • Posts: 2
Usernames in DB advice.
« on: May 03, 2013, 03:16:12 PM »
I have a minor issue with the way RC is creating usernames in the DB.

Here's my general layout.

One roundcube installation.
Two mail servers, one that is specific for a single domain, the other for virtual domains.

I'm using the include_host_config option to load different configs based on hostname.

For the single domain my configs are:
$rcmail_config['default_host'] = 'domain.tld';
$rcmail_config['username_domain'] = '';

Because the mail server/imap doesn't need a domain name this works fine. My DB entries for this host are fine, IE say I have a user of "myname". The DB record for username field is "myname" and "domain.tld" for the host field.

---
Now for the 2nd situation, the other server that has multiple domains needs the domain as part of the username to login. A sample config for one of those domains:

$rcmail_config['default_host'] = 'domain.tld';
$rcmail_config['username_domain'] = 'domain.tld';

Logins work, however, with the username_domain field used the DB entry in the users table now becomes:

username: myname@domain.tld
hostname: domain.tld

It is a minor issue, but is there someway to make it so the username in DB is just the "myname" without domain.tld like is being created with the first server?

--

« Last Edit: May 03, 2013, 04:10:12 PM by rdugaue »