[imp] Custom function doesn´t work

Lubomír Vogl lubomir.vogl at spsslipnik.cz
Tue Apr 22 11:06:30 PDT 2003


Hi,

I try test custom function in horde/imp/config.php in the section "custom
function hooks"

$conf['hooks']['from'] = 'imp_expand_fromaddress';
if (!function_exists('imp_expand_fromaddress')) {
   function imp_expand_fromaddress ($imp) {
           return $imp['user'];
       }

but many errors and warnings apear. Is there any manual to learn how to use
custom function in imp ?

Finally I want to change "From address" in outgoing mail with MySQL :

 if (!function_exists('imp_expand_fromaddress')) {
     function imp_expand_fromaddress ($imp) {

      $cmd = '/usr/bin/ mysql -N -s -u testuser -e \"select mail from
qmail.users where id = \'$imp['user']\'\";
      $name = `$cmd`;
        return (empty($name) ? $imp['user'] : $name);

    }
 }

 Is this correct ?

Thanx

Lubos



More information about the imp mailing list