offlineimap icon indicating copy to clipboard operation
offlineimap copied to clipboard

introduce a configuration option to define the internaldate used for APPEND

Open jgonsior opened this issue 7 years ago • 3 comments

Hello, I'm using Offlineimap, my mail provider is FastMail. Whenever I'm moving a file around locally (from one Maildir directory into another one) the mail is first being deleted on the server, and then uploaded again, so far so good. But when the mail is uploaded again the internaldate of the message get's changed to the current timestamp:

2018-02-06 13:28:26 DEBUG: [imap]: savemessage: date: "06-Feb-2018 13:27:33 +0100", […]

So in the end the mail shows on FastMail with the wrong date. Correct woud be the date which is set in the Date header of the mail. How can I configure Offlineimap to respect the Date header here?

jgonsior avatar Feb 06 '18 12:02 jgonsior

offlineimap cannot currently set this IMAP optional parameter on APPEND.

Patches welcome.

nicolas33 avatar Feb 06 '18 23:02 nicolas33

Sorry, I did not remember this feature is supported while not exposed to the user. The internal date is set like this (fallbacks):

  1. The timestamp of the local file.
  2. The Date header of the email.
  3. Let the IMAP server set the internaldate.

For the IMAP side, there isn't a configuration option to tune this but it's easy to introduce one.

nicolas33 avatar Feb 07 '18 00:02 nicolas33

Yes, this would be great to have. Note, when the "remote IMAP MOVE method" is added for greater efficiency and true sync accuracy, this internaldate will also remain original and accurate - either timestamp of the local file and/or Date header of the email message.

chris001 avatar Feb 07 '18 01:02 chris001