[imp] RE: Multiple Domains

Thomas O'Brien thomas at creativebusinessystems.com
Tue Oct 26 07:32:30 PDT 2004


What happens if you have two users from different domains with the same
username?

Thomas 

-----Original Message-----
From: John J Kaplan [mailto:johnk at ewisp.net] 
Sent: Saturday, October 23, 2004 6:54 PM
To: Thomas O'Brien
Subject: Re: Multiple Domains

I left the hook out and just put

$vdomain =
strtolower(eregi_replace('^mail\.|^www\.|^www\.mail\.','',$_SERVER['HTTP_HOS
T']));

and set 'maildomain' => $vdomain,

in the servers.php.

When i had the hook setup i kept getting invalid login or password. This was
on a Cobalt Raq550 and think the hook part and the imap server didnt like
each other but i dont know :-)

----- Original Message -----
From: "Thomas O'Brien" <thomas at creativebusinessystems.com>
Newsgroups: gmane.comp.horde.imp
Sent: Wednesday, October 20, 2004 4:14 PM
Subject: Re: Multiple Domains


> Quoting Tony Lay <tonylay at gmail.com>:
>
>> I've been trolling on this list for about a year but I haven't really
>> been updating my system...it's quite stable.
>>
>> I run, let's say, DomainA.
>>
>> I now have to run DomainB
>>
>> I have the users all on the same system...but their domain names are
>> different...it's two seperate companies.
>>
>> How do I tweak my servers.php file to accept mail for certian users at
>> one domain and certian users at another domain?  Is there a place
>> where I can manually add a list to do this?
>>
>> The mail server is one in the same...so the same IP address.  People
>> that hit it from the outside will look the same, but the user id's are
>> different so they are distinct.
>>
>> I haven't seen this plainly put, and I've seen some of the VDomain
>> stuff but that doesn't sound like what I'm trying to do here.
>>
>> Running CVS IMP/HORDE Timestamped  Mar 15  2004 on Freebsd 4.9
>>
>> Thanks for your help.
>>
>
> I host 3 different domains on the same box using the  vinfo hook in
> /horde/config/hooks.php. Here's what my vinfo hook looks like:
>
> if (!function_exists('_imp_hook_vinfo')) {
>     function _imp_hook_vinfo($type = 'username')
>     {
>        global $conf, $imp;
>        $vdomain = 
> strtolower(eregi_replace('^mail\.|^www\.|^www\.mail\.','',
> $_SERVER['HTTP_HOST']));
>          if ($type == 'username') {
>              return $_SESSION['imp']['user'] . '@' . $vdomain;
>         } elseif ($type == "vdomain") {
>             return $vdomain;
>         } else {
>             return new PEAR_Error('invalid type: ' . $type);
>         }
>     }
> }
> I also added:
> $vdomain =
>
strtolower(eregi_replace('^mail\.|^www\.|^www\.mail\.','',$_SERVER['HTTP_HOS
T']));
>
> to the top of servers.php and set
>
> 'maildomain' => $vdomain,
>
> in /imp/config/servers.php
>
> When a user hits the login pages thaey are presnted with a username field 
> that
> appends the @domain.dom so they do not have to enter their entire
> username at domain.dom to log in (using IMP to authenticate)
>
> Lastly, I edited /imp/login.php around line 149 to read
>
> $title = sprintf(_("Welcome to the $vdomain Web Portal"), 
> $registry->get('name',
> ($imp_auth) ? 'horde' : null));
>
> so that the header on the login page reads "Welcome to the Domain.dom Web
> Portal"
>
> Thomas
>
>
> -- 
> IMP mailing list - Join the hunt: http://horde.org/bounties/#imp
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
> 




More information about the imp mailing list