From aa08f42e93b4d06fdbbb3127e1add385dc317a3b Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sat, 16 May 2015 01:53:51 +0200 Subject: learn-*: Use MAILDIR and fall back to ~/mail --- learn-ham | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'learn-ham') diff --git a/learn-ham b/learn-ham index 6532dd7..cbc035d 100755 --- a/learn-ham +++ b/learn-ham @@ -1,6 +1,11 @@ #!/usr/bin/env bash -sb_mboxtrain.py -d "$MAIL"/spambayes.db -g "$MAIL"/learn-ham -r -rsync "$MAIL"/spambayes.db \ +if ! [[ -n "$MAILDIR" ]]; then + printf '%s\n' 'warning: $MAILDIR not set, falling back to $HOME/mail' + MAILDIR="$HOME"/mail +fi + +sb_mboxtrain.py -d "$MAILDIR"/spambayes.db -g "$MAILDIR"/learn-ham -r +rsync "$MAILDIR"/spambayes.db \ kyrias@theos.kyriasis.com:Mail/spambayes.db \ --update --checksum --human-readable --progress -- cgit v1.2.3-70-g09d2