blob: 615d3c875b8044f41ce1598c1e9bf5bd538c754b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/sh
set -e
for dir in \
/srv/mail/$LOGNAME-d/ \
$HOME/Maildir \
; do
MAILDIR="$dir"
if [ -d "$MAILDIR/.spam.learn" ] ; then
break
fi
done
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
|