#!/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