Re: So, do I understand correctly, that "Diag: message dates" obtains more information from the server than a regular sync does. In particular, - the regular sync does not obtain HDL when the sorting is chosen to be by IDL. Right?
Yes, it asks the server for each message's "INTERNALDATE" which was wrong here and also for the Date header.
During sync, it fetches one or the other, the DB schema can only store one.
Re: other mail apps
There is a per-account option in AquaMail for this (which one to fetch and store and show as "the" message date/time).
But the default is to use the INTERNALDATE, the date/time set by the *server*, which is when a message was "stored" (filed, received).
Why?
Because replying on the Date header is even less predictable:
People often have wrong date/time/time zone on the devices from which they send mail.
And then you end up with "Jan 1, 1970" or even some date in the future -- because that's in the message's Date header -- and no way to fix it, it's there and it's wrong.
Using server-provided "received at..." time is more predictable, because mail servers are more often than not properly configured wrt. their date / time / time zone.