Re: Whups uses wrong mail domain
Jan Schneider <[email protected]> Thu, 18 Aug 2005 23:02:52 +0200
| Newsgroups | gmane.comp.horde.whups |
|---|---|
| Message-ID | <[email protected]> |
Zitat von Jason Dixon <[email protected]>: > On Aug 18, 2005, at 3:19 PM, Jan Schneider wrote: > >> Zitat von Jason Dixon <[email protected]>: >> >>> I'm testing whups and I noticed that any notification emails sent for >>> new comments use "From: [email protected]" instead of "From: >>> [email protected]". 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/ -- Whups mailing list - Join the hunt: http://horde.org/bounties/#whups Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail: [email protected]