Handle hostnames with upper-case letters
[webmin.git] / postfix / detach_queue.cgi
1 #!/usr/local/bin/perl
2 # detach_queue.cgi
3 # View one attachment from a queued message
4
5 require './postfix-lib.pl';
6 require './boxes-lib.pl';
7 &ReadParse();
8 $access{'mailq'} || &error($text{'mailq_ecannot'});
9
10 $mail = &parse_queue_file($in{'id'});
11 $mail || &error($text{'mailq_egone'});
12 &parse_mail($mail);
13 $attach = $mail->{'attach'}->[$in{'attach'}];
14
15 print "X-no-links: 1\n";
16 if ($attach->{'type'} eq 'message/delivery-status') {
17         print "Content-type: text/plain\n\n";
18         }
19 else {
20         print "Content-type: $attach->{'type'}\n\n";
21         }
22 if ($attach->{'type'} =~ /^text\/html/i) {
23         print &filter_javascript($attach->{'data'});
24         }
25 else {
26         print $attach->{'data'};
27         }
28