#!/usr/local/bin/perl
# delete_queues.cgi
# Delete multiple messages from the postfix queue

require './postfix-lib.pl';
$access{'mailq'} || &error($text{'mailq_ecannot'});
&ReadParse();

@qfiles = &recurse_files($config{'mailq_dir'});
foreach $f (split(/\0/, $in{'file'})) {
	$f =~ /^[A-Za-z0-9]+$/ || next;
	unlink(grep { $_ =~ /\/$f$/ } @qfiles);
	}
system("postsuper -p >/dev/null 2>&1");
&redirect("mailq.cgi");

