Kostya,
I encountered a problem that a message that should belong to a "thread" was not added to it. Here is the sequence of event that lead to it:
Participants: G1, G2 (both Gmail accounts), and StR (non-Gmail account, alpine client on Unix for sending the message)
Aquamail: no smart folder enabled, everything is happening within one account, messages are in Inbox, except for one as labeled.
Message 1 (M1): G1: message to G2, StR, other recipients
Message 2 (M2): G2: reply to All (to M1)
Message 3 (M3) [in Sent] StR: reply to G1's M1, adding G2 to Cc:
At that point the messages were indexed (and reindexed back and forth a few times during testing).
M1 & M2 showed as a thread.
In a day:
Message 4 (M4): G2: reply to StR's M3, Cc: G1
Aquamail didn't add M4 to the thread {M1,M2}
M4's headers contain:
References: <M1> <M3>
In-Reply-To: <M3>
Just in case:
M2 has
References: <M1>
In-Reply-to: <M1>
Kostya, I didn't try to turn the conversation view off and on again yet to see if reindexing would pick that message up. I wanted to see if you want me to check anything prior to that.