GUIDE AUTOMATICALLY EMPTY READ EMAILS AND RECYCLE BIN IN WEBMAIL 2020 -WAU

Home/Posts/Administración del Hosting/GUIDE AUTOMATICALLY EMPTY READ EMAILS AND RECYCLE BIN IN WEBMAIL 2020 -WAU

Automatically empty read emails and recycle bin in Webmail

This is a very frequent topic, many times we find the unpleasant news that our emails are “bouncing” because our disk quota is full.

In addition to this, the cleaning process takes too much time and finally it is an overwhelming job, reviewing, reading, deleting and finally emptying the trash of our email client.

In order to automate this cleaning we can insert a command that removes the content of a certain directory in our cPanel through a cron task.

First of all, we will explain the meaning of each email directory that are subdirectories like .Drafts .Trash and .Sent, each of these 3 subdirectories contains 3 more subdirectories called tmp, new and cur.

– tmp.- This subdirectory stores email messages that are in the process of being delivered and that stores other temporary files.

– new.- This subdirectory stores messages that have already been delivered, but have not yet been read by the email application, be it Horde, Roundcube, Outlook, etc.

– cur.- This subdirectory stores the messages that have already been read by the different email applications, be it Horde, Roundcube, Outlook, etc.

In order to create the cron task, we recommend the blog article at the following link: https://www.webempresa.com/blog/item/1520-crear-una-tarea-cron-en-cpanel-i.html

In the following video by Jordi Sala you can see how Cron Jobs is managed from cpanel.

To delete the emails already read from the accounts we will have to create a cron that runs once a day and that has the following command:

find / home /bill/ mail /yourdomain.com/ * / cur -type f -mtime +days -exec rm -f {};

Where:
bill is the user of your cPanel.
yourdomain.com is the domain of our website.
days is the value in numbers of the number of days.

Example:

find /home/webemp/mail/webempresa.com/*/cur -type f -mtime +30 -exec rm -f {} ;

With this command we empty the emails already read from the email accounts of webempresa.com that are older than 30 days.

Example:

find /home/webemp/mail/webempresa.com/*/.Trash -type f -mtime +10 -exec rm -f {} ;

With this command we empty the recycle bin of all the email accounts of webempresa.com that are older than 10 days.

Websites Are Us team member: Joomla, WordPress and Woocommerce technical support.

By |2020-07-09T14:03:25+00:00May 12th, 2020|Administración del Hosting|