sysadmin-bin r75 - in trunk: . mail



Author: ovitters
Date: Sat Jun  7 21:24:03 2008
New Revision: 75
URL: http://svn.gnome.org/viewvc/sysadmin-bin?rev=75&view=rev

Log:
	* mail/amavis-train-bayes: Use messages forwarded from Mailman
	to train Spamassassin by using sa-learn. Mailman has been patched to
	optionally forward Discarded and Accepted messages to the amavis user.
	Procmail sorts the mail into two directories. This script should run
	from cron.



Added:
   trunk/mail/amavis-train-bayes
Modified:
   trunk/ChangeLog

Added: trunk/mail/amavis-train-bayes
==============================================================================
--- (empty file)
+++ trunk/mail/amavis-train-bayes	Sat Jun  7 21:24:03 2008
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Mailman has been patched to forward messages marked as Dischard + Accept to
+# the amavis user.
+#
+# It uses plussed addresses for that. 
+#
+# There is a procmail rule which sends the body of that email to two mailboxes.
+# The Mailman email has content type message/rfc822. Meaning: the original
+# message is preserved by only sending the body to the mbox.
+#
+# This scripts runs in cron and uses the mbox to train the bayes classifier.
+#
+
+cd $HOME
+
+type="spam"
+if [ -e bayes-$type/new ]; then
+	rm -rf bayes-$type/train
+	mv -f bayes-$type/new bayes-$type/train
+	sa-learn --$type bayes-$type/train
+fi
+
+type="ham"
+if [ -e bayes-$type/new ]; then
+	rm -rf bayes-$type/train
+	mv -f bayes-$type/new bayes-$type/train
+	sa-learn --$type bayes-$type/train
+fi
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]