LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Running spamassassin on a large number of email messages

[ILUG] Running spamassassin on a large number of email messages

Francis Daly francisdaly at gmail.com
Thu Sep 11 15:19:42 IST 2008


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



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell