How can I have spamassasin check a mail folder for spam and move it into a different one.
I've been getting a lot of spam recently and started implementing bayesian classifiers. I moved a bunch into a separate folder and trained it with 'sa-learn'.
Now I want spamassasin to use what it just learned and check all email in a folder for spam and move it into the spam folder if it considers it spam. (e.g. the Spam-Level is higher than 5.0 in my configuration.)
EDIT: I am storing my emails with the maildir format on the server.
Any idea?
Thanks in Advance
Below please find combined sample code from
man spamassassin
andman Mail::Box
.Add
$message->moveTo($destinationFolder)
in appropriate places after initial tests. The current version merely identifies oversized/spam/ham.(see
man Mail::Box::Message
for moveTo details)usage:
./scriptname maildir:/home/username/Maildir/.Folder/