mjl- / mox

modern full-featured open source secure mail server for low-maintenance self-hosted email
https://www.xmox.nl
MIT License
3.38k stars 89 forks source link

Threads not shown correctly #106

Open jsfan3 opened 6 months ago

jsfan3 commented 6 months ago

If the user receives an email and responds to it, the thread is displayed correctly in the inbox.

If the user sends an email and receives a reply, only the received email is displayed in the inbox. This is not the standard behavior of today's webmails. If the user receives a reply to their own email, both the sent email and the reply should appear as threads in the inbox.

mjl- commented 6 months ago

If the user receives a reply to their own email, both the sent email and the reply should appear as threads in the inbox.

I justed tested this, and that's how it works for me. Only when I change to "Threads: Off" will I not see the originally Sent message. But that's what I expect when thread display is disabled. Are you seeing this with either "Threads On" or "Threads: Unread"? And the outgoing message does show up in the Sent mailbox?

Perhaps there's anything special I could do to reproduce this issue?

jsfan3 commented 6 months ago

Perhaps there's anything special I could do to reproduce this issue?

Yes, send an email with mox to a non-mox account, e.g. Gmail. Then reply from Gmail to mox. In mox, the reply will appear in the inbox, and only that. Instead, you should see the thread with your original message first, and then the reply you received.

mjl- commented 6 months ago

Instead, you should see the thread with your original message first, and then the reply you received.

That's what it looks like in for me. I also tested with sending to a gmail address, and replying from gmail back to mox.

Perhaps the thread-matching doesn't work as expected.

Can you check if the messages both (so both the sent message, and the reply) get the same threadid assigned? You can see the threadid for a message through the "More ..."-button and "Show internals in popup". Or shortcut I (shift-i). Then look for "ThreadID". If the messages get a different threadid, something is off with the matching. Matching is done based on the message-id, references and in-reply-to headers, with a fallback to just the thread subject. If the messages have different thread id's, it can be worth checking those headers. I presume the outgoing message is stored in the Sent folder, and the incoming messages goes to Inbox?

If the threadid is 0, thread id's are still being assigned in the background (e.g. after importing lots of messages, matching threads may take some time).

mjl- commented 6 months ago

2023-12-26_15-47