Virtual domain TIPs

Ing. CIP Alejandro Celi Mariátegui alex@linux.org.pe
Tue, 9 Apr 2002 19:56:52 -0500



Hi again:

We are trying to configure a full virtual domains on an IMP server with
postfix and MySQL, all easy and "dummy proof" ;)

We want to when the user use http://mail.domain1.com or
http://mail.domain2.com the server recognize HTTP_HOST and do this:

1.- User login with for example "alex" and his password in
http://mail.domain1.com

2.- The server look the domain and change the login user to alex_domain1_com
as the real user (like in $conf['hooks']['vinfo'] = 'imp_get_vinfo'), thanks
Chuck!

3.- I configured the config example sent by Jim in this email:
http://marc.theaimsgroup.com/?l=imp&m=101195869916272&w=2
looks good!

All works fine still now!

The problem is:

When user "alex" (real user alex_domain1_com) compose and email and send it
to another mailserver, it always arrive using the real account user name
like this:

alex_domain1_com@domain1.com

I wish I could have a config or php tip for making that the "From field"
changes to the virtual sender like this

alex@domain1.com

Best Regards,

Alex Celi




>From eculp@encontacto.net Date: Tue,  9 Apr 2002 18:41:43 -0700
Return-Path: <eculp@encontacto.net>
Mailing-List: contact imp-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list imp@lists.horde.org
Received: (qmail 49230 invoked from network); 10 Apr 2002 01:41:23 -0000
Received: from adsl-64-173-182-158.dsl.mtry01.pacbell.net (HELO encontacto.net) (64.173.182.158)
  by clark.horde.org with SMTP; 10 Apr 2002 01:41:23 -0000
Received: from localhost (localhost [127.0.0.1])
  (uid 0)
  by encontacto.net with local; Tue, 09 Apr 2002 18:41:43 -0700
Received: from 64.173.182.155 ( [64.173.182.155])
	as user eculp@encontacto.net@encontacto.net by Mail.EnContacto.Net with HTTP;
	Tue,  9 Apr 2002 18:41:43 -0700
Message-ID: <1018402903.3cb39857c70a4@Mail.EnContacto.Net>
Date: Tue,  9 Apr 2002 18:41:43 -0700
From: Edwin Culp <eculp@encontacto.net>
To: imp@lists.horde.org
References: <IHEKLFBNKMPNAHHBAKEPEEBEFBAA.alex@linux.org.pe>
In-Reply-To: <IHEKLFBNKMPNAHHBAKEPEEBEFBAA.alex@linux.org.pe>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 4.0-cvs
X-Originating-IP: 64.173.182.155
Subject: Re: [imp] Virtual domain TIPs

Quoting "Ing. CIP Alejandro Celi Mariátegui" <alex@linux.org.pe>:

| 
| 
| Hi again:
| 
| We are trying to configure a full virtual domains on an IMP server with
| postfix and MySQL, all easy and "dummy proof" ;)
| 
| We want to when the user use http://mail.domain1.com or
| http://mail.domain2.com the server recognize HTTP_HOST and do this:
| 
| 1.- User login with for example "alex" and his password in
| http://mail.domain1.com
| 
| 2.- The server look the domain and change the login user to
| alex_domain1_com
| as the real user (like in $conf['hooks']['vinfo'] = 'imp_get_vinfo'),
| thanks
| Chuck!
I use the following, slightly modified, imp_get_vinfo 

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

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

         if ($type == 'username') {
/*
       I changed the below line 
          return preg_replace('|\.|', '_', $imp['user'] . '@' . $vdomain); 
       For the next line and kept the @  
*/
             return $imp['user'] . '@' . $vdomain;
        } elseif ($type == "vdomain") {
            return $vdomain;
        } else {
            return new PEAR_Error('invalid type: ' . $type);
        }
    }
}

Compare this with yours.  I think that is the only change I made.  I run
this with the courier suite so YMMV.

avisame - mucho suerte,

ed
| 
| 3.- I configured the config example sent by Jim in this email:
| http://marc.theaimsgroup.com/?l=imp&m=101195869916272&w=2
| looks good!
| 
| All works fine still now!
| 
| The problem is:
| 
| When user "alex" (real user alex_domain1_com) compose and email and send it
| to another mailserver, it always arrive using the real account user name
| like this:
| 
| alex_domain1_com@domain1.com
| 
| I wish I could have a config or php tip for making that the "From field"
| changes to the virtual sender like this
| 
| alex@domain1.com
| 
| Best Regards,
| 
| Alex Celi
| 
| 
| 
| -- 
| IMP mailing list: http://horde.org/imp/
| Archive: http://marc.theaimsgroup.com/?l=imp&r=1&w=2
| Frequently Asked Questions: http://horde.org/faq/
| To unsubscribe, mail: imp-unsubscribe@lists.horde.org
| 
| 




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