Re: [Exim] EXIM LDAP Virtual Users & Distribution Lists

Top Page
Delete this message
Reply to this message
Author: Nigel Wade
Date:  
To: Lee W
CC: exim-users
Subject: Re: [Exim] EXIM LDAP Virtual Users & Distribution Lists
Lee W wrote:
> Hi Everyone,
>
> First of all I better say that I have only just started using exim so am still
> finding my feet (please be gentle :->)
>
> I am trying to setup a completely virtual mail server (users with no shell
> accounts) that users will access though LDAP and a couple of things I am having
> trouble figuring out.
>
> Firstly, one of the things I wish to do is keep the users mail & files (accessed
> via SAMBA) seperate. So I need to specify two paths in the accounts, the
> posixAccount LDAP type has an attribute for homeDirectory, but I have been
> unable to find an equivilent mailDirectory attribute anywhere. Would it be
> possible to use the attribute 'otherMailbox' to represent something like
> 'EXIMDIR:/var/mail/vusers/user1' which is the users maildir on the server or can
> someone suggest another way of doing it?


In the local delivery transport set the location with the "directory"
directive. E.g. this is what I do for users with no home directory:

HOME_DIR=/var/mail/home
...

local_delivery:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
maildir_format
create_directory
# can't have normal home directory as users don't have them
# and this driver does a chdir to $home
home_directory = HOME_DIR
directory = $home/$local_part/Maildir


>
> Secondly (and this is the bit I really cannot get my head round), is there a
> good way of storing distribution lists in LDAP so that the email address for the
> list only has to be updated in one place, or does every user have to have the
> list address as part of the account properties? I though that I may be able to
> setup a transport that deals on with distribution lists and therefore be able to
> find the name of the list by the address and then do a second query to determine
> who are the members of that lists. Sorry that I unable to provide an example of
> the LDAP query as I still trying to figure it out but here is roughly what I
> think could be done:-
>
>     Mail comes in addressed to all-users@???
>     EXIM performs LDAP query for mail:
> all-users@???,objectclass=InetOrgPerson
>     If no entry is found it passes though to the LISTS router which checks for
> the same address but with
>        objectclass=InetDistributionList
>     If entry is found then another query is run that finds multiple users that
> have attribute listMember: distListName (from the
>        previous query).
>     If no entries our found message bounces or possibly is simply discarded.

>


Use an alias.

dn: cn=all-users,ou=Aliases,dc=RSPPG
cn: all-users
objectClass: nisMailAlias
objectClass: top
rfc822MailMember: user1
rfc822MailMember: user2
rfc822MailMember: user3
rfc822MailMember: user4


In exim.conf add a router to lookup aliases:

ldap_aliases:
   driver = redirect
   allow_fail
   allow_defer
   data = ${lookup ldap { \
                 user=LDAPU \
                 pass=LDAPP \
                 LDAPS\


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



Exim does the rest...


> I have made up a few LDAP objects in there as I was unable to find any for
> handling lists.
>
> Thanks in advance for any advice anyone can offer or to tell me that I am going
> about this completely the wrong way.
>
> Regards
>
> Lee
>
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>



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