#!/bin/bash # crmspam -- Script for training crm114 discriminator (spam filter) to # be used from Alpine mailer. Use the "Pipe" command to # pass it an email to be learned as SPAM. # Copyright (C) 2008 Adrian C. # Licensed under the WTFPL # stdin email=$(cat) # Directories spamdir=$HOME/spam crmdir=$HOME/.crm114 # Mail filter trainer=mailfilter.crm #trainer=mailreaver.crm # Strip old CRM114 headers, feed it to the trainer and display only # the training result; the new CRM114 headers echo "${email}" | \ grep -a -v "^X-CRM114" | \ $crmdir/$trainer -u $crmdir --learnspam --force | \ grep -a "^X-CRM114"