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

Re: Mailing list query

Pierangelo Masarati wrote:

SA> What I want is somehow to get all uid of the users belonging to each
SA> of my groups in order to build a mailing list with postfix.

PM> In LDAP, the only way to do it is:

PM> - search the group
PM> - take its members
PM> - for each member:
PM> 	- search for the member entry
PM> 	- take its uid

We've implemented approximately this method for systems administered
with GOsa.  It has an auxiliary objectclass called "gosaMailAccount"
which it adds to groups and to users when the GUI enables mail for that

Using Exim, rather than Postfix, you can for example do something like:

    driver = redirect
    address_data = ${lookup ldapm \
      {user=LDAP_USER pass=LDAP_PASS \
      (gosaMailAlternateAddress=$local_part@$domain)))} \
    # Now get the canonical mail addresses for all the members
    data = ${expand:${lookup ldapm \
      {user=LDAP_USER pass=LDAP_PASS \

ie find a posixGroup whose "mail" or "gosaMailAlternateAddress" matches
the list address, then use memberUid to look up the mail addresses of
members who are local users, and deliver to them plus any external
addresses listed in the group's "gosaMailForwardingAddress".

An equivalent with groupOf(Unique)Names rather than posixGroup might be
simpler because having the user DNs in the group removes the need for
the second-level search.

You may be able to write an MTA config which looks less horrible using
PostFix.  The upshot either way is something simple to administer with
the web GUI.



Duncan Gibb, Technical Director
Sirius Corporation plc - The Open Source Experts
Tel: +44 870 608 0063