Help programming MemberAdaptor...

Hello guru folks.
Er, I've been trying to make Mailman populate lists from our LDAP directory.
I've never used python before, and so I'm probably doing stuff ass fust. Here's what I've been doing:
I've copied OldStyleMemberships.py to LDAPMemberships.py
In MailList.pl I've changed the import line to:
from Mailman.LDAPMemberships import OldStyleMemberships
And I'm hacking getRegularMemberKeys to add stuff to self.__mlist before getRegularMemberKeys returns.
A few questions:
Is this how I ought to be going? If not, how ought I to approach this?
What I'd really like to do is have lists EITHER populate in the normal file way OR populated from LDAP. I was thinking I might use an address like
'ldap@cn=groupname,ou=groups,dc=example,dc=com' as the initial and only subscriber address, and use this to flag LDAP status.
But I'm sure that's really crap.
What ought I to do? Will somebody cleverer than me do the work so I don't have to?
HELP!!!
Martin Whinnery Assistant Network Manager South Birmingham College

On 29 October 2002, Martin Whinnery said:
In MailList.pl I've changed the import line to:
from Mailman.LDAPMemberships import OldStyleMemberships
Hacking on the Mailman modules is a bad idea -- next time you upgrade, your change will be lost.
Err, define "populate". Is this a one-time thing? Or do you want the list membership to always come from an LDAP lookup?
If the former, I would just write a script that does the LDAP query and sets the list population from it. Use bin/add_members as an example.
If the latter, why use Mailman at all? Why not just use an MTA that can lookup aliases using LDAP, and then send mail to that alias? I'm pretty sure both Exim and postfix can do that.
Note that I am *completely* ignorant of LDAP, not very clueful about Mailman internals. I'm just trying to help you ask the right question(s).
Greg
-- Greg Ward <gward@python.net> http://www.gerg.ca/ Monday is an awful way to spend one seventh of your life.

On Wed, 30 Oct 2002, Greg Ward wrote:
The latter. I help run a large educational campus, and we hold all accounts and groups in LDAP. These groups change membership over time, and I want to associate mailing lists with some of them. What I don't need is the headache of remembering to keep the memberships in sync.
If the former, I would just write a script that does the LDAP query and sets the list population from it. Use bin/add_members as an example.
If we absolutely must. It's what we do with DNS and DHCP. But I'd rather not. Just more code to maintain.
'Cos mailman does the [approve|reject|defer|discard] thing. And archives. And it deals with 'real' mailing lists (which we would die rather than lose).
Martin Whinnery *Assistant* Network Manager South Birmingham College
'Just the assistant'

On Wed, 30 Oct 2002, Martin Whinnery <martin.whinnery@sbirmc.ac.uk> wrote:
FYI, This is precisely what's taking the SQL MemberAdaptor so long (besides all my other commitments :-). The designincludes not only normal mailing lists, but also the ability to set up meta-mailing lists. The idea is that there is exactly one "course" mailing list, but each individual course "art-101" is a separate topic for which people have separate subscriptions. That way the creation of additional courses in the DB automatically translates to the creation of additional mailing lists ("course+art-102@birmc.ac.uk", "course+cs-550@birmc.ac.uk", etc.). It is configurable per list whether or not someone can subscribe to "nonMatchingTopics".
-Dale

On 29 October 2002, Martin Whinnery said:
In MailList.pl I've changed the import line to:
from Mailman.LDAPMemberships import OldStyleMemberships
Hacking on the Mailman modules is a bad idea -- next time you upgrade, your change will be lost.
Err, define "populate". Is this a one-time thing? Or do you want the list membership to always come from an LDAP lookup?
If the former, I would just write a script that does the LDAP query and sets the list population from it. Use bin/add_members as an example.
If the latter, why use Mailman at all? Why not just use an MTA that can lookup aliases using LDAP, and then send mail to that alias? I'm pretty sure both Exim and postfix can do that.
Note that I am *completely* ignorant of LDAP, not very clueful about Mailman internals. I'm just trying to help you ask the right question(s).
Greg
-- Greg Ward <gward@python.net> http://www.gerg.ca/ Monday is an awful way to spend one seventh of your life.

On Wed, 30 Oct 2002, Greg Ward wrote:
The latter. I help run a large educational campus, and we hold all accounts and groups in LDAP. These groups change membership over time, and I want to associate mailing lists with some of them. What I don't need is the headache of remembering to keep the memberships in sync.
If the former, I would just write a script that does the LDAP query and sets the list population from it. Use bin/add_members as an example.
If we absolutely must. It's what we do with DNS and DHCP. But I'd rather not. Just more code to maintain.
'Cos mailman does the [approve|reject|defer|discard] thing. And archives. And it deals with 'real' mailing lists (which we would die rather than lose).
Martin Whinnery *Assistant* Network Manager South Birmingham College
'Just the assistant'

On Wed, 30 Oct 2002, Martin Whinnery <martin.whinnery@sbirmc.ac.uk> wrote:
FYI, This is precisely what's taking the SQL MemberAdaptor so long (besides all my other commitments :-). The designincludes not only normal mailing lists, but also the ability to set up meta-mailing lists. The idea is that there is exactly one "course" mailing list, but each individual course "art-101" is a separate topic for which people have separate subscriptions. That way the creation of additional courses in the DB automatically translates to the creation of additional mailing lists ("course+art-102@birmc.ac.uk", "course+cs-550@birmc.ac.uk", etc.). It is configurable per list whether or not someone can subscribe to "nonMatchingTopics".
-Dale
participants (4)
-
Dale Newfield
-
Greg Ward
-
Martin Whinnery
-
Martin Whinnery <martin.whinnery@sbirmc.ac.uk>