Re: [Exim] Group Mailing (from LDAP)

Pàgina inicial
Delete this message
Reply to this message
Autor: Nigel Wade
Data:  
A: Martin Ritchie
CC: exim-users
Assumpte: Re: [Exim] Group Mailing (from LDAP)
Martin Ritchie wrote:
>
>
> Suresh Ramasubramanian wrote:
>
>> Martin Ritchie [2/4/2004 8:47 PM] :
>>
>>> Hi all,
>>> Forgive me if I've over looked this in the Docs.
>>>
>>> I was looking for a way to send mail to all members of a unix group.
>>> i.e. team1, staff, etc. Is there a simple tweak to the local delivery
>>> rules that I'm missing or is it not possible?
>>
>>
>>
>> /etc/aliases
>
>
>
> are you saying that I have to manually maintain a copy of the users in a
> group? such as:
>
> staff: brian, betty, colin, .....
>
> or use an include file?
>
> or a command to read the group file such as
>
> `grep "staff::" /etc/group |cut -d ":" -f 4-`
>
>
> None of these approaches are suitable. Sorry, forgot to say we store our
> users in a LDAP server so can't use simple file lookups.
>
> Has anyone done such a lookup is there a system call to find out all
> users for a particular group?
>
> tia



Can't you search the LDAP directory for the group in question and use the
result in a redirect router as if it was an alias?

If your groups are of type posixGroup the following ldap search should
return the members:

ldap:///dc=BASEDN?memberUid?one?&(objectClass=posixGroup)(cn=GROUPNAME))


A redirect router might look something like this:

ldap_groups:
   driver = redirect
   allow_fail
   data = ${lookup ldap { \
           user=LDAPU \
        pass=LDAPP\
ldap:///dc=BASEDN?memberUid?one?(&(objectClass=posixGroup)(cn=${quote_ldap:$local_part}))}\
        {$value} fail}


where LDAPU and LDAPP are your LDAP server user and passwords for lookups,
and BASEDN is the LDAP base dn.

But you need to be aware that a typical UNIX system will have groups and
users with the same name, and this could lead to confusion, loops etc so
you'd need to take care with this setup. You'd at least want something to
check that the address is in the local domain.



--
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@???
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555