Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Brad Jennings on December 02, 2003, 10:25:35 PM

Title: Auto delete junkfolder after a given period
Post by: Brad Jennings on December 02, 2003, 10:25:35 PM
Is there a way to set a 5.6 machine to automatically delete emails in a folder after a given length of time.  I would like to setup everyone a junkfolder for SPAM ....but I would like to have it empty itself periodically without any user help.  Any suggestions would be appreciated.
Title: Re: Auto delete junkfolder after a given period
Post by: Michiel on December 03, 2003, 12:01:53 AM
I haven't really tested this, but you should be able to run a cronjob something like:

find /home/e-smith/files/users -path '*/;junkmail/*' -ctime +7 | xargs rm -f

Don't come after me if it wiped your entire disk :-)
Title: Re: Auto delete junkfolder after a given period
Post by: Michiel on December 03, 2003, 12:03:53 AM
After I hit the "post"button I saw that you're running 5.6, so it should be more like:

find /home/e-smith/files/users -path '*/junkmail/*' -ctime +7 | xargs rm -f

Michiel
Title: Re: Auto delete junkfolder after a given period
Post by: Brad Jennings on December 03, 2003, 01:49:31 AM
Thanks....I'll give it a try

DAMN IT....MY HARD DRIVE IS EMPTY!

Just kiddin
Title: Re: Auto delete junkfolder after a given period
Post by: Abe Loveless on December 04, 2003, 04:20:04 AM
The pdf here http://www.tech-geeks.org/contrib/loveless/mailServerSetup/

contains directions for using the script here
http://www.tech-geeks.org/contrib/loveless/spamassassin/