From 8c868dcb4fe4c8190be48b1b1850956f23a87b42 Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 11 Aug 2025 08:55:10 +0000 Subject: [PATCH] fix: check for Chat-Version header before marking the contact as a bot Contacts are marked as a bot if incoming message from a contact has `Auto-Submitted: auto-generated` header. However, such message can be generated by the server, e.g. as an auto-reply. To prevent accidentally marking the contact as a bot when auto-generated message is sent by the server, we need to check for `Chat-Version` header to make sure that the message is generated by the client. This is already how it is documented in `MimeMessage.is_bot` field documentation comment, but was not checked in the implementation. --- src/mimeparser.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 1036cbb06..7dca10e56 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -584,7 +584,8 @@ impl MimeMessage { }; let is_location_only = parser.location_kml.is_some() && parser.parts.is_empty(); - if parser.mdn_reports.is_empty() + if parser.has_chat_version() + && parser.mdn_reports.is_empty() && !is_location_only && parser.sync_items.is_none() && parser.webxdc_status_update.is_none()