#!/bin/bash

#learns spam from the spam folder
PATH=/usr:/usr/bin:/usr/sbin

if [ -f ~/Mail/spam ]; then
SPAM=`/usr/bin/sa-learn --spam --mbox ~/Mail/spam`
GOTSPAM=`echo $SPAM | awk '{ print $4 }'`
    if [ "$GOTSPAM" -gt 0 ]; then
	echo $SPAM
    fi
fi

# look for the ham folder to learn a ham 
if [ -f ~/Mail/ham ]; then
HAM=`/usr/bin/sa-learn --ham --mbox ~/Mail/ham`
GOTHAM=`echo $HAM | awk '{ print $4 }'`
    if [ "$GOTHAM" -gt 0 ]; then
	echo $HAM
    fi
fi
