* Nicholas Payne-Roberts wrote (11/07/06 11:58):
Does anybody know a good way to script sa-learn to daily check on junk
e-mail folders? i'm currently trying the following line in a cron.daily
script, but its throwing up an error:
find /home/vpopmail/domains -name ".Junk E-mail" -exec sa-learn
--showdots --spam cur {} \;
Your --exec subcommand is the problem. The {} expands to the full path
of the found file. It doesn't change directory. A version that might work is
find /home/vpopmail/domains -name ".Junk E-mail" -exec sa-learn
--showdots --spam {}/cur \;
There's not much point using --showdots in cron, I would have thought,
but it's probably useful for testing.
To make sure your find command is right, you can do something like this:
find /home/vpopmail/domains -name ".Junk E-mail" -exec echo "sa-learn
--showdots --spam {}/cur" \;
which will simply echo a list of commands that would get executed.
Chris