Sunday, May 2, 2010

iPad Email Date Handling

A big annoyance in the iPad mail client is its handling of the message’s date field. I’ve noticed a few emails arriving, but appearing somewhere in the middle of the message list, with a time that makes absolutely no sense.

As an example, at 3:30pm I booked a flight, and received my itinerary at 4:03pm. The itinerary email’s date showed up correctly in Gmail as 4:03pm, but in iPad mail it appeared a few messages from the top, with a time of 3:03pm — half an hour before I made the booking. Weird.

This is what the message header looks like for a correctly dated email:

Received: by 10.216.221.3 with SMTP id x;
    Sat, 1 May 2010 04:15:21 -0700 (PDT)
...
Date: Sat, 1 May 2010 14:08:22 +0300

Makes perfect sense. The email was sent at 2:08pm in UTC+3, and since I’m in PDT, which is UTC-7, the message shows a date of 4:08am in Gmail as well as iPad Mail.

Now, the itinerary I received looks like this:

Received: by 10.216.221.3 with SMTP id x;
    Sun, 2 May 2010 16:03:30 -0700 (PDT)
...
Date: Sun, 02 May 2010 23:03:29 +0100

Following the same logic as the above, the message was sent at 11:03pm UTC+1, which translates to 3:03pm UTC-7 (PDT). Wait, what? This differs drastically from the date listed in the received field. Gmail handles this date correctly and shows a message time of 4:03pm, but iPad Mail does not, and shows a message time of 3:03pm.

The sent date is obviously wrong, so Gmail must be doing something smarter. I can think of two:

  1. Gmail relies on the date received, and ignores the date sent. From the looks of the first email header, this is not what happens. The date sent is 14:08, and the date received is 04:15, and Gmail displays 4:08am. This means it takes the second option:
  2. Gmail compares the date sent with the date received. I’m guessing that if these dates differ by some large delta, it defaults to displaying the date received. This allows the message to be sorted correctly and has the added bonus of preventing intentional email back-dating.

These are both potential options for the iPad. It can either simply use the date received, or it could perform the comparison. Personally, I think the first option is more correct, and would win out over the current iPad date-sent option, and the Gmail hybrid option:

  • Users only care about when they get their mail, and the ease of finding the newest messages in the list.
  • Users can generally trust the date received field more, since it’s set by their own IMAP server.
  • Using just the date received provides better consistency, as well as not having to define an arbitrary delta.

I’m tired of scanning through my entire inbox for potentially new messages. Here’s to hoping this issue is fixed soon.

Note: I could, of course, be completely wrong about how Gmail handles dates, but the way iPad handles it is nonetheless wrong.