ok, any special caracter which get encoded corrupte the signature.
<html><head>
</head>
<body>
{#mailcontent#}
</body>
</html>
=> OK
<html><head>
<style=”text/css”></style>
</head>
<body>
{#mailcontent#}
</body>
</html>
=> Not OK (the ” in <style is encoded to 3D”)
Maybe some html escaping is missing in the code.
(the mail gateway escape the html. That changes the content and as a consequence, the signature become invalid)