[imp] Virtual domain TIPs

Alonso Landauro Canales alonso@pcprices.com.pe
Tue, 9 Apr 2002 23:15:53 -0500


Ok you are right but then it doesnt recognize the real user
alex_domain1_com. It doesnt go to the right mailbox. It goes (if exits),
to the user alex period, not to the alex_domain1_com . 

Everything is working just fine...we only need to make the fromm adress
to go out like the $imp['user']@domain1.com instead of
user_domain1_com@domain1.com
Get it?

When the user logs ejm: alex and passwd, catches the real user
alex_domain1_com.
But when the mail goes out, when it arrive to somebodys mailbos, it
arrives like:
Alex_domain1_com@domain1.com. I dont need this... I want it to rechange
it to alex@domain1.com.

I f you have any idea to do this, please help us..
Regards and thankyou

Alonso Landauro Canales
==========================
PC Prices S.A.C.
Telf: 4477600
http://www.pcprices.com.pe
LIMA - PERU
==========================



-----Mensaje original-----
De: Edwin Culp [mailto:eculp@encontacto.net] 
Enviado el: martes, 09 de abril de 2002 20:42
Para: imp@lists.horde.org
Asunto: 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

-- 
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