2

Why, you might wonder, is this happening? Well, to be clear, this only happens when receiving an e-mail written in Gmail originally (a regular old fashioned link without the Gmail formatting added on works fine).

Google inserts an image after the link and that image URI does not contain a protocol (http or https). It looks something like this:

<img src="//ssl.gstatic.com/ui/v1/icons/common/x_8px.png">

Now, in a web browser, this will work just fine; the browser will use whatever protocol was used to load the page (usually https these days).

In Outlook, however, this is interpreted as a Windows File Sharing link.

So, Outlook decides to try to access that address using Windows File Sharing (on port 445) and, rather than denying the request, Google just ignores it, and Outlook stops responding until it times out 30 seconds later. And Outlook does this every time you open the message.

If you forward the message, Outlook tacks on a file protocol to the image URI:

<img src="file://ssl.gstatic.com/ui/v1/icons/common/x_8px.png">

And, of course, if the recipient has Outlook, he or she will experience the same issue (the file protocol doesn't help; it just confirms that Outlook thinks it's a reference to a file accessible via Windows File Sharing).

This appears to be version agnostic - it's an issue with all versions of Outlook up to 2016.

There are two proposed "answers" to this question scattered across the Internet:

  1. Add a DNS entry to your hosts file to resolve ssl.gstatic.com to 127.0.0.1
  2. Turn off the automatic download of images in Outlook

These are not answers. These are workarounds that have big downsides:

  1. The DNS entry will solve the issue for Outlook... but prevent you from accessing any Google services via a web browser
  2. Turning off the download of images will solve the issue for Outlook, but is seriously annoying to anyone who trusts a lot of addresses so you don't have to manually choose to download/show images

Unfortunately, Google has no interest in fixing this image URI (even though it's the only image with a non-protocol URI - Gmail messages otherwise contain a ton of other images that all include the protocol), although it's understandable since the non-protocol version works fine in browsers.

Microsoft is in the same boat, claiming that they used the non-protocol version first to indicate Windows File Sharing links, so they won't fix it, either.

So nobody wants to fix the actual problem, which has been around for years!

2

2 Answers 2

1

I have educated end users why this is happening: Outlook is looking for an external file but is unable to retrieve the data (easy way for the end user to digest).

I have given them instructions to edit the email > select the broken image > delete it > save the email.

No more issue when opening this email as file://ssl.gstatic.com/ui/v1/icons/common/x_8px.png no longer exists in this email.

I prefer this method as it helps educate users about some of the Outlook features (editing emails), informs them it is not an internal issue and due to the fact we get so few of these emails (one incident every 6 months). Of course I don't know how many people have the issue and are quiet about it but I might run a PowerShell script to find out :)

0

The only real answer I have come up with is using a VBA Script, which I'll share below. I'm hoping someone smarter than me (or at least someone with more time) can turn this into an actual Outlook plug-in. I don't care if you make money on it but it would be neat if I'm credited with the original code, even though it's fairly simple.

Warning: If you're not comfortable playing with Visual Basic for Applications (VBA) then you should stop here or find someone who is comfortable.

I won't go into how to turn on the Developer menu in Outlook, but you'll need that to open up Visual Basic.

  1. Once in Visual Basic, go to:
    • Project1
      • Microsoft Outlook Objects
        • ThisOutlookSession
  2. Add the following code under that:
' When new mail is received...
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
    Dim arr() As String
    Dim i As Integer
    Dim item As Object
    Dim mailItem As mailItem
    arr = Split(EntryIDCollection, ",")
    For i = 0 To UBound(arr)
        Set item = GetItemById(arr(i))
        If item.Class = olMail Then
            Set mailItem = item
            Call FixGoogleDriveLinks(mailItem)
        End If
    Next
    Set item = Nothing
    Set m = Nothing
End Sub

' Fix Google's gstatic.com links with no protocol so that they use the https protocol explicitly
' This prevents Outlook from hanging on these since it attempts to treat them as Windows File Sharing links
Function FixGoogleDriveLinks(olItem As mailItem)
    olItem.HTMLBody = Replace(olItem.HTMLBody, """//ssl.gstatic.com", """https://ssl.gstatic.com") ' For new messages that came directly from Gmail
    olItem.HTMLBody = Replace(olItem.HTMLBody, "file://ssl.gstatic.com", "https://ssl.gstatic.com") ' For messages that were forwarded using Outlook
    olItem.Save
End Function
  1. Click the Save icon
  2. Restart Outlook
  3. You will need to click Enable Macros every time you open Outlook (or the code will not run)

This will fix any new messages, but it does not fix any old messages you might have hiding out in your inbox (they'll still freeze Outlook for 30 seconds, etc.) I attempted to create code to fix any message you attempt to read, but I could not make that work. I suspect that Outlook won't allow those kinds of changes when you're opening a message to read it.

Please let me know if this works for you or not - I have a ton of code doing other things, so I kind of stripped this out (so I have not technically tested it in this pristine form.)

Not the answer you're looking for? Browse other questions tagged or ask your own question.