2 # Depends: chiark-utils-bin
5 DIR="$HOME/tmp/sa-learn-cache"
8 if [ "$1" = --locked ]; then
13 if [ "$1" = --spam ]; then
15 elif [ "$1" = --ham ]; then
18 echo "don't know how to handle anything other than --spam or --ham" >&2
26 exec with-lock-ex -w "$LOCK" "$0" --locked "$@"
28 if [ -e "$CACHE" ]; then
29 SIZE="$(stat -c %s "$CACHE")"
34 if [ "$SIZE" -gt 4194304 ]; then
35 sa-learn --mbox --no-sync "$@" < "$CACHE"