Search code examples
phpemailemail-client

Inferred web email application based on User agent


TL;DR How can I infer which web email client has been used based on the UA string of a request?


I have run into an interesting problem lately. I parse user agent strings to get the operating system and browser|mobile device|etc. So this is not a question about parsing user agents.

My question is how do you infer what web email application has been used to open the email?

To start of here is some data:

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17

Browser: Chrome
OS: Windows 7

The email address this was sent to was [email protected] and I accessed the gmail app from.

The UA-string will be for Chrome. I realize that I cannot assume that the email address being @gmail.com that the email application used was Gmail.

Its fairly easy to get if an email was read on mobile or the desktop platforms because their UA-strings are different. Even though you get you @gmail.com emails on Outlook 2010, the Email client will still be Outlook 2010 because it has it's own UA-string.

That is just a bit of the background and some assumptions I made.

EDIT: So I have seen HERE that this can actually be done. Host your tracking image on HTTPS


Solution

  • I don't think you are able to know the email client just checking the UA. As you have said, sometimes you can (for example "outlook") but not always.

    Maybe you can check at the "referer" to see where the request has been sent from.