[imp] imp_get_vinfo question

Andrew Roseman aroseman at phoenix-ag.com.au
Fri Sep 5 07:18:28 PDT 2003


Hello,
I had a server crash the other day, and im just rebuilding, but cant get the
"imp_get_vinfo" working again...and its driving me nuts!!! Config as follows

servers.php
$servers['imap'] = array(
    'name' => 'IMAP Server',
    'server' => 'mail.warpax.com',
    'protocol' => 'imap/notls',
    'port' => 143,
    'folders' => 'INBOX.',
    'namespace' => '',
    'maildomain' => 'warpax.com',
    'realm' => '',
    'preferred' => ''
);

conf.php
$conf['hooks']['vinfo'] = 'imp_get_vinfo';

if (!function_exists('imp_get_vinfo')) {
    function imp_get_vinfo ($type = 'username') {
        global $conf, $imp;

        $vdomain = getenv('HTTP_HOST');
        $vdomain = preg_replace('|^mail\.|i', '', $vdomain);
        $vdomain = strtolower($vdomain);

        if ($type == 'username') {
           $vuser = $imp['user'].'@'.$vdomain;
           return $vuser;
        } elseif ($type == "vdomain") {
           return $vdomain;
        } else {
            return new PEAR_Error('invalid type: ' . $type);
        }
    }

FYI this function used to work, but now it doesnt....i was running previous
version, now running latest.
I have isolated the cause to be that the $imp['user'] is not parsing to this
function, and therefore the $vuser is only @warpax.com....

Confirmed based on error log.

Sep 06 00:13:32 HORDE [error] [imp] FAILED LOGIN 192.168.24.4 to
mail.warpax.com:143[imap/notls] as @warpax.com [on line 281 of
"/wwwroot/warpax/horde/imp/lib/IMP.php"]

Now if i hard code a username into the script, the script works and i can
login, so there is nothing wrong with my IMAP server, etc. Any help would be
appreciated

Thanks
Andrew





More information about the imp mailing list