[imp] Setting up the IMAP server to connect

Jan Schneider jan@horde.org
Mon, 11 Mar 2002 11:01:02 +0100


Zitat von Jorge Izquierdo <jizquierdo@sgi.es>:

> Hi everybody. I'm still confused about the process by which IMP 3.0 sets
> the IMAP
> server to connect whe the user logs in. I know that servers.php file is
> involved in
> this process but I donīt know which php file is the one which sets the
> variable
> which points the server to connect (and which is this variable??). I'm
> trying to
> add some code to select the server for each user based on an LDAP lookup
> (with the
> user login name as athe argument for the search) but I donīt know where I
> should
> put this new code.
> 
> Coul anyone give me some hints on this? Does anybody perform an LDAP
> query to get
> the IMAP server to connect? Which file I should edit? If the answer would
> be
> editing the imp_get_vinfo function, whatīs the behaviour of this function
> during
> the login process? how should I edit it to solve my problem?
> 
> I would be very pleased with any hint on this.

The server is selected in IMP::setupSession(). 

If you want to setup a server list in servers.php and select the right 
server from this list automatically, you have to remove the line:
$server = Horde::getFormData('server', '');
and replace it by some ldap lookup code.

If you don't want to add an entry for every server in servers.php because 
only the hostnames differ, you can use a hidden server list (with one 
entry) and change the line:
$imp['server'] = $servers[$server]['server'];
to lookup the correct hostname.

The vinfo hook is only to modify the username on login.

Good luck!

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft