David B Funk wrote:

Try:

find . -type f -print | xargs -i echo "spamc -r < {}" | sh


Incidentally, "-print" is implied if you don't use "-exec" (and probably a few other things). So, you can just say
"find . -type f | ..."


Also, I prefer the "-c" option, since it claims to set the exitcode. So... you can do a one-liner like:

for name in `find . -type f`; do if (spamc -c < $name > /dev/null); then echo "$name is spam"; rm "$name"; fi; done

I'm not certain that this doesn't work the OPPOSITE of how it should (as written, it might delete all of the HAM), so TEST it without the "rm" first. Also, you can replace the "rm" with any set of stuff you want.... you can quarantine the message, add it to a zip, or whatever.

Reply via email to