[imp] _prefs_hook_fullname

Otto Stolz Otto.Stolz at uni-konstanz.de
Tue Aug 8 08:51:22 PDT 2006


Hello,

since I have not yet received an answer on my general question
about programming Hook functions, I have tried my luck with a
simple (as I had hoped) example.

I am using Horde 3.1.2 and Imp H3 4.1.2. Configuration details
are appended, below.

I am trying to supply a sensible user name for the From headers
in outgoing mail, so I have adapted to our LDAP server the
2nd example for _prefs_hook_fullname from horde/config/hooks.php.
And I have modified the pertinent entry in horde/config/prefs.php
to read:
> $_prefs['fullname'] = array(
>     'value' => '',
>     'hook' => true,
>     'locked' => true,
>     'shared' => true,
>     'type' => 'text',
>     'desc' => _("Your full name:")
> );

Result: nothing; outgoing mail still has the header line:
> From: pop15959 at uni-konstanz.de

So, I put some debugging code into _prefs_hook_fullname.

Results:
- _prefs_hook_fullname is invoked only during
   Horde login, not during the subsequent Imp login.
- prefs_hook_fullname is invoked without an argument,
   the $imp array is NULL,
   and any and all of the following function calls yield NULL:
   · Auth::getAuth()
   · Auth::getCredential('user_name')
   · Auth::getCredential('username')
   · NLS::getCharset()
- consequently, _prefs_hook_fullname yields NULL.

So, what am I doing wrong?
And why is the preference for an e-mail parameter,
such as "user full name for From: line", in the Horde,
rather than the Imp, configuration?
And how should the Horde/Imp documentation be amended?

Thanks for any hint.

Best wishes,
   Otto Stolz

~~~~~~~~~~ Excerpt from horde/config/conf.php ~~~~~~~~~~
$conf['auth']['admins'] = array('Otto.Stolz at uni-konstanz.de');
$conf['auth']['checkip'] = true;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['params']['hostspec'] = '###.uni-konstanz.de';
$conf['auth']['params']['basedn'] = '###,c=de';
$conf['auth']['params']['version'] = '3';
$conf['auth']['params']['ad'] = false;
$conf['auth']['params']['uid'] = 'mail';
$conf['auth']['params']['encryption'] = 'md5-hex';
$conf['auth']['params']['newuser_objectclass']
    = array('shadowAccount', 'inetOrgPerson');
$conf['auth']['params']['filter'] = '(objectclass=*)';
$conf['auth']['params']['filter_type'] = 'free';
$conf['auth']['params']['password_expiration'] = 'no';
$conf['auth']['driver'] = 'ldap';
$conf['menu']['links']['options'] = 'authenticated';
$conf['menu']['links']['problem'] = 'authenticated';
$conf['menu']['links']['logout'] = 'authenticated';
$conf['hooks']['permsdenied'] = false;
$conf['hooks']['username'] = false;
$conf['hooks']['preauthenticate'] = false;
$conf['hooks']['postauthenticate'] = false;
$conf['hooks']['authldap'] = false;
~~~~~~~~~~~~~ End of horde/config/conf.php ~~~~~~~~~~~~~

~~~~~~~~~~ Excerpt from horde/config/prefs.php ~~~~~~~~~~
// user full name for From: line
// If you lock this preference, you must specify a value
// or a hook for it in horde/config/hooks.php.
$_prefs['fullname'] = array(
     'value' => '',
     'hook' => true,
     'locked' => true,
     'shared' => true,
     'type' => 'text',
     'desc' => _("Your full name:")
);
~~~~~~~~~~~~~ End of horde/config/prefs.php ~~~~~~~~~~~~~

~~~~~~~~~~ Excerpt from imp/config/conf.php ~~~~~~~~~~
$conf['hooks']['vinfo'] = false;
$conf['hooks']['signature'] = false;
$conf['hooks']['trailer'] = false;
$conf['hooks']['fetchmail_filter'] = false;
$conf['hooks']['mbox_redirect'] = false;
$conf['hooks']['mbox_icon'] = false;
$conf['hooks']['spam_bounce'] = false;
~~~~~~~~~~~~~ End of imp/config/conf.php ~~~~~~~~~~~~~

~~~~~~~~~~ Excerpt from imp/config/servers.php ~~~~~~~~~~
$servers['RZ-Cyrus'] = array(
     'name' => _("Central Mail Service"),
     'server' => '###.uni-konstanz.de',
     'hordeauth' => false,
     'protocol' => 'imap/notls',
     'port' => '143',
     'maildomain' => 'uni-konstanz.de',
     'smtphost' => '###.uni-konstanz.de',
     'smtpport' => 25,
     'realm' => '',
     'preferred' => '',
     'quota' => array(
         'driver' => 'cyrus',
         'params' => array()
     ),
     'acl' => array(
         'driver' => 'rfc2086',
     ),
);
~~~~~~~~~~~~~ End of imp/config/servers.php ~~~~~~~~~~~~~




More information about the imp mailing list