Files
webmin/qmailadmin/detach_queue.cgi
Jamie Cameron dda9b972b9
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
Protect against SVG attachments in the mail queue
2026-10-14 21:21:22 -07:00

21 lines
463 B
Perl
Executable File

#!/usr/local/bin/perl
# detach_queue.cgi
# View one attachment from a queued message
require './qmail-lib.pl';
&ReadParse();
$mail = &read_mail_file($in{'file'});
&parse_mail($mail);
$attach = $mail->{'attach'}->[$in{'attach'}];
print "X-no-links: 1\n";
print "Content-type: $attach->{'type'}\n\n";
if ($attach->{'type'} =~ /^(text\/html|image\/svg|application\/xhtml)/i) {
print &filter_javascript($attach->{'data'});
}
else {
print $attach->{'data'};
}