[horde] using IMP/IMAP to authenticate using an Exchange 5.5 server

Mike Barsalou mbarsalou at aidea.org
Mon Jan 13 14:33:51 PST 2003


OK.  After reading  horde/config/hooks.php, and re-reading...then reading it
one more time, I figured out what needed to be done to complete my task.

What this does is allow the user to type in just their username and then
their from address becomes username at example.com.  Along with that, their
database designation becomes windowsdomain/username.  I only have IMP
working at this point, so I'm not sure if this has broken anything else.


The setup:

Exchange 5.5 Server
Using IMP/IMAP as authentication (meaning using the Exchange server to
authenticate)
CVS Head

To get this authentication to work and reduce the amount of stuff a user has
to type in, we did the following:

in horde/config/hooks.php we added this snippet of code:

#from address hook function for Exchange 5.5 server
if (!function_exists('_prefs_hook_from_addr')) {
    function _prefs_hook_from_addr()
    {
        if (!empty($_SESSION['imp']['user'])) {
                return preg_replace('|windowsdomain.|', '',
$_SESSION['imp']['user']);
        }
    }
}

# vinfo hook to authenticate using an Exchange 5.5 server
if (!function_exists('_imp_hook_vinfo')) {
    function _imp_hook_vinfo($type = 'username')
    {
        global $conf;


        if ($type == 'username') {
            return ('windowsdomain/' . $_SESSION['imp']['user'] );
        }
    }
}


If you notice on the from_addr hook function the windowsdomain has a (.)
period.  I suppose I could have used a forward slash here.

Also, we needed to change the from_addr preference in the
horde/imp/config/prefs.php to look like this:

$_prefs['from_addr'] = array(
    'value' => '',
#this hook value is VERY important
    'hook' => 'true',
#I'm not sure if I understood how the locked attribute worked, but believe
that if locked is true then
#it will not save the from_addr preference (meaning it will call the
function each time)
    'locked' => true,
    'shared' => true,
    'type' => 'implicit');

I hope this helps someone else.

Mike



More information about the horde mailing list