[imp] Virtual domain TIPs, Working!

Ing. CIP Alejandro Celi Mariátegui alex@linux.org.pe
Fri, 12 Apr 2002 01:40:04 -0500


This is my last post, when we have a problem.

} -----Mensaje original-----
} De: Ing. CIP Alejandro Celi Mariátegui [mailto:alex@linux.org.pe]
} Enviado el: Martes, 09 de Abril de 2002 07:57 p.m.
} Para: imp@lists.horde.org
} Asunto: [imp] Virtual domain TIPs
}
} 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

And this is the solution,

Thanks to the chat people #horde
In /horde/imp/config/conf.php We put a new function, like this:

$conf['hooks']['from'] = 'imp_set_username';

if (!function_exists('imp_set_username')) {
        function imp_set_username ($imp)
        {
                return preg_replace("/_.*/", "", $imp['user']);
        }
}

And it work fine.

But we had problem, with long user, Miguel resolve it
http://marc.theaimsgroup.com/?l=imp&m=101857675429949&w=2

Best Regards,

Alex