A custom command to rebuild all maps can be specified on the Module Config page, to be used instead of makemap or newaliases.
---- Changes since 1.450 ----
Changed the mail queue date format to yyyy/mm/dd, for easier sorting.
+---- Changes since 1.480 ----
+When flushing selected queued quarantined messages, the -qQ flag is added so that it actually works.
$access{'flushq'} || &error($text{'flushq_ecannot'});
&ui_print_unbuffered_header(undef, $text{'flushq_title'}, "");
- $cmd = "$config{'sendmail_path'} -v -C$config{'sendmail_cf'}";
- foreach $file (@files) {
- $file =~ s/^.*\///;
- $cmd .= " -qI$file";
- }
- if ($config{'mailq_order'}) {
- $cmd .= " -O QueueSortOrder=$config{'mailq_order'}";
+ # Split into quarantined and non-quarantined messages
+ local @mails = map { &mail_from_queue($_) } @files;
+ local @quar = grep { $_->{'quar'} } @mails;
+ local @nonquar = grep { !$_->{'quar'} } @mails;
+
+ foreach $ml (\@quar, \@nonquar) {
+ next if (!@$ml);
+ @files = map { $_->{'file'} } @$ml;
+ $cmd = "$config{'sendmail_path'} -v -C$config{'sendmail_cf'}";
+ if ($ml->[0]->{'quar'}) {
+ $cmd .= " -qQ";
+ }
+ foreach $file (@files) {
+ $file =~ s/^.*\///;
+ $cmd .= " -qI$file";
+ }
+ if ($config{'mailq_order'}) {
+ $cmd .= " -O QueueSortOrder=$config{'mailq_order'}";
+ }
+ print &text('flushq_desc2', scalar(@files)),"\n";
+ print "<pre>";
+ &foreign_require("proc", "proc-lib.pl");
+ &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0,
+ STDOUT, undef, 1);
+ print "</pre>\n";
}
- print &text('flushq_desc2', scalar(@files)),"\n";
- print "<pre>";
- &foreign_require("proc", "proc-lib.pl");
- &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0,
- STDOUT, undef, 1);
- print "</pre>\n";
&webmin_log("flushq", undef, scalar(@files));
}
else {
}
# mailq_table(&qfiles)
-# Print a table showing queued emails
+# Print a table showing queued emails. Returns the number quarantined.
sub mailq_table
{
local ($qfiles, $qmails) = @_;
+local $quarcount;
# Show buttons to flush and delete
print "<form action=del_mailqs.cgi method=post>\n";
print "<p>\n";
}
print "</form>\n";
+return $quarcount;
}
# is_table_comment(line, [force-prefix])