[whups] Whups uses wrong mail domain
Jan Schneider
jan at horde.org
Thu Aug 18 14:02:52 PDT 2005
Zitat von Jason Dixon <jason at dixongroup.net>:
> On Aug 18, 2005, at 3:19 PM, Jan Schneider wrote:
>
>> Zitat von Jason Dixon <jason at dixongroup.net>:
>>
>>> I'm testing whups and I noticed that any notification emails sent for
>>> new comments use "From: user at localhost.domain.com" instead of "From:
>>> user at domain.com". Horde is set to use an external SMTP server, so
>>> it's not coming from my mailer. I've looked through all the configs
>>> and they're no signs of "localhost.domain.com", so I'm not sure how
>>> that is being identified as part of the address. How can I override
>>> this behavior to use the domain instead?
>>
>> Tell the users to configure a proper from address in their identities,
>> or create a from_addr hook to do this automatically.
>
> Thank you, I forgot about the identities. Ok, I'm trying to create a
> from_addr hook, but it didn't affect the from_addr in the emails.
> Here is my hook:
>
> if (!function_exists('_prefs_hook_from_addr')) {
> function _prefs_hook_from_addr($user = null)
> {
> $ldapServer = '10.0.0.190';
> $ldapPort = '389';
> $searchBase = 'dc=domain,dc=com';
>
> $ds = @ldap_connect($ldapServer, $ldapPort);
>
> if (is_null($user)) {
> $user = Auth::getAuth();
> }
>
> $searchResult = @ldap_search($ds, $searchBase, 'uid=' . $user);
> $information = @ldap_get_entries($ds, $searchResult);
> if ($information[0]['mail'][0] != '') {
> $name = $information[0]['mail'][0];
> } else {
> $name = $information[0]['cn'][0];
> }
>
> ldap_close($ds);
> return (empty($name) ? $user : $name);
> }
> }
>
> And here is the pref:
>
> $_prefs['from_addr'] = array(
> 'hook' => true
> );
Don't remove the other settings from the pref.
> I reload the identity page and the "Your From: address:" field is
> missing. But when I add a new comment, the from_addr still uses
> "localhost.domain.com". Any idea what I've screwed up?
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the whups
mailing list