summaryrefslogtreecommitdiff
path: root/learn-spam
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-10-03 20:09:02 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-10-03 20:09:02 +0000
commit60a1266c0c7c4465aef3d1d3a44c9d0ec9b09bf4 (patch)
tree8a854d9747a86f0e4404bec36e4752ef153e4b48 /learn-spam
parentdc5a852a3a5834bb19623f0df15f9c8f47682cd2 (diff)
Add learn- scripts
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@185 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'learn-spam')
-rwxr-xr-xlearn-spam19
1 files changed, 19 insertions, 0 deletions
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