mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
fix: Use and prefer Date from signed message part (#5716)
This commit is contained in:
@@ -15,7 +15,7 @@ use crate::download::MIN_DOWNLOAD_LIMIT;
|
||||
use crate::imap::prefetch_should_download;
|
||||
use crate::imex::{imex, ImexMode};
|
||||
use crate::test_utils::{get_chat_msg, mark_as_verified, TestContext, TestContextManager};
|
||||
use crate::tools::SystemTime;
|
||||
use crate::tools::{time, SystemTime};
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn test_outgoing() -> Result<()> {
|
||||
@@ -3326,6 +3326,22 @@ async fn test_bot_recv_existing_msg() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn test_wrong_date_in_imf_section() {
|
||||
let mut tcm = TestContextManager::new();
|
||||
let alice = &tcm.alice().await;
|
||||
let bob = &tcm.bob().await;
|
||||
let alice_chat_id = tcm.send_recv_accept(bob, alice, "hi").await.chat_id;
|
||||
let time_before_sending = time();
|
||||
let mut sent_msg = alice.send_text(alice_chat_id, "hi").await;
|
||||
sent_msg.payload = sent_msg.payload.replace(
|
||||
"Date:",
|
||||
"Date: Tue, 29 Feb 1972 22:37:57 +0000\nX-Microsoft-Original-Date:",
|
||||
);
|
||||
let msg = bob.recv_msg(&sent_msg).await;
|
||||
assert!(msg.timestamp_sent >= time_before_sending);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn test_no_private_reply_to_blocked_account() -> Result<()> {
|
||||
let mut tcm = TestContextManager::new();
|
||||
|
||||
Reference in New Issue
Block a user