Bug 453383

Summary: Reply mails are shown in wrong thread after being moved to a different folder (in Kontact)
Product: [Applications] kmail2 Reporter: Frank Steinmetzger <dev+kde>
Component: foldersAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.20.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Comparison of inbox view between Kontact and Kmail

Description Frank Steinmetzger 2022-05-04 12:26:16 UTC
Created attachment 148558 [details]
Comparison of inbox view between Kontact and Kmail

I’ve been observing this issue now for a very long time now. I thought something this obvious must be noticed easily. But it seems I hit a niche and it just happened again, so I finally decided to report it.

STEPS TO REPRODUCE
I just sent replies to two different mail threads in an IMAP account. KMail stored the replies in the Sent folder, as usual. I went to the folder, selected both mails and moved them to the Inbox folder, so they may be shown within their respective threads.

OBSERVED RESULT
The mails were shown in the wrong thread: replay to thread A is shown in thread B and vice versa.

EXPECTED RESULT
The mails should appear as reply to the correct mail.

Operating System: Arch Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.17.5-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-5200U CPU @ 2.20GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 5500


ADDITIONAL INFORMATION
One very interesting bit of info that I found out just now: the issue only appears in Kontakt. I closed Kontact and opened KMail as standalone application, and in there the threads were correct. Then I closed KMail and reopened Kontact, and the mails were mixed up again. I did this twice, both times with the same result. So perhaps this is a Kontact thing, or an Akonadi bug? I haven’t tested yet what happens if I move mail in standalone-KMail, so whether the (akonadi?) data is garbled during the move or during display.

I also looked at the mail source to make sure the In-Reply-To header was correct. But I already knew it was so, because when I sync the account with offlineimap and view it in mutt, the thread is also correct. I have akonadiconsole installed, so I am happy to provide deeper info if required.

While preparing the screenshots, I also noticed that the structure of the lower thread is different between the two programs (see circles in the image). Apparently there has been a similar hickup in the thread before.