[horde] _username_hook_frombackend not used by Horde, only by IMP

Oscar Retana oscar at gridshield.net
Fri Dec 10 18:44:01 PST 2004


I wrote a simple _username_hook_frombackend function that ensures the 
username is always in the format "user at domain.com", using a default 
domain if the user didn't provide one.

But, according to my imap server logs, Horde sends to the imap server 
only the "user" without the "@domain.com". Then comes the IMP 
authentication and it *does* use the full format "user at domain.com".

So, I suspect that Horde is not using my _username_hook_frombackend.

Am I doing it in the right way? Is this the hook I should use?



b.t.w, my imap server is accepting the first (horde) and the second 
(imp) login attemps because by chance my imap server auth method 
supports a "default" domain too, in case the user didn't provide one. 
But that's not the point. I would like to know if horde should be using 
the hook too.

Here goes my code. Any suggestion is welcome. This is my "Hello World!" 
program in PHP.

if (!function_exists('_username_hook_frombackend')) {
   function _username_hook_frombackend($userID)
   {
     $defaultDomain = 'domain.com';
     $arrobas = substr_count($userID,'@');
     if ($arrobas > 0) {
       return $userID;
     } else {
       return $userID . '@' . $defaultDomain;
     }
   }
}


-- 
Oscar Retana



More information about the horde mailing list