mail scripts

Here you will find scripts to do various things with the mail system. I currently have 1 script to clean the mail queue by removing any emails that contain a search term you specify. The script is now available in 2 types, WHM manual cleaning and cron job auto cleaning.

Scroll down the page or use these links to go to the one you want.

- WHM Clean Mail Queue script
- Cron job Clean Mail Queue script

be sure to upload scripts in ascii mode


Clean Mail Queue script

Script to clean mail queue from WHM: addon_PWScleanmailqueue V2.1
  Created - July 5, 2005 (V1.0)
  Modified - December 7, 2005 (V1.5)

        - added ability to delete mail older than x days
  Modified - December 31, 2005 (V2.0)
        - modified to work with or without mail spool subdirectories
  Last Modified - April 4, 2006 (V2.1)
        - modified to be a WHM addon script
          (no customization is needed to the WHM skin)

This script allows you to clean up your mail queue from WHM.

Save the script file to your WHM's cgi directory, which should be at /usr/local/cpanel/whostmgr/docroot/cgi. Rename the file to addon_PWScleanmailqueue.cgi and make it executable. Set a couple variables in the script, and it will automatically be in your WHM theme.

"Scripts Club" members know where to find the script.


Cron job Clean Mail Queue script

Script to clean mail queue automatically from a cron job: PWSautocleanmailqueue V1.5
  Created - December 8, 2005 (V1.5)
  Last Modified - August 6, 2008 (V1.6)
        - fixed a small glitch that caused 0 for days to not work

This script allows you to clean up your mail queue automatically with a cron job.

Save the following files to any directory on your server. Rename the first one to PWSautocleanmailqueue.pl and make it executable. Set a couple variables in the script and your search terms in the data file, then set the script to run as a cron job. This is explained, and an example given, in the script and data file.

Auto Clean Mail Queue script V1.5 - rename to PWSautocleanmailqueue.pl
Auto Clean Mail Queue script data file


Custom Scripts main page

Scripts Club
for a small donation you get access to the WHM scripts and improved versions of other scripts,
as well as other luxuries of being a "Scripts Club" member.

Go Back

Photography everything - daphotography.com