export BOGOFILTER_DIR="/tmp"

[ -f tests/inputs/spam.mbx ] && INPUT="tests/inputs"
[ -f tests/bogofilter/inputs/spam.mbx ] && INPUT="tests/bogofilter/inputs"

WORDS="subj:Earn subj:Your subj:College subj:Degree"

for FLAGS in WW W ; do
    rm -f $BOGOFILTER_DIR/????list.db

    echo Registering $INPUT/good.mbx
    bogofilter -C -n -$FLAGS < $INPUT/good.mbx
    ls -l $BOGOFILTER_DIR/????list.db

    echo Registering $INPUT/spam.mbx
    bogofilter -C -s -$FLAGS < $INPUT/spam.mbx
    ls -l $BOGOFILTER_DIR/????list.db

    bogoutil -w $BOGOFILTER_DIR .MSG_COUNT $WORDS

    echo Subject: Earn Your College Degree Online | bogofilter -C -uT -$FLAGS

    bogoutil -w $BOGOFILTER_DIR .MSG_COUNT $WORDS
    echo
done


