summaryrefslogtreecommitdiff
path: root/learn-ham
diff options
context:
space:
mode:
Diffstat (limited to 'learn-ham')
-rwxr-xr-xlearn-ham19
1 files changed, 19 insertions, 0 deletions
diff --git a/learn-ham b/learn-ham
new file mode 100755
index 0000000..3c2290f
--- /dev/null
+++ b/learn-ham
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+MAILDIR=/srv/mail/$LOGNAME-d/
+
+if [ -d "$MAILDIR/.xham.learn" ] ; then
+ cd "$MAILDIR/.xham.learn"
+ files=$(find -type f)
+ if [ -n "$files" ] ; then
+ #sa-learn --ham $files > /dev/null 2>&1
+ if [ -d "$HOME/.bogofilter" ]; then
+ bogofilter --register-ham -B $files
+ fi
+ for file in $files ;do
+ mv $file $MAILDIR/.xham.learned/$file
+ done
+ fi
+fi