summaryrefslogtreecommitdiff
path: root/learn-ham
blob: 3c2290f38a48b88f0faba0ced076c32ff509bffe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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