#!/usr/local/bin/perl # view_queue.cgi # Display some message from the mail queue require './qmail-lib.pl'; &ReadParse(); $mail = &read_mail_file($in{'file'}); &parse_mail($mail); $desc = &text('qview_desc', "$in{'file'}"); &ui_print_header($desc, $text{'qview_title'}, ""); print "
\n"; print "\n"; print "\n"; print "\n"; print "
$text{'qview_headers'}
\n"; print " ", "\n"; print " ", "\n"; print " ", "\n" if ($mail->{'header'}->{'cc'}); print " ", "\n"; print " ", "\n"; print "
$text{'queue_from'}",&html_escape($mail->{'header'}->{'from'}),"
$text{'queue_to'}",&html_escape($mail->{'header'}->{'to'}),"
$text{'queue_cc'}",&html_escape($mail->{'header'}->{'cc'}),"
$text{'queue_date'}",&html_escape($mail->{'header'}->{'date'}),"
$text{'queue_subject'}",&html_escape($mail->{'header'}->{'subject'}),"

\n"; # Find body attachment @attach = @{$mail->{'attach'}}; foreach $a (@attach) { if ($a->{'type'} eq 'text/plain') { $body = $a; last; } } if ($body) { print "
\n";
	foreach $l (&wrap_lines($body->{'data'}, $config{'wrap_width'})) {
		print &link_urls_and_escape($l),"\n";
		}
	print "

\n"; } # Display other attachments @attach = grep { $_ ne $body } @attach; @attach = grep { !$_->{'attach'} } @attach; if (@attach) { print "\n"; print "\n"; print "
$text{'qview_attach'}
\n"; foreach $a (@attach) { push(@titles, $a->{'filename'} ? $a->{'filename'} : $a->{'type'}); push(@links, "detach_queue.cgi?file=$in{'file'}&attach=$a->{'idx'}"); push(@icons, "images/boxes.gif"); } &icons_table(\@links, \@titles, \@icons, 8); print "

\n"; } print "

\n"; &ui_print_footer("list_queue.cgi", $text{'queue_return'});