summaryrefslogtreecommitdiffstats
path: root/bin/tozt
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-10-08 12:09:20 -0400
committerJesse Luehrs <doy@tozt.net>2023-10-08 12:59:10 -0400
commit49570c8dd03448240897b37b68567352b790f16f (patch)
tree6c192a52046d5d0dd1b84a838befd8e777cfeafb /bin/tozt
parent66939c71da756c1d9e07a88a4a8ea2a018650060 (diff)
downloadconf-49570c8dd03448240897b37b68567352b790f16f.tar.gz
conf-49570c8dd03448240897b37b68567352b790f16f.zip
convert to stow
Diffstat (limited to 'bin/tozt')
-rwxr-xr-xbin/tozt/learn_spam38
1 files changed, 0 insertions, 38 deletions
diff --git a/bin/tozt/learn_spam b/bin/tozt/learn_spam
deleted file mode 100755
index 75e500a..0000000
--- a/bin/tozt/learn_spam
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-set -eu
-set -o pipefail
-
-MAILDIR=~/Maildir
-OPTS="--no-sync"
-SALEARN=/usr/bin/vendor_perl/sa-learn
-
-if [ "$1" = "-q" ]; then
- OPTS="$OPTS"
- OUTFILE="/dev/null"
-else
- OPTS="$OPTS --showdots"
- OUTFILE="/dev/stdout"
-fi
-
-if [ ! "$1" = "-q" ]; then
- echo "$(date): Learning ham..."
-fi
-nice find $MAILDIR -type f |
- perl -nl0e'chomp; ($ts) = /(\d{10})/; $now = time; print if m{/(new|cur)/} && !m{/(\.old|\.spam)/} && $ts > $now - 60*60*24*30' |
- xargs -n1000 -0 $SALEARN "$OPTS" --ham >$OUTFILE
-
-if [ ! "$1" = "-q" ]; then
- echo "$(date): Learning spam..."
-fi
-nice find $MAILDIR -type f |
- perl -nl0e'chomp; ($ts) = /(\d{10})/; $now = time; print if m{/(new|cur)/} && m{/\.spam/} && $ts > $now - 60*60*24*30' |
- xargs -n1000 -0 $SALEARN "$OPTS" --spam >$OUTFILE
-
-if [ ! "$1" = "-q" ]; then
- echo "$(date): Syncing..."
-fi
-nice $SALEARN --sync >$OUTFILE
-
-if [ ! "$1" = "-q" ]; then
- echo "$(date): Done!"
-fi