Re: [exim] Group aliases

Top Page
Delete this message
Reply to this message
Author: Nigel Wade
Date:  
To: exim-users
Subject: Re: [exim] Group aliases
Ivanov Maxim wrote:
> Is there any way to implement exchange-like group aliases in exim.conf?
>
> I use exim+vexim sql schema. What I need is to be able to setup some group
> membership and when email arrives with dest addr groupname@??? it
> will be delivered to every member of that group


Exim will expand aliases if so configured.

The redirect router is the normal place for this
(http://exim.org/exim-html-4.66/doc/html/spec_html/ch22.html). Provide
it with "data", which can be the result of any type of lookup, and it
will redirect the message to each recipient in the "data".

For example, this a redirect router I use to lookup group expansions in
our LDAP directory:

# this router searches the LDAP directory for mail aliases.
# Aliases have an objectClass of nisMailAlias and the aliases
# are stored as rfc822MailMembers
ldap_aliases:
driver = redirect
allow_fail
allow_defer

   data = ${lookup ldap { \
                 user=LDAPU \
                 pass=LDAPP \
                 LDAPS/LDAP_BASE?\


rfc822mailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:$local_part}))} 
\
                 {$value} fail}
   file_transport = address_file
   pipe_transport = address_pipe



What gets returned by LDAP is a comma separated list of email addresses.
The redirect router treats each of these as a recipient and injects each
new recipient back into the list of message recipients in place of the
original "group" address. You would need to change the lookup to reflect
how you intend to store your group mail lists.


If you want to restrict the group address to only being used by members
of the group then you can qualify the redirect router with the "senders"
option,
http://exim.org/exim-html-4.66/doc/html/spec_html/ch15.html#id2650664

For example, in the above router I could add:

   senders = ${sg {${lookup ldap { \
                 user=LDAPU \
                 pass=LDAPP \
                 LDAPS/LDAP_BASE?\


rfc822mailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:$local_part}))} 
\
                 {$value} fail}} \
        {[\\s,]+} { : } }


this is using the identical lookup as the recipients, but the result is
being converted into a : separated address list.

-- 
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