2008/9/11 Timothy Murphy <gayleard at eircom.net>:
> On Tuesday 09 September 2008, Timothy Murphy wrote:
>> I have a directory containing about 50,000 email messages,
>> of which I am sure over 95% is spam.
>>>> What is the best (quickest) way of passing these messages through
>> spamassassin and deleting those that fail the test.
[snip]
> But surely there is an easier way of completing the task?
>> As always, I await the valued advice of the ILUG guruship.
What am I missing?
"""
for m in *; do spamc -E < $m || rm $m; done
"""
"spamc -E" should return false if it thinks it is spam, and true otherwise.
If you don't like "rm", then "mv $m probably-spam-dir/" instead.
If "*" expands too much, then try
ls | xargs get-rid-of-spam
where get-rid-of-spam is the above line in a shell script without "in *".
I'm assuming a sane Maildir format, where filenames don't include IFS.
(This looks very like Kingsley's earlier suggestion. That's not a surprise.)
Good luck,
f
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!