6.0.0-beta6
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
3/31/26
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#14110] [ActiveSync] Custom hook breaks send mail functionality
*
Your Email Address
*
Spam protection
Enter the letters below:
. ..___.___..__ .___. |__|[__ _/ [__) | | || ./__.[__) |
Comment
> I think you mean this piece of code: > > /** > * Return the current user's From/Reply_To address. > * > * @return string A RFC822 valid email string. > */ > protected function _getIdentityFromAddress() > { > global $prefs; > > $ident = $GLOBALS['injector'] > ->getInstance('Horde_Core_Factory_Identity') > ->create($this->_user); > > $as_ident = $prefs->getValue('activesync_identity'); > $name = $ident->getValue('fullname', $as_ident == 'horde' ? > $prefs->getValue('default_identity') : > $prefs->getValue('activesync_identity')); > $from_addr = $ident->getValue('from_addr', $as_ident == > 'horde' ? $prefs->getValue('default_identity') : > $prefs->getValue('activesync_identity')); > $rfc822 = new Horde_Mail_Rfc822_Address($from_addr); > $rfc822->personal = $name; > > return $rfc822->encoded; > } > > From what I understand here is, that this function does a lookup for > the full username and the corresponding mail address of the default > ActiveSync user identity. I checked the user and the ActiveSync > identity is set to default. Changing it from default does not give a > different result. I also checked the default user identity on the > horde web interface, and it shows up populated with the correct > values for the full user name and the mail address. > Maybe this is not ActiveSync related at all, but I do use custom > hooks to populate the user identity. > > Here are my custom hooks for the default identity: > > public function prefs_init($pref, $value, $username, $scope_ob) > { > switch ($pref) { > > case 'id': > if (is_null($uid)) { > $uid = $GLOBALS['registry']->getAuth('bare'); > } > return $uid; > > case 'from_addr': > if (is_null($username)) { > return ; > } > > $cmd = 'ldapsearch -H ldaps://my-dc.mylocal.net:636 -x -D > cn=horde,cn=Users,dc=mylocal,dc=net -w somepassword -b > dc=mylocal,dc=net samaccountname=' . $username . ' | /bin/grep mail: > | /usr/bin/awk \'{print $2}\'';; > $mails = `$cmd`; > $mail_array = explode("\n", $mails); > $mail = $mail_array['0']; > return empty($mail) > ? '' > : $mail; > > > case 'fullname': > // Set the fullname. > > // Set the fullname from the GECOS information in > // the passwd file. > if (is_null($username)) { > return $value; > } > > $user = $GLOBALS['registry']->getAuth('bare'); > > $array = posix_getpwnam($user); > $gecos_array = explode(',', $array['gecos']); > return empty($gecos_array) > ? $user > : $gecos_array[0]; > } > } > > I could also use ldap to read the fullname from my Active Directory, > but I was lazy and winbind gives GECOS all the information I need > here, so I just copied that one from the examples. > > So could it be a problem caused by the custom hooks? I think they are > executed every time a user does a log in, and so the default user > identity always gets these values set anew. >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers