• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

An alternative to qmHandle - a PHP Based Qmail Queue Spam Cleaner

C

criticman

Guest
For some reason, qmHandle randomly stopped working.

So, I wrote a replacement in PHP to meet my needs. All it does is delete messages containing a string of your choosing. It deletes the message, the info & remote files too.

Pretty basic, but it got the job done.

Details:
http://blog.criticman.com/2006/06/05/php-based-qmail-queue-spam-cleaner/

And here is the code:
PHP:
<?php
	/* Qmail-Queue-Cleaner.php
		Written by Matthew R Williams aka Criticman
		blog.criticman.com
		Some rights reserved.
		Please contact me if you wish to use this base code in an altered form and distribute it.
		All others welcome to use and alter for personal use (or commercial use - just do not sell it for a profit).
	*/
	
	echo "Qmail-Queue-Cleaner.php written by Criticman.\nhttp://blog.criticman.com\n\n";

	/* BEGIN USER CONFIGURATION */
	$spamLine = "/failure/"; // line of spam you want to look for in each message, in this case, 'failure'
	$messDir = "/var/qmail/queue/mess"; // location of qmail 'mess' directory
	/* END USER CONFIGURATION */
	
	echo "Searching for: " . $spamLine . "\n\n";
	
	chdir($messDir); 
	echo "Starting in... " . getcwd() . "\n";
	$handle = opendir(".");
	while (false !== ($file = readdir($handle))) {
		if ($file != "." && $file != "..") { 
			chdir($file);
			echo "\tNow in... " . getcwd() . "\n";
			$myHandle = opendir(".");
			while (false !== ($myFile = readdir($myHandle))) {
				if ($myFile != "." && $myFile != "..") {
					$fh = fopen($myFile,'rb');
					$fContents = fread($fh,1024);
					if(preg_match($spamLine,$fContents) == 1) {
						fclose($fh);
						echo "Deleting file..." . $file . "/" . $myFile . " ...done.\n";
						unlink($myFile);
						unlink("/var/qmail/queue/info/$file/$myFile");
						unlink("/var/qmail/queue/remote/$file/$myFile");
					} else {
						fclose($fh);
					}
				}
			}
			chdir("..");
		}
	} 
	closedir($handle);
	echo "Process completed (hopefully).\n";
	exit;
?>
 
Back
Top