View Issue Details

IDProjectCategoryView StatusLast Update
0004852SOGoBackend Calendarpublic2019-10-28 19:09
ReporterOrsek Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionsuspended 
Product Version4.0.8 
Summary0004852: Ldap - filter not work
Description

Hello,
I have problem with "contacts".
If I search in ldap so the filter not work.
Problem is here:
2019-10-16 23:31:34.590 sogod[7026:7026] -[NGLdapConnection _searchAtBaseDN:qualifier:attributes:scope:]: search at base 'o=domains,dc=dpl-mail,dc=sa,dc=cz' filter '(mail=andrea.*@.cz)' for attrs '*
The filter: (objectClass=mailUser AND accountStatus=active AND enabledService=mail) is not applied.

My config:
SOGoUserSources = (
{
// GLOBAL ADDRESS BOOK
type = ldap;
hostname = "ldap://**";
baseDN = "o=domains,dc=mail,**";
bindDN = "cn=vmailadmin,dc=mail,
";
bindPassword = "***";
filter = "((objectClass=mailUser AND accountStatus=active AND enabledService=mail) OR (objectClass=CalendarResource AND objectClass=calEntry AND accountStatus=active))";
scope = SUB;

      userPasswordAlgorithm = ssha;

      IDFieldName = mail;
      bindFields = (mail);
      CNFieldName = cn;
      UIDFieldName = mail;
      IMAPLoginFieldName = mail;
      SearchFieldNames = (cn, sn, displayName, telephoneNumber, mail);
      canAuthenticate = YES;
      displayName = "Seznam osobnich e-mailu";
      id = ldap_auth;
      isAddressBook = YES;
      mapping = {
              ou = ("departmentNumber");
              photo = ("jpegPhoto");
          };
  }

);
And sogo.log:
Oct 16 23:31:34 sogod [7026]: * "GET /SOGo/so/ondrej.@.cz/Contacts/ldap_auth/andrea.***@.cz/view HTTP/1.1" 200 457/0 0.019 1546 70% 268K
Oct 16 23:31:34 sogod [7026]: |SOGo| starting method 'GET' on uri '/SOGo/so/ondrej.@.cz/Contacts/ldap_auth/andrea.@.cz/photo'
2019-10-16 23:31:34.588 sogod[7026:7026] <MySQL4Channel[0x0x5583b5437330] connection=0x0x5583b557a738> SQL: SELECT c_path4 FROM sogo_folder_info WHERE c_path2 = 'ondrej.*@**.cz' AND c_folder_type = 'Contact';
2019-10-16 23:31:34.588 sogod[7026:7026] <MySQL4Channel[0x0x5583b5437330] connection=0x0x5583b557a738> query has results, entering fetch-mode.
2019-10-16 23:31:34.588 sogod[7026:7026] <MySQL4Channel[0x0x5583b5952ab0] connection=0x0x5583b5953208> SQL: SELECT c_path4 FROM sogo_folder_info WHERE c_path2 = 'ondrej.*
@.cz' AND c_folder_type = 'Contact';
2019-10-16 23:31:34.588 sogod[7026:7026] <MySQL4Channel[0x0x5583b5952ab0] connection=0x0x5583b5953208> query has results, entering fetch-mode.
Oct 16 23:31:34 sogod [7026]: <0x0x5583b58ada30[NGLdapConnection]> Using ldap_initialize for LDAP URL: ldap://dpl-mail.sa.cz:389
2019-10-16 23:31:34.590 sogod[7026:7026] -[NGLdapConnection _searchAtBaseDN:qualifier:attributes:scope:]: search at base 'o=domains,dc=dpl-mail,dc=sa,dc=cz' filter '(mail=andrea.
@*.cz)' for attrs ''
Oct 16 23:31:34 sogod [7026]: <0x0x5583b5967d70[NGLdapConnection]> Using ldap_initialize for LDAP URL: ldap://****
'

TagsNo tags attached.

Activities

cedric.archambeau

cedric.archambeau

2019-10-22 07:57

reporter   ~0013834

Did you try :
filter = "(((objectClass=mailUser) AND (accountStatus=active) AND (enabledService=mail)) OR ((objectClass=CalendarResource) AND (objectClass=calEntry) AND (accountStatus=active)))";

?

Orsek

Orsek

2019-10-23 18:54

reporter   ~0013837

Yes, I tried this. But its the same.

ludovic

ludovic

2019-10-24 13:33

reporter   ~0013843

You have to single-quote values... like

      filter = &quot;((objectClass='mailUser' AND accountStatus='active' ...
Orsek

Orsek

2019-10-25 21:26

reporter   ~0013856

I tried this one: filter = "((objectClass='mailUser' AND accountStatus='active' AND enabledService='mail') OR (objectClass='CalendarResource' AND objectClass='calEntry' AND accountStatus='active'))";

The problem remains. Do you know where is a problem?

ludovic

ludovic

2019-10-28 19:09

reporter   ~0013860

When I add the filter as is in my source, it is used:

2019-10-28 15:01:52.804 sogod[31790] -[NGLdapConnection _searchAtBaseDN:qualifier:attributes:scope:]: search at base 'ou=domains,dc=example,dc=com' filter '(&(|(uid=sogo3)(mail=sogo3))(|(&(objectClass=mailUser)(accountStatus=active)(enabledService=mail))(&(objectClass=CalendarResource)(objectClass=calEntry)(accountStatus=active))))' for attrs 'dn'

So likely you are NOT editing the right SOGoUserSource, the wrong conf file or I don't know. Also, the first example you gave:

      baseDN = &quot;o=domains,dc=mail,***&quot;;

...
2019-10-16 23:31:34.590 sogod[7026:7026] -[NGLdapConnection _searchAtBaseDN:qualifier:attributes:scope:]: search at base 'o=domains,dc=dpl-mail,dc=sa,dc=cz' filter '(mail=andrea.*@.cz)' for attrs '*'

As you can see, you have dc=mail vs. dc=dpl-mail... so you're either messing up the info before sending it or you have other SOGoUserSources and you're editing the wrong one.

Issue History

Date Modified Username Field Change
2019-10-20 14:35 Orsek New Issue
2019-10-22 07:57 cedric.archambeau Note Added: 0013834
2019-10-23 18:54 Orsek Note Added: 0013837
2019-10-24 13:33 ludovic Note Added: 0013843
2019-10-24 13:33 ludovic Status new => closed
2019-10-24 13:33 ludovic Assigned To => ludovic
2019-10-24 13:33 ludovic Resolution open => no change required
2019-10-25 21:26 Orsek Note Added: 0013856
2019-10-25 21:26 Orsek Status closed => feedback
2019-10-25 21:26 Orsek Resolution no change required => reopened
2019-10-28 19:09 ludovic Note Added: 0013860
2019-10-28 19:09 ludovic Status feedback => closed
2019-10-28 19:09 ludovic Resolution reopened => suspended