procmail
[Top] [All Lists]

Re: How to use Procmail to remove messages from server after x number of days

2011-03-01 13:24:29
On 3/2/2011 1:12 AM, LuKreme wrote:
On 1-Mar-2011, at 09:04, Tim Rice wrote:

I'm not sure if this is even possible, but I would like to automatically remove 
all mail for all users after 10 days

Easy! First, make sure you are using Maildir folders. then something very much 
like this will do it:

find /home/*/Maildir/.SPAM/{cur,new} -type f -ctime +7 -delete

I put this in a crontab to be run every day. Of course, change the +7 to +10 
(or whatever) and I only delete people's spam, but that's your choice.

using Procmail.

Hard.

Why are you making it hard?


I found this while googleing:

find /usr/boxes/rice/computerstuff.net/old/ -type f -mtime +10 -exec rm {} \;

I was going to test this on a new test box but after seeing your post I'm curious about the -ctime and -delete vs -mtime and -rm? Also, How can I be sure I'm using Maildir and not Mboxes?


--
Best Regards,

Tim Rice
Computer Stuff
Phuket Thailand 83000
Tel: +66 76 376165
Fax: +66 76 376165
www.computerstuff.net
www.phuket-mail.com
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>