3 # Display some message from the mail queue
5 require './qmail-lib.pl';
8 $mail = &read_mail_file($in{'file'});
11 $desc = &text('qview_desc', "<tt>$in{'file'}</tt>");
12 &ui_print_header($desc, $text{'qview_title'}, "");
14 print "<form action=delete_queue.cgi method=post>\n";
15 print "<input type=hidden name=file value='$in{'file'}'>\n";
16 print "<table width=100% border=1>\n";
17 print "<tr> <td $tb><b>$text{'qview_headers'}</b></td> </tr>\n";
18 print "<tr> <td $cb><table width=100%>\n";
19 print "<tr> <td><b>$text{'queue_from'}</b></td> ",
20 "<td>",&html_escape($mail->{'header'}->{'from'}),"</td> </tr>\n";
21 print "<tr> <td><b>$text{'queue_to'}</b></td> ",
22 "<td>",&html_escape($mail->{'header'}->{'to'}),"</td> </tr>\n";
23 print "<tr> <td><b>$text{'queue_cc'}</b></td> ",
24 "<td>",&html_escape($mail->{'header'}->{'cc'}),"</td> </tr>\n"
25 if ($mail->{'header'}->{'cc'});
26 print "<tr> <td><b>$text{'queue_date'}</b></td> ",
27 "<td>",&html_escape($mail->{'header'}->{'date'}),"</td> </tr>\n";
28 print "<tr> <td><b>$text{'queue_subject'}</b></td> ",
29 "<td>",&html_escape($mail->{'header'}->{'subject'}),"</td> </tr>\n";
30 print "</table></td></tr></table><p>\n";
32 # Find body attachment
33 @attach = @{$mail->{'attach'}};
34 foreach $a (@attach) {
35 if ($a->{'type'} eq 'text/plain') {
41 print "<table width=100% border=1><tr><td $cb><pre>\n";
42 foreach $l (&wrap_lines($body->{'data'}, $config{'wrap_width'})) {
43 print &link_urls_and_escape($l),"\n";
45 print "</pre></td></tr></table><p>\n";
48 # Display other attachments
49 @attach = grep { $_ ne $body } @attach;
50 @attach = grep { !$_->{'attach'} } @attach;
52 print "<table width=100% border=1>\n";
53 print "<tr> <td $tb><b>$text{'qview_attach'}</b></td> </tr>\n";
54 print "<tr> <td $cb>\n";
55 foreach $a (@attach) {
56 push(@titles, $a->{'filename'} ? $a->{'filename'}
58 push(@links, "detach_queue.cgi?file=$in{'file'}&attach=$a->{'idx'}");
59 push(@icons, "images/boxes.gif");
61 &icons_table(\@links, \@titles, \@icons, 8);
62 print "</td></tr></table><p>\n";
65 print "<input type=submit value='$text{'delete'}'></form>\n";
67 &ui_print_footer("list_queue.cgi", $text{'queue_return'});