Fixes for #610 and #611 (#612)

* Recurse all mime parts at first level
Look for variants of text/html

* Fix conditional
This commit is contained in:
Shawn Iverson 2022-09-17 09:29:33 -04:00 committed by GitHub
parent 2fe569fd48
commit e9b8d0044a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4990,8 +4990,14 @@ sub SignExternalMessage {
my $sigcounter = 0;
$sigcounter += $this->SignExternalMessage($top->parts(0));
$sigcounter += $this->SignExternalMessage($top->parts(1))
if $top->head and $top->effective_type =~ /multipart\/alternative/i;
# https://github.com/MailScanner/v5/issues/611
my $parts = $top->parts;
if ($parts > 1) {
for (my $i = 1; $i < $parts; $i++) {
$sigcounter += $this->SignExternalMessage($top->parts($i))
if $top->head and $top->effective_type =~ /multipart\/alternative/i;
}
}
return $sigcounter;
}
@ -5008,7 +5014,8 @@ sub SignExternalMessage {
# Output message back into body, followed by original data
my($line, $io, $warning);
$io = $top->open("w");
if ($MimeType =~ /text\/html/i) {
# https://github.com/MailScanner/v5/issues/610
if ($MimeType =~ /text\/(.*)?html/i) {
MailScanner::Log::DebugLog("Debug: Adding external html for message %s", $this->{id});
$warning = $this->ReadExternalWarning('inlineexternalhtml');
#$warning = quotemeta $warning; # Must leave HTML tags alone!