[Mailman-Developers] Mailman and Extend.py

Mark Sapiro mark at msapiro.net
Tue Apr 14 21:58:26 CEST 2009


C Nulk wrote:
>
>I will have to take a closer look at the patch.  And, I probably will
>apply it.  From the quick glance on sourceforge, it looks like it should
>work for v2.1.9.  All I should have to do is adjust the diff lines to
>point to the actual locations.


That's correct.


>Being able to use another list as a source is great.  I would still like
>to try to have everything defined/set within the list itself without
>cross-referencing other "management" lists.  For us, it would be easier
>to manage.


That's your decision, but I think it complicates things. See below.


>
>You will have to correct me if I am really off-base here on my
>understanding.
>
>The extend.py module defines the extend() function which appears to set
>ldap (as an object of the LDAPMemberships class)
>   ldap = LDAPMemberships(list)
>along with additional definitions, like
>   ldap.ldapsearch = "(uid=somebody)"
>   ldap.ldapserver = ldap.example.net
>and to tie it to the list, set the _memberadaptor to the object by
>   list._memberadaptor = ldap


Yes.


>So when the list membership or some other method is accessed and not in
>the list namespace, your explanation above applies.
>
>My idea of changing extend.py was to add additional objects of the
>LDAPMemberships class.  Say an ldap2 and ldap3 like
>    ldap2 = LDAPMemberships(list)
>    ldap2.ldapsearch = "(uid=person1)"
>    ldap2.ldapserver = ldap2.example.net
>    list.<ldap2_identifier> = ldap2
>    ldap3 = LDAPMemberships(list)
>    ldap3.ldapsearch = "(role=list-poster)"     # as an example
>    ldap3.ldapserver = ldap3.example.net
>    list.<ldap3_identifier> = ldap3
>
>both <ldap2_identifier> and <ldap3_identifier> are similar but not the
>same as the _memberadapter.  The difference is <ldap2_identifier> and
><ldap3_identifier> are specified in the accept_these_nonmembers (and the
>others) lists as LDAP=<ldap2_identifier> and likewise for any other
>"LDAP=" identifier.


Consider the following instead.

Create a list named say posters with it's own extend.py with settings
like
    ldap = LDAPMemberships(list)
    ldap.ldapsearch = "(role=list-poster)"     # as an example
    ldap.ldapserver = ldap3.example.net
    list._memberadaptor = ldap
etc.

Then all you need do is install the patch and put @posters in the
original list's accept_these_nonmembers. You would also want to set
the 'posters' list with attributes like

archive = No
advertised = No
default_member_moderation = Yes
member_moderation_action = Discard
generic_nonmember_action = Discard

so people wouldn't be aware of it and posts would not be accepted.

That way, the different LDAP functions would be defined for different
"pseudo lists" and you wouldn't need any Mailman modifications other
than installing a feature that's already implemented in current
versions.

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



More information about the Mailman-Developers mailing list