On Mon, 2003-01-27 at 14:43, Jon Carnes wrote: > Okay. I got it working... > > (I have to attach it as a file since my kids just modified my system and > disabled cut and paste... :-) > > The "IsMember function was moved to the module MemberAdaptor and renamed > "isMember". > > The Moderate.py module is very well written and makes it quite easy to > add checks for passing mail into a moderated list. > > I've only done moderate checking on it, but it worked fine for my local > testing. > > Any feedback is welcome - Jon Carnes > ===
Looks like the attachment didn't go through on the list, so here is the patch (I fixed my cut/paste problem - so I'm still smarter than the kids, but just barely!) ====== *** jonc.Moderate.py Mon Jan 27 10:23:03 2003 --- Moderate.py Mon Jan 27 13:19:33 2003 *************** *** 25,28 **** --- 25,30 ---- from Mailman import Utils from Mailman import Message + from Mailman import MailList + from Mailman import MemberAdaptor from Mailman import Errors from Mailman.i18n import _ *************** *** 45,48 **** --- 47,59 ---- ^L + def CheckPostOnly(sender): + try: + m = MailList.MailList('post-only', lock=0) + return m.isMember(sender) + except Errors.MMListError: + return 0 + + + ^L def process(mlist, msg, msgdata): if msgdata.get('approved'): *************** *** 89,92 **** --- 100,105 ---- # From here on out, we're dealing with non-members. if matches_p(sender, mlist.accept_these_nonmembers): + return + if CheckPostOnly(sender): return if matches_p(sender, mlist.hold_these_nonmembers): ------------------------------------------------------ Mailman-Users mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ This message was sent to: archive@jab.org Unsubscribe or change your options at http://mail.python.org/mailman/options/mailman-users/archive%40jab.org