diff --git a/common/usr/share/MailScanner/perl/MailScanner/Message.pm b/common/usr/share/MailScanner/perl/MailScanner/Message.pm index e8f0181..36e8ac2 100644 --- a/common/usr/share/MailScanner/perl/MailScanner/Message.pm +++ b/common/usr/share/MailScanner/perl/MailScanner/Message.pm @@ -4597,7 +4597,11 @@ sub SignWarningMessage { $warning = $this->ReadVirusWarning('inlinehtmlwarning'); #$warning = quotemeta $warning; # Must leave HTML tags alone! foreach $line (@body) { - $line =~ s/\/$&$warning/i; + # html tags can have extra attributes. In a case where the tag + # has attributes and is closed on a subsequent line, the warning will + # actually be in the tag, but it's malformed in any case because it + # precedes any and tags and clients seem to render it OK. + $line =~ s/\]*)?(\>|$)/$&$warning/i; $io->print($line); } } else {