[imp] Virtual users from addr hook

fredrik@rogerhampus-akeri.se fredrik at rogerhampus-akeri.se
Mon Sep 4 11:49:11 PDT 2006


Hi!

Iam installing a new version of horde and imp.
On a other site i have imp running on an older version and
iam using a virtual text file for mailusers
ex

my.virtual.name at domain.ex         system-user-name


ive got a hook for changing the from addr line by accesing this file 
that ive got
from this list many years ago ( thx ) but i can't get this to work on 
the new system iam working on, the old hook looks like this:

------------------------------------------------------------
if (!function_exists('_kuk_hook_from_addr')) {
     function _prefs_hook_from_addr($name = null)
     {
        if (is_null($name)) {
        $name = Auth::getAuth();
        }
        $file = '/etc/postfix/virtual-imp';
                        if (is_file($file)) {
                        $fcontents = file($file);
                        $virtline = preg_grep("[$name]", $fcontents);
                        $virtline = (array_values($virtline));
                        $name = 
substr("$virtline[0]",0,strpos("$virtline[0]", " "));
                        if ($name == '') $name = null;
                        }
                        return (empty($name) ? '' : $name);
                        }
}
-------------------------------------------------------------

any ideas how to make this work on the new system?

/Fredrik


More information about the imp mailing list