[Mailman-Users] Help me on LDAPMEMBERADAPTOR-V3.0 very Urgent

Mark Sapiro msapiro at value.net
Mon Feb 13 06:45:44 CET 2006


Kabilan L wrote:

>  I am trying to configure LDAPMemberAdaptor-V3.0 in my Ldap Server.
>I copied extend.py and LDAPMemberships.py to /usr/lib/mailman/Mailman/.


I doubt that this has anything to do with your problem, but the
extend.py file should not be in the /usr/lib/mailman/Mailman/
directory. A list specific extend.py should be in the
/var/lib/mailman/lists/<listname>/ directory as below.


>I also copied extend.py to /var/lib/mailman/lists/staff(listname)/.
>I also added these things in MailList.py
>
>import extend


Now you do have a problem. The above import is wrong. The MailList
class __init__ method actually runs the list's extend.py when the list
is instantiated. You definitely do not want to import extend in
MailList.py.


># other useful classes
>from Mailman.LDAPMemberships import LDAPMemberships
>so use LDAPMemberships.py for OldStyleMemberships.py .


Wrong again. The list's extend.py takes care of importing
LDAPMemberships and setting mlist._memberadaptor to the list's
LDAPMemberships instance. You don't make any changes in MailList.py.

Just put an extend.py with the specific LDAP information for that list
in that list's list/<listname>/ directory, and put LDAPMemberships.py
in the Mailman/ directory, and the extend.py mechanism already built
into MailList.py does the rest.


>
>I have following in extend.py
>
>from Mailman.LDAPMemberships import LDAPMemberships
>def extend(list):
>    ldap = LDAPMemberships(list)
>    ldap.ldapsearch = "(uid=recipient)"   # your LDAP search here
>    ldap.ldapserver = "127.0.0.1"  # your LDAP server
>    ldap.ldapbasedn = "dc=domain dc=com" # your base DN
>    ldap.ldapbinddn = 'cn=Manager,dc=domain,dc=com'   # bind DN that can
>access 'mail' field
>    ldap.ldappasswd = 'xxxx'              # bind password for ldapbinddn
>    ldap.LDAP_URL = "ldap://ldap.domain.com:389/"
>    ldap.LDAP_MAIL_ATTRS = ("mail",)
>    ldap.LDAP_LOCALDOMAIN = "domain.com"
>    ldap.LDAP_REALNAME_ATTR = "cn"
>    ldap.LDAP_MAILMEMBER_ATTRS = ("rfc822MailMember",)
>    ldap.LDAP_MEMBER_ATTRS = ("uniqueMember","memberUID")
>    ldap.LDAP_OWNER_ATTR = "owner"
>    ldap.LDAP_LIST_RDN_ATTR = "cn"
>    ldap.LDAP_LIST_CLASSFILTER =
>"(|(objectclass=groupOfUniqueNames)(objectclass=nisMailAlias)(objectclass=groupOfNames))"
>    ldap.LDAP_BASE = "ou=Group,dc=domain,dc=com"
>    list._memberadaptor = ldap
>

Looks OK. I don't know the LDAP stuff, but the stuff to make it
interface properly as the MemberAdaptor for the list is there, namely

>from Mailman.LDAPMemberships import LDAPMemberships
>def extend(list):
>    ldap = LDAPMemberships(list)
 and
>    list._memberadaptor = ldap

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list