[imp] Upgrading hooks in imp.

Judson Bishop judson.bishop at eamc.org
Tue Feb 1 13:28:14 PST 2005


All,

I am upgrading from from Horde 2.2.4 with Imp 3.2.2 to Horde 3.0.2 and
Imp 4.0.1.  I use postfix/cyrus/sasl/openldap as my backend.

Previously I had the following hook in Imp that rewrote the From: line
in email.  How do I set this up to work again?

>From /var/www/html/horde/imp/config/conf.php


/* This is me edited example get the user's full name from 
an ldap server.
*/

$conf['hooks']['fullname'] = 'imp_set_fullname';

 if (!function_exists('imp_set_fullname')) {
     function imp_set_fullname($imp) {
         $ldapServer = 'rhythm.eamc.net';
         $ldapPort = '389';
         $searchBase = 'ou=Users,dc=eamc,dc=net';

         $ds = @ldap_connect($ldapServer, $ldapPort);

         $searchResult = @ldap_search($ds, $searchBase, 'uid=' .
$imp['user']);
         $information = @ldap_get_entries($ds, $searchResult);
         if ($information[0]['cn;lang-es'][0] != '') {
             $name = $information[0]['cn;lang-es'][0];
         } else {
             $name = $information[0]['cn'][0];
         }

         ldap_close($ds);

         return (empty($name) ? $imp['user'] : $name);
     }
 }


Thanks for any help.

Jud Bishop



More information about the imp mailing list