From c6ecd77cdcbb1e5d201925f684ec72115210a445 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 21 Oct 2015 08:27:23 +0200 Subject: Bug 756842 - [Maildir] Do not overwrite received date on the message info ][ --- camel/providers/local/camel-maildir-summary.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c index 04e2c3100..8e977e5aa 100644 --- a/camel/providers/local/camel-maildir-summary.c +++ b/camel/providers/local/camel-maildir-summary.c @@ -296,6 +296,15 @@ maildir_summary_add (CamelLocalSummary *cls, if (info) { camel_maildir_info_set_filename (mi, camel_maildir_summary_info_to_name (mi)); d (printf ("Setting filename to %s\n", camel_maildir_info_filename (mi))); + + /* Inherit the Received date from the passed-in info only if it is set and + the new message info doesn't have it set or it's set to the default + value, derived from the message UID. */ + if (camel_message_info_date_received (info) > 0 && + (camel_message_info_date_received (mi) <= 0 || + (camel_message_info_uid (mi) && + camel_message_info_date_received (mi) == strtoul (camel_message_info_uid (mi), NULL, 10)))) + mi->info.info.date_received = camel_message_info_date_received (info); } } -- cgit v1.2.1