Spam Assassin and removing spam...

chasjs

Verified User
Joined
Nov 1, 2004
Messages
48
Location
Colorado
I have set up spam assassin and it is working fine. I am having the spam routed to the to the users spam folder. What I would like to do is come up with something that would delete email from the spam folder after a set amount of time - 10 days.

Is there an easy way to do this through Exim??
 
Not through exim.

I believe some folk have posted some ideas already.

Is the spamfolder a Maildir folder or an mbox file?

If it's a Maildir folder it's pretty easy; you write a scriopt (run from perhaps cron.daily) that will find all files in the directory older than a certain date, and just delete them.

But if it's an mbox file you'll have to grep through the file to find out when certain emails were received into the file, and then rewrite the mbox file with only the emails you don't want deleted.

If you use the latter method you'll have to lock access to the mbox during the time you're running your script, or the file will become corrupted.

Jeff
 
Jeff:

It is the standard folder that is created through the DA interface with SA when you select "Send the spam to appropriate user's spam folder."

How would I determine what type of folder that it is?

Chuck
 
Find it :) .

If it's a folder with a file in it for each email, then it's Maildir.

If it's a file with all the emails in the file, one after another, then it's mbox.

Jeff
 
I have found the file is mbox. That is not an attractive format to me. So I am looking into converting to Maildir. I have found a post with links to scripts that do the conversion. I am going to do a little more research on this. Thanks for the comments.
 
Back
Top