[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Mailing list query



That query does not return any result.

root@myserver:/etc/postfix# postmap -q mail_Group
ldap:/etc/postfix/ldap-aliases.cf
postmap: warning: dict_ldap_open: /etc/postfix/ldap-aliases.cf: Fixed
query_filter cn=IT,ou=Groups,dc=bca,dc=edu,dc=gr is probably useless
root@myserver:/etc/postfix#

Regarding my second query, I have 5 groups where only staff is
assigned to each one depending the department. Then the rest of the
users (students) does not belong to any group so in order to get all
uid's of students I need to query the whole ldap excluding the groups.

2008/11/15 Chris <cjl@viptalk.net>:
>
> On Nov 15, 2008, at 12:22 AM, Stelios A. wrote:
>
>> Hello all,
>>
>> My user.ldif is like:
>>
>> dn: cn=Somename Somelastname, ou=Users,dc=mydomain,dc=edu,dc=com
>> objectClass: inetOrgPerson
>> objectClass: posixAccount
>> objectClass: person
>> objectClass: organizationalPerson
>> objectClass: top
>> givenName: Somename
>> sn: Somelastname
>> cn: Somename Somelastname
>> uid: ssomelastname
>> uidNumber: 1002
>> gidNumber: 100
>> homeDirectory: /home/ssomelastname
>> loginShell: /bin/bash
>> mail: ssomelastname@mydomain.edu.com
>> userPassword: some password encrypted
>>
>> Same user for example is under cn=IT,ou=Groups,dc=mydomain,dc=edu,dc=com
>> Example ldif:
>>
>> dn: cn=IT,ou=Groups,dc=bca,dc=edu,dc=gr
>> cn: IT
>> objectClass: groupOfUniqueNames
>> uniqueMember: cn=Somename Somelastname,ou=Users,dc=mydomain,dc=edu,dc=com
>>
>> What I want is somehow to get all uid of the users belonging to each
>> of my groups in order to build a mailing list with postfix.
>>
>> I've created a file called ldap-aliases.cf with the following inside:
>>
>> server_host = ldaps://myhostname
>> search_base = dc=mydomain,dc=edu,dc=com
>> scope = sub
>> version = 3
>> query_filter =
>> (&(|(objectclass=person)(objectclass=groupofuniquenames)(mail=%s)(ou=Groups)))
>> result_attribute = uid
>> bind = yes
>> bind_dn = cn=admin,dc=mydomain,dc=edu,dc=com
>> bind_pw = mypasswordwithoutencryption
>>
>> The above works ok without errors but it just displays all users in my
>> ldap.
>> I tried several different ways but can't find out how to add to the
>> query to show me only the cn=IT,ou=Groups,dc=mydomain,dc=edu,dc=com
>
> Try setting this as your search base:
> cn=IT,ou=Groups,dc=mydomain,dc=edu,dc=com
>
>> and also a second more complicated query, that is to show me all users
>> uid where not belonging to any Group
>> (ou=Groups,dc=mydomain,dc=edu,dc=com)
>
> Not quite sure I understand what you're looking for there.
>
>



-- 
Stelios A