diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-05-16 01:53:51 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-05-16 01:53:51 +0200 |
commit | aa08f42e93b4d06fdbbb3127e1add385dc317a3b (patch) | |
tree | e818228a3d014ae16b66072b76d19497472f395a | |
parent | 00762ea36cb55b633cdc732d472a466e320d73e6 (diff) | |
download | bin-aa08f42e93b4d06fdbbb3127e1add385dc317a3b.tar.xz |
learn-*: Use MAILDIR and fall back to ~/mail
-rwxr-xr-x | learn-ham | 9 | ||||
-rwxr-xr-x | learn-spam | 9 |
2 files changed, 14 insertions, 4 deletions
@@ -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 @@ -1,6 +1,11 @@ #!/usr/bin/env bash -sb_mboxtrain.py -d "$MAIL"/spambayes.db -s "$MAIL"/learn-spam -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 -s "$MAILDIR"/learn-spam -r +rsync "$MAILDIR"/spambayes.db \ kyrias@theos.kyriasis.com:Mail/spambayes.db \ --update --checksum --human-readable --progress |