[imp] replacing from_addr field in IMP identity prefs

Otto Stolz Otto.Stolz at uni-konstanz.de
Fri Nov 10 01:06:28 PST 2006


Hello Joe Auty,

you have written:
> I already have the valid from addresses in a separate database, I just 
> need to connect these interface changes with the back-end in as elegant 
> a manner as possible.

You could write a _prefs_hook_alias_addr routine and set, in imp/config/prefs.php,
> // user preferred alias addresses
> $_prefs['alias_addr'] = array(
>     'value' => '',
       'locked' => true,
       'hook'   => true
>     'shared' => false,
>     'type' => 'textarea',
>     'desc' => _("Your alias addresses: <em>(optional, enter each address on a new line)</em>"));

Thus, your hook could put the legal adresses into the session data.

However, I have not yet found out, where Imp uses these alias adresses.
Maybe, one of the developers can shed some light on this issue, other-
wise you'd have to research into it, yourself.

In any case, you should be able to construct a selection widget,
based on these data.


Another, possibly more elegant, approach could be based on the
"multiple identities" Horde is capable of handling; but I have
not yet looked into that issue, cf. the "Personal Information
preferences" section in horde/config/prefs.php, so I am guessing
here, to some extent.

In that approach, you would supply to every idendity its pertinent
from address (via locking and hooking Imp's from_addr, and fullname,
preferencies). Perhaps, this is all you need, if the user then could
select the idendity for every outgoing message, and Imp would insert
the pertinent from address into the message.

I have hooked these preferencies, in my test installation; however,
I grant only one single idendity per user. Hence, the user logs in
and gets his from address, and common name, automatically filled in
from the data base; this works like a charm, and no user can fake
a from address.

Good luck,
   Otto Stolz



More information about the imp mailing list