[Mailman-Developers] Default Spam Header Filter Rules hack

Magnus Danielson cfmd at bredband.net
Sat Nov 26 14:04:47 CET 2005


As I am working on setting up a multilist/multidomain setup using
Mailman 2.1.6, I encountered the need that I wanted to be able to set the
default header filter rules so that the lists I create will all have the same
basic rule (since we concluded we want one as default). It proved to be a
fairly small hack, so I thought I contribute it to you.

diff MailList.py.orig MailList.py
<         self.header_filter_rules = []
>         self.header_filter_rules = \
>               mm_cfg.DEFAULT_HEADER_FILTER_RULES

diff Defaults.py.orig Defaults.py
> # New style SPAM Privacy header filtering
> # Mailman can match the patterns of header content and decide upon different
> # actions (Defer, Hold, Reject Discard and Accept). These properties is
> # configured per list, and here can the list default be set.
> # A list of rules where each entry contains the matching string, the action
> # code and an empty flag (set False).
> # Example (discard mails marked by SpamAssassin):
> #DEFAULT_HEADER_FILTER_RULES = [('X-Spam-Status: Yes', DISCARD, False)]

OK, it certainly could be cleaned up in the aspect of comments/documentation,
but it should be the trivia part for you guys. It has been tested to work.


More information about the Mailman-Developers mailing list