diff options
author | Peter Palfrader <peter@palfrader.org> | 2006-10-03 20:09:02 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2006-10-03 20:09:02 +0000 |
commit | 60a1266c0c7c4465aef3d1d3a44c9d0ec9b09bf4 (patch) | |
tree | 8a854d9747a86f0e4404bec36e4752ef153e4b48 | |
parent | dc5a852a3a5834bb19623f0df15f9c8f47682cd2 (diff) |
Add learn- scripts
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@185 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | learn-ham | 19 | ||||
-rwxr-xr-x | learn-spam | 19 |
2 files changed, 38 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 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 |