[whups] Whups uses wrong mail domain

Jason Dixon jason at dixongroup.net
Thu Aug 18 13:35:52 PDT 2005


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
);

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?

Thanks,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net





More information about the whups mailing list