WARNING - Windows Live message filtering javascript bug

I send out a monthly HTML message for one of my clients, so I've use a template for the layout. I've made it as email proof as possible over the past year, but I just uncovered another (maybe recent) annoying hotmail bug that, though I can likely hack around it, I feel should be brought to light.

Hotmail will aggressively filter out images (and their alts) from a message that crosses a "spam score" threshold. I originally sent the message through our email system and it got flagged and filtered. I noticed in the filtered version that the inner alignment was askew (left instead of center). When I clicked to "display images", the inner alignment remained left instead of center, destroying the layout of the message.

I sent another test message to Hotmail from my own computer and the message was not flagged and filtered and the inner alignment was centered as it should be. This means 1) the sending address increased the message spam score and 2) the askew alignment was caused by the filtering mechanism triggered by the spam score.

I did some poking around in the actual hotmail code and discovered that Hotmail is using the Javascript innerHTML property to filter the message on the client-side. Here is the telling excerpt:

<script>document.getElementById("MsgContainer").innerHTML='\x0d\x0a\x3ccenter\x3e\x3cimg height\x3d5 alt\x3d\x22\x22 src\x3d\x22http\x3...

Hotmail is converting the message HTML into an encoded string and passing it to a message container, all done in Javascript.

Now for the bug...

I reproduced the alignment problem and discovered that the align="center" attribute was not working on any of my <td> tags. When I compared the two versions of the message, I discovered a significant difference in the encoded innerHTML for the message that was filtered compared to the message that was not filtered:

Unfiltered message:
...td align\x3dcenter colspan\x3d2...

Filtered message:
...td align\x3dmiddle colspan\x3d2...

For some reason, the filtered message has a value of "middle" for the align attribute, not "center" which is causing the entire layout to buckle. BEWARE! Yet another reason Hotmail sucks..."Let's do everything with faux AJAXian goodness because its fast and sleek and trendy and our users will love it! Screw the developers."

Dave Dave, 8 years ago

Great spotting and thanks so much for sharing your find. We're in the process of doing some serious digging around the different ways Hotmail will render your email for an upcoming post on the ESP site. It's not pretty, and hopefully we'll be able to pull some useful recommendations out of what we uncover.

We've already discovered they are serving up different code depending on the browser you're using.

trandrus, 8 years ago

Interesting...I was using FF 2.0.0.11 for Mac. Wonder if this bug persists in different browsers.

--Update--

It appears to be a Firefox issue (or rather a Firefox non-issue that Hotmail screws up). IE7 and IE6 will render the filtered message correctly while FF Mac and FF PC both fail to center the td's. The code served up seems to be consistent across browsers, however. The filtered message consistently displays align="middle". It's the way the browsers respond to this deprecated attribute that's causing the problem.

The question is...what possessed Hotmail to modify the align="center" attribute for filtered messages and not unfiltered messages? And why don't they modify the align attribute for the other values, "left" and "right"? What's the point?

Hope this saves someone else the time that I lost.

Dave Dave, 8 years ago

Thanks for the follow up, some great digging around there. We've got a lot of work ahead of us. We'll definitely be posting more about this on the ESP blog soon, so keep an eye out for it.

markwyner markwyner, 8 years ago

I'm glad you posted about this, trandrus. As David pointed out I'm rolling through a sea of markup that Windows Live Hotmail generates for HTML messages. It's an absolute disaster in there.

Some things you've mentioned are in line with what I've discovered. It does indeed render messages on the client side using an endless library of Javascript calls. And, yes, it does deliver different markup to Firefox on Mac than IE on Windows. But it also delivers different markup to Firefox on Mac than Firefox on Windows.

I'm still trying to sort out the variations, and when I do we'll be posting something comprehensive. So stay tuned.

Diana Diana, 8 years ago

I've been poking around with it myself lately and it's just scary. I can't wait to see a more comprehensive explanation/description of what we'll encounter.


~*~~*~~*~~*~
D. Potter
Campaign Monitor
JusMe, 8 years ago
trandrus :

I did some poking around in the actual hotmail code and discovered that Hotmail is using the Javascript innerHTML property to filter the message on the client-side. Here is the telling excerpt:

<script>document.getElementById("MsgContainer").innerHTML='\x0d\x0a\x3ccenter\x3e\x3cimg height\x3d5 alt\x3d\x22\x22 src\x3d\x22http\x3...

Hotmail is converting the message HTML into an encoded string and passing it to a message container, all done in Javascript.

Hi all,

I received an email today to my Hotmail account and noticed that every time I tried to respond using either "reply all" or "forward" the email, the original body text disappeared.  I have never known this to happen (still don't know if it should happen) so I began to do some research to see if there was a "new-to-me" feature out there. 

Long story short, I didn't find anything in the search engines.  I went back to the original email and viewed the source code.  This is what I found in the "body text" of the email source code:

<script>document.getElementById("MsgContainer").innerHTML='\x3cp\x3e

I copied and pasted the above syntax in google and found the link to this forum/thread.  Very interesting reading!  It seems as though I'm not the only one confoogled out here.

Is there a feature that allows a 'sender' to not allow the 'receiver' to add their body text to email forwards (or replies)?  Or is this a snafu with Hotmail itself. 

It's mind boggling.  Help me out here. 

Thanks!

JusMe

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098