A MemberAdaptor for LDAP-based membership
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
New
|
Undecided
|
Unassigned |
Bug Description
This is a module, LDAPMemberships, which extends MemberAdaptor to support membership lists based on a search in an enterprise LDAP directory. With this module, you can make mailing lists which, rather than having a list of member addresses stored in the list, query your LDAP server for member addresses whenever necessary.
For instance, if you wish to have a mailing list of all the Vice Presidents in your company, you can express this as an LDAP search: "(title=Vice President*)" and create a mailing list which performs this search and delivers mail to the resulting user accounts when a message is sent to it. This way, rather than manually adding new Vice Presidents to the mailing list, you can simply have Human Resources update the LDAP records, and the change will immediately take effect for the mailing list.
Mailman lists with LDAP-based membership can still have moderators, list policies, and the other usual features of Mailman lists. There are a few missing features; notably:
1. There is no bounce processing.
2. There are no per-user preferences.
3. The Web interface still allows you to try setting user preferences, but if you do you will get a stack thrown at you. (Only the "readable" interface of MemberAdaptor is implemented.)
4. The LDAP settings of a list (e.g. LDAP server and search string) are only administrable by editing its "extend.py" file, not over the Web.
5. There is no digest mode.
To use this module, you must have the "ldap" Python module installed (aka "python-ldap"). Then just put LDAPMemberships.py in the "Mailman" directory (~mailman/Mailman), create a new list, and write an "extend.py" file in the list directory like so:
#####
from Mailman.
def extend(list):
ldap = LDAPMemberships
ldap.ldapsearch = "(title=Vice President*)" # members search string
ldap.ldapserver = "ldap.example.net" # your enterprise LDAP server
ldap.ldapbasedn = "dc=Example dc=net" # your LDAP base DN
ldap.ldapbinddn = '' # a bind DN which can read people's 'mail' field
ldap.ldappasswd = '' # the password for the bind DN
list.
#####
This module has been tested at my site and is in production on a Mailman 2.1.2 installation.
Logged In: YES
user_id=944208
Er. SF ate the indentation on my "extend.py" example in the patch description. All of the lines after "def extend(list):" are meant to be indented once.