SearchUser loginNavigation |
Python script for updating list of approved posters in mailman list from ldapSubmitted by bchapman on Wed, 03/29/2006 - 11:42am.
Imagine that you run a mailman (http://www.list.org) mailing list called "2006-announce". Everyone on your faculty and staff should be able to post to this list; however, not everyone wants to subscribe to the list. All members of your faculty and staff are members of an LDAP group called "contactlist". Because your faculty and staff come and go, you want an automated method for making sure that current members of contactlist have permissions to send mails out to the announcement lists. You'd like to have something that you could run from cron that would make sure that people can post to the appropriate lists. That's what this short script is for. It uses the "withlist" script provided by mailman to give you a hook into various mailman list variables. Here's how to use this script. 1. Make sure that it's creating an appropriate list of email addresses. Ours is designed to pull group membership info from a Novell e-directory. Yours will likely be quite different. If you run this without making any changes, you'll just give my faculty the ability to post to *your* list; which is not what you want. 2. Copy the ldap_addposter.py script into the /usr/local/mailman/bin/ folder. 3. Invoke it like so: OR (a little fancier; multiple lists are processed one after the other) $ (cd /usr/local/mailman/bin/;for i in 2006-announce 2007-announce 2008-announce;do ./withlist -l -r ldap_addposter $i;done) The mailman "withlist" script is very interesting -- use './withlist --help' to get more ideas on how you can use it to tweak your mailman lists. By the way, you may have someone who is in your contactlist group but who still shouldn't be able to post; there's a variable where you can add in those excluded email addresses - see the code. 2639 reads
( categories: Code Samples | Python )
|
Google SearchSearch AmazonActive forum topicsFiles- Code Samples (21)
- .NET (2) - ASP - ColdFusion (1) - Java (2) - JavaScript (1) - PERL - PHP (6) - Python (3) - Ruby (1) - Courtroom Technology (2) - Policies - Testimonials (1) - IT Policies and Forms (31) - Forms (7) - Org Charts - Policies (10) - Strategic Plans (1) - Useful Documents (4) - HowTo - Templates (1) - User Guides (1) - Utilities (3) - Windows (1) Ads by Google |