3 # Delete some mail message from the queue
5 require './sendmail-lib.pl';
6 require './boxes-lib.pl';
10 # Just go to flushing page
11 &redirect("del_mailqs.cgi?flush=1&file=".&urlize($in{'file'}));
15 &error_setup($text{'delq_err'});
16 $access{'mailq'} == 2 || &error($text{'delq_ecannot'});
17 $in{'file'} =~ /\.\./ && &error($text{'delq_ecannot'});
18 $conf = &get_sendmailcf();
19 foreach $mqueue (&mailq_dir($conf)) {
20 $ok++ if ($in{'file'} =~ /^$mqueue\//);
22 $ok || &error($text{'mailq_ecannot'});
25 $mail = &mail_from_queue($qfile, "auto");
26 &can_view_qfile($mail) || &error($text{'delq_ecannot'});
28 if (-r $mail->{'lfile'} && !$in{'force'}) {
29 &ui_print_header(undef, $text{'delq_title'}, "");
30 print "<center><form action=del_mailq.cgi>\n";
31 print "<b>$main::whatfailed : $text{'delq_locked'}</b><p>\n";
32 print "<input type=hidden name=file value='$in{'file'}'>\n";
33 print "<input type=submit name=force value='$text{'delq_force'}'>\n";
34 print "</form></center>\n";
35 &ui_print_footer("list_mailq.cgi", $text{'mailq_return'});
39 unlink($mail->{'file'}, $mail->{'dfile'}, $mail->{'lfile'});
40 &webmin_log("delmailq", undef, undef, { 'to' => $mail->{'header'}->{'to'},
41 'from' => $mail->{'header'}->{'from'} });
42 &redirect("list_mailq.cgi");