diff --git a/CHANGELOG.md b/CHANGELOG.md index 41c9319f2..3be0e8877 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### API-Changes ### Changes +- allow sender timestamp to be in the future, but not too much ### Fixes - `dc_search_msgs()` returns unaccepted requests #3694 diff --git a/src/receive_imf.rs b/src/receive_imf.rs index ddf33ab35..d01fd7146 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -173,10 +173,13 @@ pub(crate) async fn receive_imf_inner( .await?; let rcvd_timestamp = smeared_time(context).await; + + // Sender timestamp is allowed to be a bit in the future due to + // unsynchronized clocks, but not too much. let sent_timestamp = mime_parser .get_header(HeaderDef::Date) .and_then(|value| mailparse::dateparse(value).ok()) - .map_or(rcvd_timestamp, |value| min(value, rcvd_timestamp)); + .map_or(rcvd_timestamp, |value| min(value, rcvd_timestamp + 60)); // Add parts let received_msg = add_parts(