On one mail system an image doesn't load because it's being removed with wildly obsolete Microsoft Office conditional comments:
<!--[if mso]>
<a><img /></a>
<![endif]-->
However the image loads fine in RoundCube. The code basically says, in short, only load the business logo if they're using MS Office, otherwise, have a big empty header. Obviously, 12 table elements deep, whatever was used to create this monstrosity of an "HTML" email was very poorly "programmed".
But a lot of times when just the comments (but not the code within the conditional comments) is stripped it results in (even more) malformed XML.
What was the rational around simply removing the MS Office conditional comments but keeping the HTML code (and "HTML"-like code) within it?
could you provide a sample message?
Quote from: JohnDoh on September 30, 2025, 02:53:57 PMcould you provide a sample message?
Sure John, I stripped out the links and made the images relative to protect the business from being associated with this terrible "HTML":
<body>
<div styl=
e=3D"display:none;"><img src=3D"track/open.php?u=3Dec724841842e67b5c2f3a9e59&id=3D3f5d18f060&e=3D256963ff96" height=3D"1" width=3D"1" style=3D"display:none;" alt=3D""></div>
<center>
<table border=3D"0" cellpadding=3D"0" height=3D"100%" wi=
dth=3D"100%" id=3D"bodyTable" style=3D"background-color: rgb(244=2C 244=2C=
244);">
<tbody><tr>
<td class=3D"bodyCell" align=3D"center" valign=3D"top">
<table id=3D"root" border=3D"0" cellpadding=3D"0" width=
=3D"100%"><tbody data-block-id=3D"3" class=3D"mceWrapper"><tr><td style=3D=
"background-color:transparent" valign=3D"top" align=3D"center" class=3D"mc=
eSectionHeader"><!--[if (gte mso 9)|(IE)]><table align=3D"center" border=
=3D"0" cellpadding=3D"0" width=3D"660" style=3D"width:66=
0px;"><tr><td><![endif]--><table border=3D"0" cellpadding=3D"0" cellspaci=
ng=3D"0" width=3D"100%" style=3D"max-width:660px" role=3D"presentation"><t=
body><tr><td style=3D"background-color:#ffffff" valign=3D"top" class=3D"mc=
eWrapperInner"><table align=3D"center" border=3D"0" cellpadding=3D"0" cell=
spacing=3D"0" width=3D"100%" role=3D"presentation" data-block-id=3D"2"><tb=
ody><tr class=3D"mceRow"><td style=3D"background-position:center;backgroun=
d-repeat:no-repeat;background-size:cover" valign=3D"top"><table border=3D"=
0" cellpadding=3D"0" width=3D"100%" role=3D"presentation=
"><tbody><tr><td style=3D"padding-top:0;padding-bottom:0" valign=3D"top" c=
lass=3D"mceColumn" id=3D"mceColumnId--6" data-block-id=3D"-6" colspan=3D"1=
2" width=3D"100%"><table border=3D"0" cellpadding=3D"0" cellspacing=3D"0"=
width=3D"100%" role=3D"presentation"><tbody><tr><td style=3D"background-c=
olor:transparent;padding-top:48px;padding-bottom:24px;padding-right:24px;p=
adding-left:24px;border:0;border-radius:0" valign=3D"top" class=3D"mceImag=
eBlockContainer" align=3D"center" id=3D"b1"><div><!--[if !mso]><!--></div=
><a href=3D"" style=3D"display:b=
lock" target=3D"_blank" data-block-id=3D"1"><table align=3D"center" border=
=3D"0" cellpadding=3D"0" width=3D"100%" style=3D"border-=
collapse:separate;margin:0;vertical-align:top;max-width:100%;width:100%;he=
ight:auto" role=3D"presentation" data-testid=3D"image-1"><tbody><tr><td st=
yle=3D"border:0;border-radius:0;margin:0" valign=3D"top"><img alt=3D"logo"=
src=3D"https://mcusercontent.com/ec724841842e67b5c2f3a9e59/images/4c164cb=
2-b551-a63f-8737-ec6318199eee.png" width=3D"612" height=3D"auto" style=3D"=
display:block;max-width:100%;height:auto;border-radius:0" class=3D"mceLogo=
" /></td></tr></tbody></table></a><div><!--<![endif]--></div><div>
<!--[if mso]>
<a href=3D""><span class=3D"mceImageBorder" s=
tyle=3D"border:0;border-width:2px;vertical-align:top;margin:0"><img role=
=3D"presentation" class=3D"mceLogo" src=3D"https://mcusercontent.com/ec724=
841842e67b5c2f3a9e59/images/4c164cb2-b551-a63f-8737-ec6318199eee.png" alt=
=3D"logo" width=3D"612" height=3D"auto" style=3D"display:block;max-width:6=
12px;width:612px;height:auto"/></span></a>
<![endif]-->
</div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbod=
y></table></td></tr></tbody></table><!--[if (gte mso 9)|(IE)]></td></tr><=
/table><![endif]--></td></tr></tbody><tbody data-block-id=3D"7" class=3D"=
mceWrapper"><tr><td style=3D"background-color:transparent" valign=3D"top"=
align=3D"center" class=3D"mceSectionBody"><!--[if (gte mso 9)|(IE)]><tab=
le align=3D"center" border=3D"0" cellpadding=3D"0" width=
=3D"660" style=3D"width:660px;"><tr><td><![endif]--><table border=3D"0" c=
ellpadding=3D"0" width=3D"100%" style=3D"max-width:660px=
" role=3D"presentation"><tbody><tr><td style=3D"background-color:#ffffff"=
valign=3D"top" class=3D"mceWrapperInner"><table align=3D"center" border=
=3D"0" cellpadding=3D"0" width=3D"100%" role=3D"presenta=
tion" data-block-id=3D"6"><tbody><tr class=3D"mceRow"><td style=3D"backgro=
und-position:center;background-repeat:no-repeat;background-size:cover" val=
ign=3D"top"><table border=3D"0" cellpadding=3D"0" width=
=3D"100%" role=3D"presentation"><tbody><tr><td style=3D"padding-top:0;padd=
ing-bottom:0" valign=3D"top" class=3D"mceColumn" id=3D"mceColumnId--7" dat=
a-block-id=3D"-7" colspan=3D"12" width=3D"100%"><table border=3D"0" cellpa=
dding=3D"0" width=3D"100%" role=3D"presentation"><tbody>=
<tr><td valign=3D"top" class=3D"mceGutterContainer" id=3D"gutterContainerI=
d-17"><table border=3D"0" cellpadding=3D"0" width=3D"100=
%" style=3D"border-collapse:separate" role=3D"presentation"><tbody><tr><td=
style=3D"padding-top:8px;padding-bottom:8px;padding-right:0;padding-left:=
0;border:0;border-radius:0" valign=3D"top" id=3D"b17"><table align=3D"cent=
er" border=3D"0" cellpadding=3D"0" width=3D"100%" role=
=3D"presentation" data-block-id=3D"17" id=3D"section_ccd431919ae8405ec26ae=
634ceef4836" class=3D"mceLayout"><tbody><tr class=3D"mceRow"><td style=3D"=
background-position:center;background-repeat:no-repeat;background-size:cov=
er" valign=3D"top"><table border=3D"0" cellpadding=3D"0" cellspacing=3D"0"=
width=3D"100%" role=3D"presentation"><tbody><tr><td valign=3D"top" class=
=3D"mceColumn" id=3D"mceColumnId--9" data-block-id=3D"-9" colspan=3D"12" w=
idth=3D"100%"><table border=3D"0" cellpadding=3D"0" widt=
h=3D"100%" role=3D"presentation"><tbody><tr><td style=3D"border:0;border-r=
adius:0" valign=3D"top" align=3D"center" id=3D"b-5"><table align=3D"center=
" border=3D"0" cellpadding=3D"0" width=3D"100%" role=3D"=
presentation" data-block-id=3D"-5"><tbody><tr class=3D"mceRow"><td style=
=3D"background-position:center;background-repeat:no-repeat;background-size=
:cover" valign=3D"top"><table border=3D"0" cellpadding=3D"0" cellspacing=
=3D"0" width=3D"100%" role=3D"presentation"><tbody><tr><td valign=3D"top"=
class=3D"mceColumn" id=3D"mceColumnId--11" data-block-id=3D"-11" colspan=
=3D"12" width=3D"100%"><table border=3D"0" cellpadding=3D"0" cellspacing=
=3D"0" width=3D"100%" role=3D"presentation"><tbody><tr><td style=3D"border=
:0;border-radius:0" valign=3D"top" id=3D"b16"><table align=3D"center" bord=
er=3D"0" cellpadding=3D"0" width=3D"100%" role=3D"presen=
tation" data-block-id=3D"16"><tbody><tr class=3D"mceRow"><td style=3D"back=
ground-position:center;background-repeat:no-repeat;background-size:cover"=
valign=3D"top"><table border=3D"0" cellpadding=3D"0" cellspacing=3D"24" w=
idth=3D"100%" role=3D"presentation"><tbody><tr><td style=3D"padding-top:0;=
padding-bottom:0" valign=3D"top" class=3D"mceColumn" id=3D"mceColumnId-15"=
data-block-id=3D"15" colspan=3D"12" width=3D"100%"><table border=3D"0" ce=
llpadding=3D"0" width=3D"100%" role=3D"presentation"><tb=
ody><tr><td style=3D"padding-top:0;padding-bottom:0;padding-right:0;paddin=
g-left:0" valign=3D"top" class=3D"mceGutterContainer" id=3D"gutterContaine=
rId-5"><table border=3D"0" cellpadding=3D"0" width=3D"10=
0%" style=3D"border-collapse:separate" role=3D"presentation"><tbody><tr><t=
d style=3D"padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;b=
order:0;border-radius:0" valign=3D"top" id=3D"b5"><table width=3D"100%" st=
yle=3D"border:0;background-color:transparent;border-radius:0;border-collap=
se:separate"><tbody><tr><td style=3D"padding-left:24px;padding-right:24px;=
padding-top:12px;padding-bottom:12px" class=3D"mceTextBlockContainer"><div=
data-block-id=3D"5" class=3D"mceText" id=3D"d5" style=3D"width:100%"><p><=
br /></p><p class=3D"mcePastedContent"><br /></p><p class=3D"mcePastedCont=
ent" style=3D"line-height: 1.5; margin-top: 12pt; margin-bottom: 12pt; mso=
-line-height-alt: 150%; direction: ltr;"><span style=3D"color:rgb(0=2C 0=
=2C 0);"><span style=3D"font-size: 11pt"><span style=3D"font-family: Arial=
=2C sans-serif"><span style=3D"background-color: transparent">Howdy=2C</span></span></span></span></p><p class=3D"mcePastedContent"=
style=3D"line-height: 1.5; margin-top: 12pt; margin-bottom: 12pt; mso-lin=
e-height-alt: 150%; direction: ltr;"><span style=3D"color:rgb(0=2C 0=2C 0)=
;"><span style=3D"font-size: 11pt"><span style=3D"font-family: Arial=2C sa=
ns-serif"><span style=3D"background-color: transparent">I know you=E2=80=
=99re always looking out for your clients=2C and sometimes the financial s=
ide is the part that stresses them the most. To make your job easier=2C I=
put together a free tool you can share with them:</span></span></span></s=
pan></p><p class=3D"mcePastedContent" style=3D"line-height: 1.5; margin-to=
p: 12pt; margin-bottom: 12pt; mso-line-height-alt: 150%; direction: ltr;">=
<span style=3D"color:rgb(0=2C 0=2C 0);"><span style=3D"font-size: 11pt"><s=
pan style=3D"font-family: Arial=2C sans-serif"><span style=3D"background-c=
olor: transparent">=F0=9F=91=89 </span></span></span></span><a href=3D"" target=3D"_blank"><span style=3D"=
font-size: 11pt"><span style=3D"font-family: Arial=2C sans-serif"><span st=
yle=3D"background-color: transparent">Download the Expense Tracker</span><=
/span></span></a></p><p class=3D"mcePastedContent" style=3D"line-height: 1=
=2E5; margin-top: 12pt; margin-bottom: 12pt; mso-line-height-alt: 150%; dire=
ction: ltr;"><span style=3D"color:rgb(0=2C 0=2C 0);"><span style=3D"font-s=
ize: 11pt"><span style=3D"font-family: Arial=2C sans-serif"><span style=3D=
"background-color: transparent">It=E2=80=99s simple=2C straightforward=2C=
and helps business owners keep track of income and expenses without getti=
ng lost in QuickBooks. Partners tell me it=E2=80=99s the kind of resource=
that builds instant goodwill when they pass it along.</span></span></span=
></span></p><p class=3D"mcePastedContent" style=3D"line-height: 1.5; margi=
n-top: 12pt; margin-bottom: 12pt; mso-line-height-alt: 150%; direction: lt=
r;"><span style=3D"color:rgb(0=2C 0=2C 0);"><span style=3D"font-size: 11pt=
"><span style=3D"font-family: Arial=2C sans-serif"><span style=3D"backgrou=
nd-color: transparent">To make it even easier=2C here=E2=80=99s a quick bl=
urb you can copy/paste if you=E2=80=99d like to forward it:</span></span><=
/span></span></p><p class=3D"mcePastedContent" style=3D"line-height: 1.5;=
margin-left: 30pt; margin-right: 30pt; margin-top: 12pt; margin-bottom: 1=
2pt; mso-line-height-alt: 150%; direction: ltr;"><em><span style=3D"color:=
rgb(0=2C 0=2C 0);"><span style=3D"font-size: 11pt"><span style=3D"font-fam=
ily: Arial=2C sans-serif"><span style=3D"background-color: transparent">=
=E2=80=9CHere=E2=80=99s a free expense tracker I came across. It=E2=80=99s=
simple=2C easy=2C and helps keep income and expenses in one place. Though=
t you might find it useful!=E2=80=9D</span></span></span></span></em></p><=
p class=3D"mcePastedContent" style=3D"line-height: 1.5; margin-top: 12pt;=
margin-bottom: 12pt; mso-line-height-alt: 150%; direction: ltr;"><span st=
yle=3D"color:rgb(0=2C 0=2C 0);"><span style=3D"font-size: 11pt"><span styl=
e=3D"font-family: Arial=2C sans-serif"><span style=3D"background-color: tr=
ansparent">Feel free to pass this along to anyone in your circle who could=
use it. It=E2=80=99s my way of giving you something practical that adds v=
alue to your relationships=2C and if they ever need deeper bookkeeping sup=
port=2C I=E2=80=99m here.</span></span></span></span></p><p class=3D"mcePa=
stedContent" style=3D"line-height: 1.5; margin-top: 12pt; margin-bottom: 1=
2pt; mso-line-height-alt: 150%; direction: ltr;"><span style=3D"color:rgb(=
0=2C 0=2C 0);"><span style=3D"font-size: 11pt"><span style=3D"font-family:=
Arial=2C sans-serif"><span style=3D"background-color: transparent">Thanks=
again for being part of my referral network. I really appreciate what you=
do.</span></span></span></span></p><p class=3D"mcePastedContent" style=3D=
"line-height: 1.5; margin-top: 12pt; margin-bottom: 12pt; mso-line-height-=
alt: 150%; direction: ltr;"><span style=3D"color:rgb(0=2C 0=2C 0);"><span=
style=3D"font-size: 11pt"><span style=3D"font-family: Arial=2C sans-serif=
"><span style=3D"background-color: transparent">With appreciation=2C<br />=
---<br />---</span></span></span></span>=
</p><p class=3D"mcePastedContent last-child"><br /></p></div></td></tr></t=
body></table></td></tr></tbody></table></td></tr></tbody></table></td></tr=
></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td>=
</tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><=
/td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></tab=
le></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody><=
/table></td></tr></tbody></table><!--[if (gte mso 9)|(IE)]></td></tr></ta=
ble><![endif]--></td></tr></tbody><tbody data-block-id=3D"13" class=3D"mc=
eWrapper"><tr><td style=3D"background-color:transparent" valign=3D"top" al=
ign=3D"center" class=3D"mceSectionFooter"><!--[if (gte mso 9)|(IE)]><tabl=
e align=3D"center" border=3D"0" cellpadding=3D"0" width=
=3D"660" style=3D"width:660px;"><tr><td><![endif]--><table border=3D"0" c=
ellpadding=3D"0" width=3D"100%" style=3D"max-width:660px=
" role=3D"presentation"><tbody><tr><td style=3D"background-color:#ffffff"=
valign=3D"top" class=3D"mceWrapperInner"><table align=3D"center" border=
=3D"0" cellpadding=3D"0" width=3D"100%" role=3D"presenta=
tion" data-block-id=3D"12"><tbody><tr class=3D"mceRow"><td style=3D"backgr=
ound-position:center;background-repeat:no-repeat;background-size:cover" va=
lign=3D"top"><table border=3D"0" cellpadding=3D"0" width=
=3D"100%" role=3D"presentation"><tbody><tr><td style=3D"padding-top:0;padd=
ing-bottom:0" valign=3D"top" class=3D"mceColumn" id=3D"mceColumnId--8" dat=
a-block-id=3D"-8" colspan=3D"12" width=3D"100%"><table border=3D"0" cellpa=
dding=3D"0" width=3D"100%" role=3D"presentation"><tbody>=
<tr><td style=3D"background-color:transparent;padding-top:12px;padding-bot=
tom:12px;padding-right:24px;padding-left:24px;border:0;border-radius:0" va=
lign=3D"top" class=3D"mceButtonBlockContainer" align=3D"center" id=3D"b18"=
><div><!--[if !mso]><!--></div><table align=3D"center" border=3D"0" cellp=
adding=3D"0" role=3D"presentation" data-block-id=3D"18"=
class=3D"mceButtonContainer"><tbody><tr class=3D"mceStandardButton"><td s=
tyle=3D"background-color:#000000;border-radius:50px;text-align:center" val=
ign=3D"top" class=3D"mceButton"><a href=3D"" target=3D"_blank" class=3D"mc=
eButtonLink" style=3D"background-color:#000000;border-radius:50px;border:2=
px solid #000000;color:#ffffff;display:block;font-family:'Helvetica Neue'=
=2C Helvetica=2C Arial=2C Verdana=2C sans-serif;font-size:16px;font-weight=
:normal;font-style:normal;padding:16px 28px;text-decoration:none;text-alig=
n:center;direction:ltr;letter-spacing:0px" rel=3D"noreferrer">Free Expense=
Tracker</a></td></tr></tbody></table><div><!--<![endif]--></div><table a=
lign=3D"center" border=3D"0" cellpadding=3D"0" role=3D"p=
resentation" data-block-id=3D"18" class=3D"mceButtonContainer"><tbody><tr>
<!--[if mso]>
<td align=3D"center">
<v:roundrect xmlns:v=3D"urn:schemas-microsoft-com:vml"
xmlns:w=3D"urn:schemas-microsoft-com:office:word"
href=3D""
style=3D"v-text-anchor:middle; width:217.41px; height:54px;"
arcsize=3D"23%"
strokecolor=3D"#000000"
strokeweight=3D"2px"
fillcolor=3D"#000000">
<v:stroke dashstyle=3D"solid"/>
<w:anchorlock />
<center style=3D"
color: #ffffff;
display: block;
font-family: 'Helvetica Neue'=2C Helvetica=2C Arial=2C Verdana=2C sans-ser=
if;
font-size: 16;
font-style: normal;
font-weight: normal;
letter-spacing: 0px;
text-decoration: none;
text-align: center;
direction: ltr;"
>
Free Expense Tracker
</center>
</v:roundrect>
</td>
<![endif]-->
</tr></tbody></table></td></tr><tr><td style=3D"background-color:#f4f4f4;p=
adding-top:8px;padding-bottom:8px;padding-right:8px;padding-left:8px;borde=
r:0;border-radius:0" valign=3D"top" class=3D"mceLayoutContainer" id=3D"b11=
"><table align=3D"center" border=3D"0" cellpadding=3D"0" cellspacing=3D"0"=
width=3D"100%" role=3D"presentation" data-block-id=3D"11" id=3D"section_3=
f2233b0e5885a18e880c8a37d6d7ae4" class=3D"mceFooterSection"><tbody><tr cla=
ss=3D"mceRow"><td style=3D"background-color:#f4f4f4;background-position:ce=
nter;background-repeat:no-repeat;background-size:cover;padding-top:0px;pad=
ding-bottom:0px" valign=3D"top"><table border=3D"0" cellpadding=3D"0" cell=
spacing=3D"12" width=3D"100%" role=3D"presentation"><tbody><tr><td style=
=3D"padding-top:0;padding-bottom:0" valign=3D"top" class=3D"mceColumn" id=
=3D"mceColumnId--3" data-block-id=3D"-3" colspan=3D"12" width=3D"100%"><ta=
ble border=3D"0" cellpadding=3D"0" width=3D"100%" role=
=3D"presentation"><tbody><tr><td style=3D"padding-top:0;padding-bottom:0;p=
adding-right:0;padding-left:0" valign=3D"top" class=3D"mceGutterContainer"=
id=3D"gutterContainerId-9"><table border=3D"0" cellpadding=3D"0" cellspac=
ing=3D"0" width=3D"100%" style=3D"border-collapse:separate" role=3D"presen=
tation"><tbody><tr><td style=3D"padding-top:0;padding-bottom:0;padding-rig=
ht:0;padding-left:0;border:0;border-radius:0" valign=3D"top" align=3D"cent=
er" id=3D"b9"><table width=3D"100%" style=3D"border:0;background-color:tra=
nsparent;border-radius:0;border-collapse:separate"><tbody><tr><td style=3D=
"padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px=
" class=3D"mceTextBlockContainer"><div data-block-id=3D"9" class=3D"mceTex=
t" id=3D"d9" style=3D"display:inline-block;width:100%"><p class=3D"last-ch=
ild"><a href=3D""><span style=3D"font-size: 11px">View emai=
l in browser</span></a><span style=3D"font-size: 11px"><br />
· 707 N 4th St · Yakima=2C WA 989=
01-2235 · USA
<br /></span><a href=3D"
"><span style=3D"font-size: 11px">update your preferences</span></a><span=
style=3D"font-size: 11px"> or </span><a href=3D""><span style=3D"font-size: 11px">unsub=
scribe</span></a></p></div></td></tr></tbody></table></td></tr></tbody></t=
able></td></tr><tr><td style=3D"border:0;border-radius:0" valign=3D"top" c=
lass=3D"mceLayoutContainer" align=3D"center" id=3D"b-2"><table align=3D"ce=
nter" border=3D"0" cellpadding=3D"0" width=3D"100%" role=
=3D"presentation" data-block-id=3D"-2"><tbody><tr class=3D"mceRow"><td sty=
le=3D"background-position:center;background-repeat:no-repeat;background-si=
ze:cover" valign=3D"top"><table border=3D"0" cellpadding=3D"0" cellspacing=
=3D"0" width=3D"100%" role=3D"presentation"><tbody><tr><td valign=3D"top"=
class=3D"mceColumn" id=3D"mceColumnId--10" data-block-id=3D"-10" colspan=
=3D"12" width=3D"100%"><table border=3D"0" cellpadding=3D"0" cellspacing=
=3D"0" width=3D"100%" role=3D"presentation"><tbody><tr><td style=3D"border=
:0;border-radius:0" valign=3D"top" align=3D"center" id=3D"b10"><div><div d=
ata-block-id=3D"10"><a href=3D""=
target=3D"_blank" rel=3D"noopener noreferrer"><img style=3D"max-width:100=
%" width=3D"137" height=3D"53" alt=3D"Email Marketing Powered by Mailchimp=
" title=3D"Mailchimp Email Marketing" src=3D"https://cdn-images.mailchimp.=
com/monkey_rewards/intuit-mc-rewards-2.png" /></a></div></div></td></tr></=
tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></t=
r></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td=
></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>=
</td></tr></tbody></table><!--[if (gte mso 9)|(IE)]></td></tr></table><![=
endif]--></td></tr></tbody></table>
</td>
</tr>
</tbody></table>
</center>
</body>
I decided to count the instances and if an additional string matches I'll warn the user about an unreliable software used by others to compose messages. Future employees can throw weeks of their lives to figuring out a more reliable policy but I've got a reasonably C-grade solution that was only an hour or two of my time. The image won't load for this message but I now get an error message and I can go back and look at Roundcube if I really have to.
I ran your example through the HTML sanitizer that Roundcube uses and it removed all the MSO specific sections (the HTML in them, not just the comments). In your original post you mentioned about the logo specifically and yes that is retained by the HTML sanitizer because the code says "show this in everything that is NOT outlook"
<!--[if !mso]><!--></div><a....</a><div><!--<![endif]-->
In this article (https://www.emailonacid.com/blog/article/email-development/conditional-css-code/) you can read now this syntax is designed "With a slight change in syntax and some additional comment closing symbols, you can use MSO conditional comments to target all clients besides Outlook"