duplicate results in mu query

3 views
Skip to first unread message

Jorge

unread,
Aug 1, 2025, 2:14:53 AMAug 1
to mu-discuss
Hi!

How comes this query:

--8<---------------cut here---------------start------------->8---
mu find '(flag:unread and
(not flag:trashed) and
((from:emacs...@gnu.org or
from:help-gn...@gnu.org or
from:mu-di...@googlegroups.com) or
(to:emacs...@gnu.org or
to:help-...@gnu.org or
to:mu-di...@googlegroups.com) or
(cc:emacs...@gnu.org or
cc:help-gn...@gnu.org or
cc:mu-di...@googlegroups.com)))'
--8<---------------cut here---------------end--------------->8---

produces this:

--8<---------------cut here---------------start------------->8---
Tue Jul 29 00:42:26 2025 John Doe <exa...@example.com> Re:
master cef4302d309: cperl-mode.el: Support syntax of Perl version 5.42
Tue Jul 29 00:42:26 2025 John Doe <exa...@example.com> Re:
master cef4302d309: cperl-mode.el: Support syntax of Perl version 5.42
--8<---------------cut here---------------end--------------->8---

I get duplicated results in my query and I'm unsure why!
--
Jorge Araya

Contacto:
Telegram: t.me/shackra · Signal: Shackra.28

Tim Cross

unread,
Aug 4, 2025, 8:52:41 PMAug 4
to Jorge, mu-discuss

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

Jorge Javier Araya Navarro

unread,
Aug 7, 2025, 1:26:52 PMAug 7
to Tim Cross, mu-discuss
The issue was in my account on Proton Mail, and it was indeed
'fake'
IMAP folders.

Jorge Javier Araya Navarro

unread,
Aug 7, 2025, 1:26:52 PMAug 7
to mu-di...@googlegroups.com
NVM, turns out that I was indexing the same emails from another
maildir,
adjusting my mbsync configuration resolved the anomaly.
Reply all
Reply to author
Forward
0 new messages