From 44e3e7c5312e232c35403b5f8ad7cae0b4e6ddee Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 20 Dec 2016 00:17:00 +0100 Subject: Fix threading for non-threaded messages. Ensure we always have a messageId to work with, and avoid grouping all non-threaded messages together. --- common/mailpreprocessor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/mailpreprocessor.cpp') diff --git a/common/mailpreprocessor.cpp b/common/mailpreprocessor.cpp index bde8a64..1366718 100644 --- a/common/mailpreprocessor.cpp +++ b/common/mailpreprocessor.cpp @@ -127,6 +127,13 @@ static void updatedIndexedProperties(Sink::ApplicationDomain::Mail &mail, KMime: parentMessageId = inReplyTo.first(); } } + if (messageId.isEmpty()) { + auto tmp = KMime::Message::Ptr::create(); + auto header = tmp->messageID(true); + header->generate("kube.kde.org"); + messageId = header->as7BitString(); + SinkWarning() << "Message id is empty, generating one: " << messageId; + } mail.setExtractedMessageId(messageId); if (!parentMessageId.isEmpty()) { -- cgit v1.2.3