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'
9 MAILFILTER=$HOME/.etc/mailfilter
10 SA_PREFS="$MAILFILTER/spamassassin/user_prefs"
11 MAILREAVER="$NICE /usr/share/crm114/mailreaver.crm -u $MAILFILTER/crm114/"
12 SPAMASSASSIN="$NICE /usr/bin/spamassassin --prefs-file=$SA_PREFS"
13 SPAMC="$NICE /usr/bin/spamc --log-to-stderr"
14 SA_REPORT="$SPAMC --reporttype=report"
15 SA_REVOKE="$SPAMC --reporttype=revoke"
16 SA_LEARN="$NICE /usr/bin/sa-learn -p $SA_PREFS"
17 SA_LEARN_HAM="$SPAMC --learntype=ham"
18 SA_LEARN_SPAM="$SPAMC --learntype=spam"
19 PRE_CLEANUP="$NICE $MAILFILTER/procmail/pre-spam-cleanup"
30 if [ -n "$FILE" ]; then
31 echo "E: input file already specified: $i" >&2
33 elif [ -r "$i" ]; then
36 echo "E: unknown argument: $i" >&2
45 echo "E: you need to specify either --ham or --spam." >&2
49 echo "E: you cannot specify both --ham and --spam." >&2
54 TMPFILE="$(tempfile -p mailtrainer)"
55 trap "rm -f $TMPFILE" 1 2 3 4 5 6 7 8 10 11 12 13 14 15
57 $PRE_CLEANUP < ${FILE:-/dev/stdin} > "$TMPFILE"
63 echo -n 'Training Spamassassin with ham: ' >&2
64 $SA_LEARN_HAM < "$TMPFILE" >&2
65 echo -n 'Revoking spam via Spamassassin: ' >&2
66 $SA_REVOKE < "$TMPFILE" >&2
67 # [ "${CRM114_STATUS:-}" = GOOD ] || {
68 echo -n 'Training crm114 with ham: ' >&2
69 $MAILREAVER --good < "$TMPFILE" >/dev/null
72 formail -I 'X-Trained-As: ham' < "$TMPFILE"
75 echo -n 'Training Spamassassin with spam: ' >&2
76 $SA_LEARN_SPAM < "$TMPFILE" >&2
77 echo -n 'Reporting spam via Spamassassin: ' >&2
78 $SA_REPORT < "$TMPFILE" >&2
79 # [ "${CRM114_STATUS:-}" = SPAM ] || {
80 echo -n 'Training crm114 with spam: ' >&2
81 $MAILREAVER --spam < "$TMPFILE" >/dev/null
84 formail -I 'X-Trained-As: spam' < "$TMPFILE"
89 trap - 1 2 3 4 5 6 7 8 10 11 12 13 14 15