View Issue Details

IDProjectCategoryView StatusLast Update
0002055SOGoBackend Address Bookpublic2013-01-18 16:30
Reportersim Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.0.1 
Fixed in Version2.0.4 
Summary0002055: filters on SOGoUserSources do not work
Description

Using the same example as in the installation documentation, the filter on SOGoUserSources do not work.

filter = "(o='Company' AND mail='*' AND status <> 'inactive')";

I've tried various filters, and none of them work.

All the contents of the basedn are always returned.

TagsNo tags attached.

Activities

francis

francis

2013-01-16 15:42

administrator   ~0005201

What's the result of "default sogo read SOGoUserSources"?

sim

sim

2013-01-17 00:37

reporter   ~0005206

("-bash: default: command not found" I think it's: defaults read sogod SOGoUserSources)

Naturally, I've removed the filters, as they didn't work. So I've done this to add some:
sogo@groupware:~$ defaults write sogod SOGoUserSources '({type=ldap;CNFieldName=displayName; IDFieldName=uid; UIDFieldName=uid; MailFieldNames=(mail, street); baseDN="ou=people,dc=example,dc=com"; bindDN="cn=admin,dc=example,dc=com"; bindPassword="passphrase"; userPasswordAlgorithm=CRYPT; canAuthenticate=YES; displayName="People"; hostname="directory"; id="people"; isAddressBook=YES; port=389;},{type=ldap;CNFieldName=displayName; IDFieldName=uid; UIDFieldName=uid; baseDN="ou=mailboxes,ou=groups,dc=example,dc=com"; bindDN="cn=admin,dc=example,dc=com"; bindPassword="passphrase"; userPasswordAlgorithm=CRYPT; canAuthenticate=YES; displayName="Mailboxes"; hostname="directory"; id="mailboxes"; isAddressBook=YES; port=389;},{type=ldap;CNFieldName = cn;IDFieldName = cn;UIDFieldName = uid; MailFieldNames=(cn); scope=SUB; baseDN = "ou=departments,ou=groups,dc=example,dc=com";bindDN="cn=admin,dc=example,dc=com"; bindPassword="passphrase"; userPasswordAlgorithm=CRYPT; canAuthenticate = YES;displayName = "Departments"; hostname="directory"; id="department_groups"; isAddressBook=YES; port=389;},{type=ldap;CNFieldName = cn;IDFieldName = cn;UIDFieldName = uid; MailFieldNames=(cn); scope=SUB; baseDN = "ou=mail,ou=groups,dc=example,dc=com";bindDN="cn=admin,dc=example,dc=com"; bindPassword="passphrase"; userPasswordAlgorithm=CRYPT; canAuthenticate = YES;displayName = "Mail Groups"; hostname="directory"; id="mail_groups"; isAddressBook=YES; port=389;},{type=ldap;CNFieldName = cn;IDFieldName = cn;UIDFieldName = uid; MailFieldNames=(cn); scope=SUB; baseDN = "dc=example,dc=com";bindDN="cn=admin,dc=example,dc=com"; bindPassword="passphrase"; userPasswordAlgorithm=CRYPT; canAuthenticate = YES;displayName = "Addresses"; hostname="directory"; id="addresses"; isAddressBook=YES; port=389; filter = "(mail='*' AND givenName='Simon')";})'

And then:

sogo@groupware:~$ defaults read sogod SOGoUserSources
sogod SOGoUserSources '(
{
CNFieldName = displayName;
IDFieldName = uid;
MailFieldNames = (
mail,
street
);
UIDFieldName = uid;
baseDN = "ou=people,dc=example,dc=com";
bindDN = "cn=admin,dc=example,dc=com";
bindPassword = passphrase;
canAuthenticate = YES;
displayName = People;
hostname = "directory";
id = people;
isAddressBook = YES;
port = 389;
type = ldap;
userPasswordAlgorithm = CRYPT;
},
{
CNFieldName = displayName;
IDFieldName = uid;
UIDFieldName = uid;
baseDN = "ou=mailboxes,ou=groups,dc=example,dc=com";
bindDN = "cn=admin,dc=example,dc=com";
bindPassword = passphrase;
canAuthenticate = YES;
displayName = Mailboxes;
hostname = "directory";
id = mailboxes;
isAddressBook = YES;
port = 389;
type = ldap;
userPasswordAlgorithm = CRYPT;
},
{
CNFieldName = cn;
IDFieldName = cn;
MailFieldNames = (
cn
);
UIDFieldName = uid;
baseDN = "ou=departments,ou=groups,dc=example,dc=com";
bindDN = "cn=admin,dc=example,dc=com";
bindPassword = passphrase;
canAuthenticate = YES;
displayName = Departments;
hostname = "directory";
id = "department_groups";
isAddressBook = YES;
port = 389;
scope = SUB;
type = ldap;
userPasswordAlgorithm = CRYPT;
},
{
CNFieldName = cn;
IDFieldName = cn;
MailFieldNames = (
cn
);
UIDFieldName = uid;
baseDN = "ou=mail,ou=groups,dc=example,dc=com";
bindDN = "cn=admin,dc=example,dc=com";
bindPassword = passphrase;
canAuthenticate = YES;
displayName = "Mail Groups";
hostname = "directory";
id = "mail_groups";
isAddressBook = YES;
port = 389;
scope = SUB;
type = ldap;
userPasswordAlgorithm = CRYPT;
},
{
CNFieldName = cn;
IDFieldName = cn;
MailFieldNames = (
cn
);
UIDFieldName = uid;
baseDN = "dc=example,dc=com";
bindDN = "cn=admin,dc=example,dc=com";
bindPassword = passphrase;
canAuthenticate = YES;
displayName = Addresses;
filter = "(mail=* AND givenName=Simon)";
hostname = "directory";
id = addresses;
isAddressBook = YES;
port = 389;
scope = SUB;
type = ldap;
userPasswordAlgorithm = CRYPT;
}
)'

No, it doesn't filter anything. By the way, this problem still exists on Version 2.0.3 (@shiva 201212071044). Is there anything else I should try?

francis

francis

2013-01-17 15:20

administrator   ~0005218

Escape your single quotes that are inside single quotes :
defaults write sogod SOGoUserSources '({ [...] filter = "(mail='\''*'\'' AND givenName='\''Simon'\'')";})'

sim

sim

2013-01-18 01:27

reporter   ~0005223

OK, that works and I now have:
<string>(mail='' AND givenName='Simon')</string>
in the .GNUstepDefaults file and:
filter = "(mail=''
'' AND givenName=''Simon'')";
is output from 'defaults read sogod SOGoUserSources'

What does sogo expect and what does it passes to ldap with regards to a single or two single quotes? I am guess that the double single quote is necessary because of GNUstep defaults.

Perhaps the documentation should be updated. Right now it says on page 17 of the "SOGo Installation Guide.pdf":
filter = "(o='Inverse' AND mail='*' AND status <> 'inactive')";

Which I'm guessing is what should be in the /home/sogo/GNUstep/Defaults/.GNUstepDefaults file not what is input to the defaults command.

ludovic

ludovic

2013-01-18 16:30

administrator   ~0005234

I've slightly improved the doc in this commit: inc/sogo/commit/a78d7007d7fed95f2686028d1b6846ef7318f0b9

Issue History

Date Modified Username Field Change
2012-10-22 04:08 sim New Issue
2013-01-16 15:42 francis Note Added: 0005201
2013-01-17 00:37 sim Note Added: 0005206
2013-01-17 15:20 francis Note Added: 0005218
2013-01-18 01:27 sim Note Added: 0005223
2013-01-18 16:30 ludovic Note Added: 0005234
2013-01-18 16:30 ludovic Status new => closed
2013-01-18 16:30 ludovic Resolution open => fixed
2013-01-18 16:30 ludovic Fixed in Version => 2.0.4