[MlMt] [1.6] Date-based submailboxes

Benny Kjær Nielsen mailinglist at freron.com
Mon Jul 8 06:08:34 EDT 2013


On 5 Jul 2013, at 16:13, Eric A. Meyer wrote:

Sorry for the late reply, but it's a non-trivial issue :-)

> I've been playing around with submailboxes, which are pretty amazing-- 
> well done, Benny!  As you say, there's a lot of potential there.

Thanks!

> [date trouble]
>
> At first I thought it was the difference between sending date and 
> receiving date, but when I turned on the "Date Sent" column, the times 
> were exactly the same as "Date Received".  Which is suspicious by 
> itself, really, but for all I know that's an effect of GMail.

Well, most emails only take seconds to arrive, but you should be able to 
find at least some messages with differing times.

> I'm happy to submit a bug report, but I thought that first I'd make 
> sure I wasn't doing something wrong or misunderstanding something, or 
> (if not) that I knew what exactly to report.

Time zones are ignored which can explain part of what you see. The other 
thing to note is that the “Date” header of the message is not the 
same as what is used in the “Date Received” column which is based on 
the most recent “Received:” header. This is not only necessary 
because it makes more sense for a received date. It is also necessary 
because “Date:” headers are quite often wrong (they are generated by 
email clients which may be buggy or may be running on a machine with 
incorrect time).

I should try to make that more clear. The real `Date` header is only 
used by MailMate when initially parsing the message. Email date headers 
are notoriously hard to parse (I should write about that some day) and 
MailMate does this once and then puts a canonicalized value in a virtual 
header (`#date`). This is what is used when selecting “Date” in the 
GUI. This header includes the time zone.

Now, keep in mind that handling dates has been learning-by-doing. 
Starting over I would most likely do it differently. MailMate has 4 date 
headers. Here is an example:

|Header         |Value|
|---------------|-----|
|date           | `Mon, 08 Jul 2013 11:40:08 +0200`
|#date          | `2013-07-08 11:40:08 +0200`
|#date-sent     | `2013-07-08 09:40:08`
|#date-received | `2013-07-08 09:40:11`

When creating submailboxes based on one of these headers then they are 
handled verbatim (a subpart of the string is used to partition the 
messages). The first one is useless, the second one has the time zone 
problem, and the rest assumes you are located around Greenwich.

To solve the problem you describe you would need a header normalized to 
your time zone. That's another item for my todo. For now, anyone living 
near Greenwich could use the `#date-sent` header. Otherwise, the `#date` 
header is the better choice.

Let me know if you do not think the above can explain what you have 
seen.

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20130708/87c137e0/attachment.html>


More information about the mailmate mailing list