[imp] default identity
Nicolas Schmitz
Nicolas.Schmitz at ec-nantes.fr
Fri Jun 24 01:16:17 PDT 2005
One of the great thing of imp : custom hook. Edit horde/config/hooks.php
and configure something like that :
if (!function_exists('_prefs_hook_from_addr')) {
function _prefs_hook_from_addr($user = null)
{
$ldapServer = 'XXX';
$ldapPort = '389';
$ldapUser = 'XXX';
$ldapPass = 'XXX';
$searchBase = 'XXX';
$ldapconn = ldap_connect($ldapServer, $ldapPort);
$ds = ldap_bind($ldapconn, $ldapUser, $ldapPass);
$searchResult = ldap_search($ldapconn, $searchBase, 'uid=' .
$user);
$information = ldap_get_entries($ldapconn, $searchResult);
$name = $information[0]['mail'][0];
ldap_close($ldapconn);
return (empty($name) ? $imp['user'] : $name);
}
}
then edit horde/config/prefs.php :
// user preferred email address for From: line
// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['from_addr'] = array(
'value' => '',
'locked' => true,
'shared' => true,
'type' => 'text',
'desc' => _("Your From: address:"),
'hook' => true
);
You can do that for a lot of prefs.
carole gimenez a écrit :
>Hi,
>
>I installed horde-3.0.3 and imp-h3-4.0.2 on a linux server.
>
>The authentification is realized through the cyrus-imap server which
>questions our ldap directory.
>
>The user gives as login his uid, unique ldap attribute, for example
>'vrc4952a'.
>
>The problem is that when this user wants send a mail, his default
>identity is uid at domain, here for example vrc4952a at xxx.fr.
>
>However we would like rather than his default identity is his mail
>attribute in ldap directory, here verdon at xxx.fr.
>
>Is that possible to do? and if yes, how?
>
>
>Can someone help me on this subject, please?
>
>
>Thanks for advance.
>
>
>Carole.
>
>
>
--
Nicolas Schmitz
More information about the imp
mailing list