From 60a1266c0c7c4465aef3d1d3a44c9d0ec9b09bf4 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 3 Oct 2006 20:09:02 +0000 Subject: Add learn- scripts git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@185 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- learn-spam | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 learn-spam (limited to 'learn-spam') diff --git a/learn-spam b/learn-spam new file mode 100755 index 0000000..44dd2d3 --- /dev/null +++ b/learn-spam @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +MAILDIR=/srv/mail/$LOGNAME-d/ + +if [ -d "$MAILDIR/.spam.learn" ] ; then + cd "$MAILDIR/.spam.learn" + files=$(find -type f) + if [ -n "$files" ] ; then + sa-learn --spam $files > /dev/null 2>&1 + if [ -d "$HOME/.bogofilter" ]; then + bogofilter --register-spam -B $files + fi + for file in $files ;do + mv $file $MAILDIR/.spam.learned/$file + done + fi +fi -- cgit v1.2.3