Inline HTML Warning Bug

Berlakovich Felix (OeRK-W) Felix.Berlakovich at w.roteskreuz.at
Wed Mar 1 15:33:32 UTC 2017


Hi!

I think I might have found a bug in the inline HTML warning code in the function "SignWarningMessage" in "Message.pm". I was testing the attachment replacement and inline warning insertion with HTML mails. I noticed that mails created with Outlook had no inline warning inserted. Debugging into the code I found the reason on line 4601. The replacement regex tries to find the "<html>" starting tag, but Outlook additionally inserts a namespace, e.g

"<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">"

Changing the regex fixes the problem:

4595c4601
<       $line =~ s/\<html\>/$&$warning/i;
---
>       $line =~ s/\<html(.*)\>/$&$warning/i;

However, I am not sure about possible consequences. Any recommendations?

Best regards

Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mailscanner.info/pipermail/mailscanner/attachments/20170301/b3b91be1/attachment.html>


More information about the MailScanner mailing list