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 was trying to implement a custom hook that detects the correct > username for ActiveSync login from a given mail address. This is the > hook I'm using (server and login information changed for privacy > reasons, but you get the idea): > > public function activesync_get_autodiscover_username($email) > { > $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 mail=' . $email . ' | /bin/grep sAMAccountName: | > /usr/bin/awk \'{print $2}\'';; > $username = `$cmd`; > > return $username; > } > > This works quite well, I can use my e-mail address and the hook > provides the correct username and the ActiveSync login is ok. > > If the e-mail address is: max.mustermann@mylocal.net it returns the > corresponding username: maxmus > > The downside of this approach is, that I cannot send mails from > ActiveSync devices anymore. The ActiveSync.log gives me: > > ERR: Address is missing domain. > > It seems that ActiveSync is using the username maxmus without a > domain as from address which cannot work, thus the error message is > correct. This shouldn't be happening as I understand that the hook > only provides a login username and nothing more. The example shows > exactly that: > > /** > * ActiveSync hook for determing a Horde username from an email address. > * > * @param string $email The email address > * > * @return string The username to use to authenticate to Horde with. > */ > // public function activesync_get_autodiscover_username($email) > // { > // return substr($email, 0, strpos($email, '@')); > // } > > Only the username (part of the mail address in that case) is returned. > I assume there must be some kind of bug in Driver.php but I'm no php > specialist, so I have no idea where to look at right now. > > When I disable the custom hook in the ActiveSync configuration, all > works as expected, but I have to enter the username manually (not a > big deal, but the end user has to know the username for this to work). > > If you need further Information, please ask. > > Best regards, > Hendrik > > >
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