Hi Gordon,
I have traced this issue and found what needs to be done.
In webmail/imp/config/hooks.php, there is this function which is disabled/commented out by default:
// if (!function_exists('_imp_hook_vinfo')) {
// function _imp_hook_vinfo($type = 'username')
// {
// $vdomain = getenv('HTTP_HOST');
// $vdomain = preg_replace('|^mail\.|i', '', $vdomain);
// $vdomain = String::lower($vdomain);
//
// if ($type == 'username') {
// return preg_replace('|\.|', '_', $_SESSION['imp']['user'] . '_' . $vdomain);
// } elseif ($type == 'vdomain') {
// return $vdomain;
// } else {
// return PEAR::raiseError('invalid type: ' . $type);
// }
// }
// }
If you need virtual domain users to login, using just username instead of username@domain, there are a number of things to consider.
1. If you use one virtual host for all the domains you host, then each domain will need to have a DNS A record, like
webmail.DOMAIN.NAME
2. IIRC, this will require Apache to use NameVirtualHost *:PORT and ALL
webmail.DOMAIN.NAME will have to point to this vhost.
This line:
$vdomain = preg_replace('|^mail\.|i', '', $vdomain);
Should then be changed to:
$vdomain = preg_replace('|^webmail\.|i', '', $vdomain);
And this line:
return preg_replace('|\.|', '_', $_SESSION['imp']['user'] . '_' . $vdomain);
Should be made to look like:
return preg_replace('|\.|', '.', $_SESSION['imp']['user'] . '@' . $vdomain);
Actually, I see that what that line does is that it replaces @ with and underscore and any dots in the domain portion with and underscore too.
Such that if I went to
http://webmail.wash.or.ke (which is the root for my webmail tree) and I put in the username johndoe, then what is submitted by IMP to the IMAP server as the login name becomes johndoe_wash_or_ke. I don't know why they do this (perhaps some security issue) but I changed mine as shown, so that the login name submitted is
johndoe@wash.or.ke
3. You also need to edit webmail/imp/config/conf.php line 50 and change this line:
�� �� $conf['hooks']['vinfo'] = false;
To ��$conf['hooks']['vinfo'] = true;
Someone needs to tell me the danger posed by my having��return preg_replace('|\.|', '.', $_SESSION['imp']['user'] . '@' . $vdomain);
I just did not need the replacements and to be honest I don't understand the dangers of doing this.
Someone who knows php better should tell me.
PS: I don't know if these changes affect the other groupware components. Someone should tell me:-)
--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254733744121/+254722743223
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Damn!!