[imp] mail domains

Edwin Culp eculp@encontacto.net
Wed, 5 Jun 2002 06:34:44 -0700


Quoting Tjeerd van der Zee <Tjeerd.vdzee@chello.nl>:

| $conf['hooks']['vinfo'] = 'imp_get_vinfo';
| 
| isn't a sollution yet since it would require both domains to have an
| aditional a-record in
| the zone file for them.
| 
| for xar.nl i can do this,
| but for aequitas.dhs.org i can't.
| 
| I found out what the problem is,
| 
| When using the realms in server.php
| 
| the realm does get appended to the users login name ....
| 
| but then the preference driver fails to come up with the right dn in ldap.
| 
| e.g.
| 
| when logging in without the realms with admin @ xar.nl
| 
| this is the result for the login and preference driver:
| 
| mail= admin @ xar.nl ,ou=xar.nl,ou=mailaccounts,o=xar.nl
| 
| This works perfect.
| 
| but this is the result when appending the realm from server.php to the
| user's
| login in name.
| 
| When loging in with admin:
| 
| mail= admin @ xar.nl,ou=mailaccounts,o=xar.nl
| 
| Then the preference driver keeps it stricly to the basedn given in
| horde.php.
| 
| Any ideas ?

Tjeerd,

I can share what I do.  First I don't use realm's in conf/servers.

I have the following in my config/conf.php for virtual domains and
virtual users.  My ldap structure is similar to yours so hopefully 
it will work for you with minor modification to the three vdomain
lines assuming that I am understanding your problem which I am not
particularly good at:-).  I just have cnames for all my vdomains 
and they begin mail.$vdomain.  This also helps my imp/config/conf.php
file to be exactly the same on my test machine and production 
machine.  So I can change versions on the production machine
without having to reconfigure.  

$conf['hooks']['vinfo'] = 'imp_get_vinfo';

if (!function_exists('imp_get_vinfo')) {
     function imp_get_vinfo ($type = 'username') {
         global $conf, $imp;

         $vdomain = $_SERVER['HTTP_HOST'];
         $vdomain = preg_replace('|^mail\.|i', '', $vdomain);
         $vdomain = strtolower($vdomain);


         if ($type == 'username') {
             return $imp['user'] . '@' . $vdomain;
        } elseif ($type == "vdomain") {
            return $vdomain;
        } else {
            return new PEAR_Error('invalid type: ' . $type);
        }
    }
}


-------------------------------------------------------------
 http://insourcery.com - Mergence of Business and Technology  
          a "Griffin Plaza Partners, LLC" Company