To automatically delete old emails in cPanel, you can set up a cron job to remove messages older than a specified number of days. Follow these steps:

  1. Log in to your cPanel dashboard.
  2. Navigate to Cron Jobs under the Advanced section.
  3. Add the following command as a new cron job:

/usr/bin/archivemail –quiet –delete –days 20 /home/{USER}/mail/inbox

⚠️ Replace {USER} with your actual cPanel username.

This command will automatically delete emails that are older than 20 days from your inbox. You can customize the number of days as needed. Using this method helps you manage email storage efficiently and keep your inbox clean without manual intervention.

By admin