📄 list_mailq.cgi
字号:
#!/usr/local/bin/perl# list_mailq.cgi# Display the current mail queuerequire './sendmail-lib.pl';$access{'mailq'} || &error($text{'mailq_ecannot'});print "Refresh: $config{'mailq_refresh'}\r\n" if ($config{'mailq_refresh'});&header($text{'mailq_title'}, "");print "<hr><p>\n";$conf = &get_sendmailcf();$mqueue = &mailq_dir($conf);opendir(QDIR, $mqueue);@qfiles = grep { /^qf/ } readdir(QDIR);closedir(QDIR);if (@qfiles) { print "<table border width=100%>\n"; print "<tr $tb> <td><b>$text{'mailq_id'}</b></td> ", "<td><b>$text{'mailq_sent'}</b></td> ", "<td><b>$text{'mailq_from'}</b></td> ", "<td><b>$text{'mailq_to'}</b></td> ", "<td><b>$text{'mailq_status'}</b></td> </tr>\n"; foreach $f (@qfiles) { $from = $to = $date = $text{'mailq_unknown'}; $status = $text{'mailq_sending'}; open(QFILE, "$mqueue/$f") || next; while(<QFILE>) { if (/To:\s+(.*)/) { $to = $1; } elsif (/From:\s+(.*)/) { $from = $1; } elsif (/Date:\s+(.*)/) { $date = $1; } elsif (/^M(.*)/) { $status = $1; } } close(QFILE); $from =~ s/</</g; $from =~ s/>/>/g; $to =~ s/</</g; $to =~ s/>/>/g; $date =~ s/\+.*//g; print "<tr $cb>\n"; if ($access{'mailq'} == 2) { print "<td><font size=1><a href=\"view_mailq.cgi?", "file=$f\">$f</a></font></td>\n"; } else { print "<td><font size=1>$f</font></td>\n"; } print "<td><font size=1>$date</font></td>\n"; print "<td><font size=1>$from</font></td>\n"; print "<td><font size=1>$to</font></td>\n"; print "<td><font size=1>$status</font></td>\n"; print "</tr>\n"; } print "</table><p>\n"; if ($access{'mailq'} == 2) { print $text{'mailq_dmsg'},"<br>\n"; } print &text('mailq_force', 'flushq.cgi'),"<p>\n"; }else { print "<b>$text{'mailq_none'}</b> <p>\n"; }print "<hr>\n";&footer("", $text{'index_return'});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -