Are there any cleanup tasks?

keat63

Well-Known Member
Nov 20, 2014
1,963
267
113
cPanel Access Level
Root Administrator
I have a forward rule configured whereby online orders coming from our OS Commerce site are automatically CC'd to a seperate mailbox for my MD.
However, he's a bit lazy in the respect that he doesn't delete these mails when he's seen them.
Every so often I will open up the mailbox using Horde, and clean out a few months worth of emails.
Are there any automated tasks that would do this for me. on say a monthly basis.
Something along the lines, on the 1st of the month, clear out anything older than 30 days.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hi @keat63


You might be able to create a one-liner that uses mtime to remove messages older than x days and add it as a cron such as:


Code:
find /path/to/files* -mtime +5 -exec rm {} \;
mtime +5 is older than 5 days.


You can also manually remove items like this through cPanel>>Mail>>Email Disk usage