Automatically empty spam folder

Automatically empty spam folder

We offer you the option of filtering spam email in to a folder called spam, this feature is called Spam Box and can be enabled in the SpamAssassin section of cPanel.

If you choose to use the Spam Box you should empty the spam folder regularly to ensure it doesn't use all your account quota. This guide shows you how to regularly and automatically empty the contents of your spam email folder.

Note: This guide will delete all emails in your spam folder regardless of how old the email is. It will do this for all your email addresses (if you have more than one email account set up).

  1. Download this file to your computer.

  2. Using Winzip extract spamprune.sh onto your computer.

  3. Upload spamprune.sh to your root directory. You'll know when you are in the right directory because the contents includes public_html, mail, public_ftp, tmp and etc.

  4. Change the permissions (CHMOD) of spamprune.sh to 755.

  5. Cron jobs IconLogin to cPanel, click the Cron jobs icon and select Standard mode.

  6. In the Command to run box enter:

    ~/spamprune.sh

  7. Then use the selection boxes to set when and how often you would like your spam folder to be emptied. Using the example below the spam folder will be emptied every Sunday at 3am. When you're happy with the settings, click the Save Crontab button.

Cron jobs settings

And you are done! Now your spam folder will be emptied at the time you specified.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Automatic database backups

You should always keep backups of your databases, but it's a lot of hassle to download one...

Reduce website loading times

We support HTTP compression, this speeds up the loading time of your website by compressing...

Publicly accessible statistics

It is possible to make your Webalizer usage statistics available to the public with an easy to...