[dev] from address in

Jan Schneider jan at horde.org
Sun Jul 12 15:35:23 UTC 2009


Zitat von Thomas Reith <Thomas.Reith at rhoen.de>:

>
> Hi,
>
> I have different users with different domains hosted in one horde
> instance (horde-webmail-1.2.3).
> Since I'm forced to add email disclaimers with different content
> depending
> on the user's email domain, I'm trying to solve this problem using the
> _imp_hook_trailer hook function.
>
> here is a simple code fragment, which I plan to use:
>
> if (!function_exists('_imp_hook_trailer')) {
>      function _imp_hook_trailer($trailer)
>      {
>       $trailer = "";
>       $from = $GLOBALS['prefs']->getValue('from_addr');
>       Horde::logMessage("debugging [$from]", __FILE__, __LINE__,
> PEAR_LOG_ERR);
> // regex domain
> // fill $trailer with "disclaimer-domain.txt"
>       return $trailer;
>      }
> }
>
> the $from value is always empty. Does anybody know, how to get
> the "from_addr" inside the hook function?

You need to get the address from an instance of the Identity object  
instead of from the preferences.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.horde.org/archives/dev/attachments/20090712/fb18c396/attachment.bin>


More information about the dev mailing list