I see you are using gmail. It is possible the reason you are seeing
multiple results is because of how gmail 'fakes' imap folders.
In gmail, all mail goes into the same place and is tagged with different
'mailbox' names. When you use imap to retrieve the messages, each
mailbox 'tag' is presented as a separate maildir. If you are using a
very simple 'get all mailboxes' in whatever retrieval program your
using, such as isync, then you will actually be downloading 2 copies of
each message - 1 from the 'all mail' main/real maildir and one from
tagged maildirs, such as 'inbox'.
You can probably confirm this by getting your query to also print the
maildir the message is in. I suspect you will find your duplicate
messages are in different maildirs.
To fix this, you need to update the config for isync (or whatever your
using) to dowsnload from specific directories. Some people like to just
dowsnload the 'all mail' maildir and then define mu queries which filter
it into different 'bookmakrs', others download all maildirs except 'all
mail' and others do combinations.
From memolry, it wsas a while ago, I think there were some gmail config
options I set to make imap easier to work with. I think you can tell
gmail which 'tags' to present as maildirs, so if you can only use a very
simple recipe to configure your imap client, you may be able to mange it
just by telling gmail not to present some tags/maildirs.
The other option is to add explicit maildir parameters to your queries,
but that can be a pain when you wsant to search for something and don't
know which maildir it is in. It also means your doubling your dowsnload.
HTH