mhagger/git-multimail — pull request #45 by mjholtkamp (2014-02-08 17:59:52+00:00)
Title: Implemented incremental send date

To force email clients to sort the messages in order (especially the
'summary' email first), we set the Date: header to the current date/time
plus a second for each sequential message.

This doesn't work in all email clients, notably Apple's Mail.app with
conversations enabled. I only got this working with the following settings:

* no 'View -> Organize by Conversation',
* enable View -> Columns -> Date Sent,
* disable View -> Columns -> Date Received,
* sort by 'Date Sent' instead of 'Date Received'.

But this will lose the functionality of collapsing/expanding conversations
(conversations are still grouped and marked as belonging together, but you
can't select/collapse/expand them, they are separate messages).

Mail.app has other problems, for example when the first mail received on the
final mail server (only tested IMAP) is -not- the summary email, they will
show up as two different 'conversations'. This is because emails -inside-
the conversation are always sorted on 'Date Received' (this is not
configurable) and this depends on the timestamp of the file at the IMAP
server (tested with postfix/dovecot). Mail.app behaves correctly (grouping
the emails together and sorting them in the right order) if you introduce a
real delay (tested: 1.1 second) so that the mail is actually delivered in
the right order. Caveat: if the emails are queued somewhere (> 1.1 second) and
delivered in a different order, the order might be incorrect in Mail.app.

Conclusion: it's -very- difficult to make this work correctly for Mail.app,
but other mail clients seem to work normally after this patch (tested:
Thunderbird, Mutt).