View Single Post
Old November 10th, 2004, 9:31 PM   #54 (permalink)
tch3
Destroyer of Evil Robots
Excelling Contributor
 
tch3's Avatar
 
Joined in Oct 2003
Lives in Atlanta, GA
760 posts
Gave thanks: 17
Thanked 9 times
Quote:
Originally Posted by pseudoswede
Is there a way to modify the script so that it deletes mail from both the HAM and SPAM folders after it's been analyzed?
Yes, it's actually in the script already... only partially in place. I don't know that I'd totally dump the file because if it's empty the next time you run the script, you'll get errors that are harmless, but not needed.

I also wouldn't clean out the SPAM folder just because it is good to keep 500 spam messages ready to be re-learned in case the Spam Assassin databases become lost.

However, this will clean out the file.

Code:
#!/bin/sh
echo "Learning SPAM"
for FILE in `find $HOME -name SPAM -print`
do
    echo "Processing $FILE"
    sa-learn --spam --mbox $FILE
    cat /dev/null > $FILE
done

echo "Learning HAM"
for FILE in `find $HOME -name HAM -print`
do
    echo "Processing $FILE"
    sa-learn --ham  --mbox $FILE
    cat /dev/null > $FILE
done
echo "Done"

This will remove it altogether.
Code:
#!/bin/sh
echo "Learning SPAM"
for FILE in `find $HOME -name SPAM -print`
do
    echo "Processing $FILE"
    sa-learn --spam --mbox $FILE
    rm $FILE
done

echo "Learning HAM"
for FILE in `find $HOME -name HAM -print`
do
    echo "Processing $FILE"
    sa-learn --ham  --mbox $FILE
    rm $FILE
done
echo "Done"
__________________
clair
http://tch3.com
(dedicated)

Last edited by tch3; November 10th, 2004 at 9:35 PM..
tch3 is offline   Reply With Quote