Amazon からの注文確定のメールを MHonArc が Nested start tags で拒否る.以下.
Warning: Rejecting Invalid HTML: Nested start tags
Message-Id: <xxxxxxxxxxxxxxxx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-xxxxxx@us-west-x.amazonses.com>
この Warning を吐くコードは以下で,
[/usr/share/mhonarc/mhtxthtml.pl]
# Bug-32013 (CVE-2010-4524): Invalid tags cause immediate rejection.
# Bug-32014 (CVE-2010-1677): Prevents DoS if massively nested.
my $allowcom = $args =~ /\ballowcomments\b/i;
strip_comments($fields, $data) unless $allowcom;
if ($$data =~ /<[^>]*</) {
# XXX: This will reject HTML that includes a '<' char in a
# comment declaration if allowcomments is enabled.
return bad_html_reject($fields, "Nested start tags");
}
/<[^>]*</
の正規表現で引っかかっている箇所は以下.確かに Amazon が悪い...
<!-- This is called in a loop from the MAIN template
## #foreach($orderId in $orderIds)-->
<!--Images-->
<!--ROW 4-->
<tr <td="" style="font-family: Arial, sans-serif !important">
</tr>
<!--Checks if the buyerName and groupName is null or empty-->
<tr style="font-family: Arial, sans-serif !important">
<td width="600" valign="top" style="font-family: Arial, sans-serif !important;border-collapse: collapse">
<!--Order Details Table-->
<table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;font-family: Arial, sans-serif !important">
CVE割当があって,
ちょっと嫌だけど,MHonArc に掛けるメールはフィルタ済み(特定の送信元; 発注情報共有目的)なので,bad_html_reject
の行をコメントアウトすることにした.