summaryrefslogtreecommitdiff
path: root/learn-spam
diff options
context:
space:
mode:
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