All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
5 DOMAIN=${DOMAIN:-$(hostname --fqdn)}
7 NICE='/usr/bin/nice -20'
8 MAILFILTER=$HOME/.etc/mailfilter
9 SA_PREFS="$MAILFILTER/spamassassin/user_prefs"
10 MAILREAVER="$NICE $HOME/spamfilter/mailreaver.crm -u $MAILFILTER/crm114/"
11 SPAMASSASSIN="$NICE /usr/bin/spamassassin -p $SA_PREFS"
12 #SPAMC="$NICE /usr/bin/spamc -lxu ${USER}@${DOMAIN}"
13 SA_REPORT="$SPAMASSASSIN --report"
14 SA_REVOKE="$SPAMASSASSIN --revoke"
15 SA_LEARN="$NICE /usr/bin/sa-learn -p $SA_PREFS"
16 SA_LEARN_HAM="$SA_LEARN --ham"
17 SA_LEARN_SPAM="$SA_LEARN --spam"
18 PRE_CLEANUP="$MAILFILTER/procmail/pre-spam-cleanup"
29 if [ -n "$FILE" ]; then
30 echo "E: input file already specified: $i" >&2
32 elif [ -r "$i" ]; then
35 echo "E: unknown argument: $i" >&2
44 echo "E: you need to specify either --ham or --spam." >&2
48 echo "E: you cannot specify both --ham and --spam." >&2
53 TMPFILE="$(tempfile -p mailtrainer)"
54 trap "rm -f $TMPFILE" 1 2 3 4 5 6 7 8 10 11 12 13 14 15
56 $PRE_CLEANUP < ${FILE:-/dev/stdin} > "$TMPFILE"
62 echo -n 'Training Spamassassin with ham: ' >&2
63 $SA_LEARN_HAM < "$TMPFILE" >&2
64 echo -n 'Revoking spam via Spamassassin: ' >&2
65 $SA_REVOKE < "$TMPFILE" >&2
66 # [ "${CRM114_STATUS:-}" = GOOD ] || {
67 echo -n 'Training crm114 with ham: ' >&2
68 $MAILREAVER --good < "$TMPFILE" >/dev/null
71 formail -I 'X-Trained-As: ham' < "$TMPFILE"
74 echo -n 'Training Spamassassin with spam: ' >&2
75 $SA_LEARN_SPAM < "$TMPFILE" >&2
76 echo -n 'Reporting spam via Spamassassin: ' >&2
77 $SA_REPORT < "$TMPFILE" >&2
78 # [ "${CRM114_STATUS:-}" = SPAM ] || {
79 echo -n 'Training crm114 with spam: ' >&2
80 $MAILREAVER --spam < "$TMPFILE" >/dev/null
83 formail -I 'X-Trained-As: spam' < "$TMPFILE"
88 trap - 1 2 3 4 5 6 7 8 10 11 12 13 14 15