[horde] How to program Horde, and Imp, hooks?

Otto Stolz Otto.Stolz at uni-konstanz.de
Mon Sep 18 09:19:19 PDT 2006


Hello,

I am still struggling with the hooks in Horde 3.1.2 and Imp H3 4.1.2.

In our environment, the IMAP accounts differ from the E-Mail
addresses and the Imp user-ids. E. g., the IMAP user for my
test account is "pop15959", whilst the e-mail address is
"hugine.habicht at uni-konstanz.de", and I want the user to
log in to Imp as "hugine.habicht".

Furthermore. there are several IMAP servers (both central and
department-owned), with different jurisdiction, hence different
rules. For every IMAP server, there is a pertinent LDAP server.

I had written:
> I guess that an _imp_hook_vinfo function in horde/config/hooks.php
> could be used to find the proper IMAP account

Jan Schneider has answered:
> This is not exactly what the vinfo hook for but it might still work. If 
> not, you should be using the username_from/to_backend hooks instead.

Meanwhile I have tried both _imp_hook_vinfo and 
_username_hook_{from|to}backend -- to no avail:

- _imp_hook_vinfo does not work, because
   · in its argument list, neither the server nor the
     Imp user is provided,
   · it is called before $_SESSION['imp'] is established,
   · it is called before Auth::getAuth() knows about the
     IMP user,
   so _imp_hook_vinfo does not get at its essential input
   data.

- _username_hook_frombackend does not work, because
   its result is not used for the IMAP log-in
   (rather it is used to check the last log-in, and
   it is fed to _prefs_hook_fullname; I guess I should
   use it to provide a unique Imp user-id, so Imp can tell
   apart two users of different IMAP servers, even if
   their respective mailboxes are named alike).

- _username_hook_tobackend has not been called, during
   my tests, so I cannot yet assess its purpose; it is
   certainly no option for the task at hand.

So, which hook should I use to map the Imp user-id to the
IMAP user-id? Or is there no hook available, at all, so I
will have to modify the Imp code proper?

Thanks, in advance, for any hint.

Best wishes,
   Otto Stolz




More information about the horde mailing list