https://bugs.kde.org/show_bug.cgi?id=323272
Bug ID: 323272 Summary: Querying a Microsoft Exchange's Active Directory via LDAP is extremely slow Classification: Unclassified Product: kmail2 Version: Git (master) Platform: Compiled Sources OS: Linux Status: UNCONFIRMED Severity: normal Priority: NOR Component: composer Assignee: kdepim-bugs@kde.org Reporter: thi...@kde.org Whenever an LDAP query is sent to a Microsoft Exchange's Active Directory via LDAP, the results are extremely slow to come. This is definitely an Exchange bug -- it appears to timeout in searching and then replies after 120 seconds. However, there's a specific field of the LDAP query that triggers it and it can be worked around. In (kdepim) libkdepim/ldap/ldapclientsearch.cpp, we have: const QString filter = QString( "&(|(objectclass=person)(objectclass=groupOfNames)(mail=*))" "(|(cn=%1*)(mail=%2*)(mail=*@%3*)(givenName=%4*)(sn=%5*))" ) .arg( d->mSearchText ).arg( d->mSearchText ) .arg( d->mSearchText ).arg( d->mSearchText ).arg( d->mSearchText ); The field that causes the slowdown is the (mail=*@%3*) part. In fact, it appears that Exchange is slow for any query that starts with * in the field. If that part of the query is removed, the server replies in reasonable time. Reproducible: Always Steps to Reproduce: 1. Set up LDAP to an Exchange AD server 2. Open a KMail Composer window 3. Start typing someone's name, surname or email address Actual Results: No search results are shown for 2 minutes. That's because no network traffic occurs for those 2 minutes: the server does not reply. Expected Results: Search results come quickly. PS: it's not necessary to have 4 .arg() calls with the same value. Replacing all of the fields with %1 and using one .arg() call is enough. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs