On Apr 18, 2013, at 10:32 PM, Patrick Ben Koetter wrote: >And that handler would be - excuse my ignorance I don't program - a Python >function to handle a Python program? Could the handler pass a message over to >e.g. SpamAssassin (Perl) or openDKIM (c code) or any other non Python program >without the need to add any additional (Python) code?
In Mailman 3, it would be a class implementing an interface. I still think this wouldn't be a handler, but a rule. Although there's no such distinction in MM2, there is in MM3: rules don't modify the message, handlers do. E.g. the IRule interface has a check() method that takes three arguments, the mailing list, the message, and the metadata. It returns a boolean specifying whether the rule matches or not. Thus a SpamAssassin rule might look like: @implementer(IRule) class SpamAssassin: # See IRule for details. name = 'spamassassin' description = _('See if SpamAssassin thinks this message is spam') record = True def check(self, mlist, msg, msgdata): spam_score = shell_out_to_sa(msg) msgdata['spamassassin_score'] = spam_score return spam_score > some_threshold -Barry _______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org http://mail.python.org/mailman/listinfo/mailman-developers Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-developers%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org Security Policy: http://wiki.list.org/x/QIA9