#!/usr/bin/perl #################### # Install to /usr/local/sbin/postfix-purge # Set permissions to root:root 0500 # # This little script removes old items from a Postfix defered outgoing mail queue. # Obtain the required MESSAGEID by running mailq. #################### if ($ARGV[0] ne "--force") { print "\nUse `postfix-purge --force MESSAGEID` to really purge defered message.\n\n"; exit; } print "Removing $ARGV[1]... "; `rm /var/spool/postfix/defer*/*/*/$ARGV[1]`; print "Done.\n";