Skip to content

Instantly share code, notes, and snippets.

@benwalton
benwalton / gist:1777718
Created Feb 9, 2012
Clean up emails in the queue. usage ./postfix-delete.pl email@example.com
View gist:1777718
#!/usr/bin/perl
$REGEXP = shift || die "no email-adress given (regexp-style, e.g. bl.*\@yahoo.com)!";
@data = qx</usr/sbin/postqueue -p>;
for (@data) {
if (/^(\w+)(\*|\!)?\s/) {
$queue_id = $1;
}
if($queue_id) {