a shell to learn spam with spamassassin
时间:2006-11-08 来源:snowtty
Hi,
Here is a real easy to script to use to scan ALL domains/users for a .Spam folder and this will scan the new and cur directories within it and then deleted them if you want to.
#!/usr/local/bin/bash
spamlearn=/usr/local/bin/sa-learn
LearnDirs=`find /home/vpopmail/domains/ -name .Spam -type d`
for dir in $LearnDirs; do
$spamlearn --spam $dir/cur > /dev/null
$spamlearn --spam $dir/new > /dev/null
# the rm lines are optional
rm -f $dir/cur/*
rm -f $dir/new/*
$spamlearn --sync
done
I have something else I need to post but I can't seem to find it yet.
Here is a real easy to script to use to scan ALL domains/users for a .Spam folder and this will scan the new and cur directories within it and then deleted them if you want to.
#!/usr/local/bin/bash
spamlearn=/usr/local/bin/sa-learn
LearnDirs=`find /home/vpopmail/domains/ -name .Spam -type d`
for dir in $LearnDirs; do
$spamlearn --spam $dir/cur > /dev/null
$spamlearn --spam $dir/new > /dev/null
# the rm lines are optional
rm -f $dir/cur/*
rm -f $dir/new/*
$spamlearn --sync
done
I have something else I need to post but I can't seem to find it yet.
相关阅读 更多 +