Hi,
Is there a script for whm that deletes all mails older than XX years for all accounts on the server ?
Thanks !
Hi,
Is there a script for whm that deletes all mails older than XX years for all accounts on the server ?
Thanks !
If the files haven't been accessed and have the older timestamp then you can delete the emails using find command.We will look for any files that are more than 2 years (2*365=730 days) old. A simpler command can be as but it needs to be further modified as per requirements.
find /home/*/mail -type f -mtime +730 | xargs rm -vf
You can set it as cron. Before running the command you should see what find command finds:
find /home/*/mail -mtime +730 > /home/emails.list