> Liu Shuai wrote: > > > Hi all, > > > > I want to set up a system wide cron job that deletes old (2 weeks maybe) > > tagged spam from each user's > > spam folder, but I am not sure how. > > > > Does anybody here has a script that does similar job that I can use as a > > reference? If not, can some one > > give me some direction? I assume I need a parser that will > parse each user's > > spam folder so that I can > > retrieve the date of each message? > > > > Any suggestion will be appreciated. > > Hi, > > I don't have one in use right now but something similar to > > find . -path "*Maildir/.SPAM*" -ctime +14 -type f | xargs rm > > would be a good place to start. Be warned that the above will also > catch things like Maildir/.SPAM/maildirfolder, > Maildir/.SPAM/courierimapuiddb.lock, /Maildir/.SPAM/sqwebmail-curcnt etc > so it would probably need to be tuned to ignore files not in a cur or > new directory.
Thank you for your suggestion, Rick. Correct me if I am wrong, wouldn't all messages stored as one file? So even if I have old tagged message two weeks ago, the last changed time of that spam folder(mailbox) won't be the same if I got more spam later. LS ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk