CodeIgniter Forums
Is it possible to get the device type/name from which an email was sent? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Is it possible to get the device type/name from which an email was sent? (/showthread.php?tid=22866)



Is it possible to get the device type/name from which an email was sent? - El Forum - 09-22-2009

[eluser]codex[/eluser]
I'm wondering how some sites, for instance Flickr, 'know' from what device (iPhone, Blackberry) an email was sent. I don't see that information in an emailheader. So how do they know?

EDIT: Hmm, something tells me I have to take a look at EXIF data...


Is it possible to get the device type/name from which an email was sent? - El Forum - 09-22-2009

[eluser]bretticus[/eluser]
[quote author="codex" date="1253663874"]I'm wondering how some sites, for instance Flickr, 'know' from what device (iPhone, Blackberry) an email was sent. I don't see that information in an emailheader. So how do they know?

EDIT: Hmm, something tells me I have to take a look at EXIF data...[/quote]

I doubt there's EXIF data in the email itself, but they look at the email headers no doubt. Do you have access to the headers via SMTP transaction? What headers are you looking at?


Is it possible to get the device type/name from which an email was sent? - El Forum - 09-22-2009

[eluser]codex[/eluser]
[quote author="bretticus" date="1253666248"][quote author="codex" date="1253663874"]I'm wondering how some sites, for instance Flickr, 'know' from what device (iPhone, Blackberry) an email was sent. I don't see that information in an emailheader. So how do they know?

EDIT: Hmm, something tells me I have to take a look at EXIF data...[/quote]

I doubt there's EXIF data in the email itself, but they look at the email headers no doubt. Do you have access to the headers via SMTP transaction? What headers are you looking at?[/quote]

My bad. I was confusing the image attachments (that contains the EXIF data) with the actual email.

I get the headers via IMAP. For instance, an email that was sent from an iPhone contains this:

Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Tue, 08 Sep 2009 15:38:30 -0500
Received: from aa.aa.aa([xx.55.116.38]:26531)
by aa.aa.aawith esmtp (Exim 4.69)
(envelope-from <[email protected]>)
id 1Ml7SQ-0000RP-3p
for [email protected]; Tue, 08 Sep 2009 15:38:30 -0500
Received: from BLU0-SMTP71 ([65.55.116.7]) by aa.aa.aa with Microsoft SMTPSVC(6.0.3790.3959);
Tue, 8 Sep 2009 13:38:33 -0700
X-Originating-IP: [aa.91.223.88]
X-Originating-Email: [[email protected]]
Message-ID: <[email protected]>
Received: from [aa.91.223.88] ([aa.91.223.88]) by aa.aa.aa over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959);
Tue, 8 Sep 2009 13:37:18 -0700
From: Saphora <[email protected]>
To: "[email protected]" <[email protected]>
Content-Type: multipart/mixed; boundary=Apple-Mail-1--743026192
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (iPhone Mail 7A400)
Subject: Deze vond ik nog...
Date: Tue, 8 Sep 2009 22:34:40 +0200
X-Mailer: iPhone Mail (7A400)
X-OriginalArrivalTime: 08 Sep 2009 20:37:28.0515 (UTC) FILETIME=[2E7D0930:01CA30C4]


As you can see there's the Mime versio and X-Mailer that both contain iPhone. But is this so with for example a Nokia N97 or other type of phone?


Is it possible to get the device type/name from which an email was sent? - El Forum - 09-22-2009

[eluser]bretticus[/eluser]
[quote author="codex" date="1253667487"]
As you can see there's the Mime versio and X-Mailer that both contain iPhone. But is this so with for example a Nokia N97 or other type of phone?[/quote]

Honestly I don't know but I would assume that each type of phone or mobile email service sends something similar. Perhaps google will shed some light. If headers are not consistent you may have to look at originating mail server or have a failover default.


Is it possible to get the device type/name from which an email was sent? - El Forum - 09-22-2009

[eluser]codex[/eluser]
I'm looking at the EXIF data now. This seems to be what I'm looking for. Thanks for the help though!


Is it possible to get the device type/name from which an email was sent? - El Forum - 09-23-2009

[eluser]Damien K.[/eluser]
You're not going to share how it is done?

X-Mailer is a pseudo-standard to identify mail clients, hence device. It should be fairly reliable.


Is it possible to get the device type/name from which an email was sent? - El Forum - 09-25-2009

[eluser]codex[/eluser]
[quote author="Damien K." date="1253770907"]You're not going to share how it is done?[/quote]

As I stated it was the EXIF data I was looking for, so nothing new or interesting to share here.