
I've poked around a bit in various list related archives, but haven't found a definitive answer. Has anyone implemented some sort of add-on, filter or whatever to give mailman something like the majordomo 'global taboo body' rejection capability? All the predefined content filters seem to just pass or delete attachments, and not actually work on basic message body text. Will I have to just roll my own?
mjb.

On 6/27/07, Mark J. Bradakis wrote:
The spam filters give you the ability to do full-blown Python regular expressions, and take any of various different actions on the message as a result -- reject, hold for moderation, discard, whatever.
Is that not sufficient?
-- Brad Knowles <brad@shub-internet.org>, Consultant & Author LinkedIn Profile: <http://tinyurl.com/y8kpxu> Slides from Invited Talks: <http://tinyurl.com/tj6q4>
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Brad Knowles wrote:
Probably not. He's asking if anyone has implemented the ability to match on the message body. The spam filters only match on the headers.
Implementation of a custom handler to take action on a message based on pattern matches on the message body would not be difficult, but I don't know if anyone has done it. I have vague recollections of prior list posts about this, but it seems like Mark has searched the archives and not found anyone who has done it.
A custom handler could emulate the code in SpamDetect.py, but walk the message parts and collect the payloads of the text parts instead of the part headers. See <http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.067.htp> for information on implementing custom handlers.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro writes:
If you need something that's somewhat automatically extensible, the SpamBayes package is written in Python, and might be a very time-saving addition. I wonder if maybe Skip hasn't already done this?
Also, remember that if possible you'd really like to stop this stuff at the MTA, and not permit it as far as Mailman. Of course, your rules for the lists may be stricter than for personal mail, or differ by list, etc, which would change the balance of judgment here.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Jun 28, 2007, at 5:45 AM, Stephen J. Turnbull wrote:
There are some really old patches laying around somewhere (on SF
perhaps?) that did a prototype integration of Spambayes and Mailman,
hooking Mailman's moderation page to Spambayes training. It would
probably need a fair bit of work to update, but it might serve as a
good starting point. IIRC, the actual handler code wasn't very big.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iQCVAwUBRoOc5XEjvBPtnXfVAQLknQP/b/MB/ZwaSoaDUXiCqmiwuLJdrQBSVNJD NDIUQTOaIMqmVwS7k0aMwsps0M6BGXYhFnTwka4mX/3jGj+sF2CDBD90g0Gcb554 p2BIyUi3Um5Q2YX0wEZLGnhmxqmwA6eov+o0NThA3WKl+/jLMi+HlHmDzTh/IKw7 QW4O2S/no1s= =7zlg -----END PGP SIGNATURE-----

I didn't know any other way to do this, so I wrote a script. Hope it's not politically incorrect around here to have used Perl. ;)
Share and enjoy!
Ben
#!/usr/bin/perl -w
# Change all Mailman email addresses from one domain to another. # Example: change_subscriber_domain tblc.lib.fl.us tblc.org
my $from = $ARGV[0]; my $to = $ARGV[1];
print "Old domain name: $from\n"; print "New domain name: $to\n\n";
open FH, "/usr/lib/mailman/bin/find_member --owners $from\$ |";
while (<FH>) {
if (/^([^@]*).(.*) found in:/) {
my $old = "$1\@$2";
my $new = "$1\@$to";
print "$old\n\t=> $new\n";
$old =~ s/(['"])/\\$1/g;
$new =~ s/(['"])/\\$1/g;
system "/usr/lib/mailman/bin/clone_member --remove --admin --quiet
$old $new\n"; print "--------------------\n";
}
}

On 6/28/07, Ben Ostrowsky <ostrowb@tblc.org> wrote:
I didn't know any other way to do this, so I wrote a script. Hope it's not politically incorrect around here to have used Perl. ;)
It's probably more correctly done with a withlist script (which would by python), for what it's worth.
--
- Patrick Bogen

On 6/27/07, Mark J. Bradakis wrote:
The spam filters give you the ability to do full-blown Python regular expressions, and take any of various different actions on the message as a result -- reject, hold for moderation, discard, whatever.
Is that not sufficient?
-- Brad Knowles <brad@shub-internet.org>, Consultant & Author LinkedIn Profile: <http://tinyurl.com/y8kpxu> Slides from Invited Talks: <http://tinyurl.com/tj6q4>
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Brad Knowles wrote:
Probably not. He's asking if anyone has implemented the ability to match on the message body. The spam filters only match on the headers.
Implementation of a custom handler to take action on a message based on pattern matches on the message body would not be difficult, but I don't know if anyone has done it. I have vague recollections of prior list posts about this, but it seems like Mark has searched the archives and not found anyone who has done it.
A custom handler could emulate the code in SpamDetect.py, but walk the message parts and collect the payloads of the text parts instead of the part headers. See <http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.067.htp> for information on implementing custom handlers.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro writes:
If you need something that's somewhat automatically extensible, the SpamBayes package is written in Python, and might be a very time-saving addition. I wonder if maybe Skip hasn't already done this?
Also, remember that if possible you'd really like to stop this stuff at the MTA, and not permit it as far as Mailman. Of course, your rules for the lists may be stricter than for personal mail, or differ by list, etc, which would change the balance of judgment here.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Jun 28, 2007, at 5:45 AM, Stephen J. Turnbull wrote:
There are some really old patches laying around somewhere (on SF
perhaps?) that did a prototype integration of Spambayes and Mailman,
hooking Mailman's moderation page to Spambayes training. It would
probably need a fair bit of work to update, but it might serve as a
good starting point. IIRC, the actual handler code wasn't very big.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iQCVAwUBRoOc5XEjvBPtnXfVAQLknQP/b/MB/ZwaSoaDUXiCqmiwuLJdrQBSVNJD NDIUQTOaIMqmVwS7k0aMwsps0M6BGXYhFnTwka4mX/3jGj+sF2CDBD90g0Gcb554 p2BIyUi3Um5Q2YX0wEZLGnhmxqmwA6eov+o0NThA3WKl+/jLMi+HlHmDzTh/IKw7 QW4O2S/no1s= =7zlg -----END PGP SIGNATURE-----

I didn't know any other way to do this, so I wrote a script. Hope it's not politically incorrect around here to have used Perl. ;)
Share and enjoy!
Ben
#!/usr/bin/perl -w
# Change all Mailman email addresses from one domain to another. # Example: change_subscriber_domain tblc.lib.fl.us tblc.org
my $from = $ARGV[0]; my $to = $ARGV[1];
print "Old domain name: $from\n"; print "New domain name: $to\n\n";
open FH, "/usr/lib/mailman/bin/find_member --owners $from\$ |";
while (<FH>) {
if (/^([^@]*).(.*) found in:/) {
my $old = "$1\@$2";
my $new = "$1\@$to";
print "$old\n\t=> $new\n";
$old =~ s/(['"])/\\$1/g;
$new =~ s/(['"])/\\$1/g;
system "/usr/lib/mailman/bin/clone_member --remove --admin --quiet
$old $new\n"; print "--------------------\n";
}
}

On 6/28/07, Ben Ostrowsky <ostrowb@tblc.org> wrote:
I didn't know any other way to do this, so I wrote a script. Hope it's not politically incorrect around here to have used Perl. ;)
It's probably more correctly done with a withlist script (which would by python), for what it's worth.
--
- Patrick Bogen
participants (7)
-
Barry Warsaw
-
Ben Ostrowsky
-
Brad Knowles
-
Mark J. Bradakis
-
Mark Sapiro
-
Patrick Bogen
-
Stephen J. Turnbull