Is it possible to search by tags in mu?

33 views
Skip to first unread message

Cesar Garcia Saez

unread,
May 18, 2020, 12:07:13 PM5/18/20
to mu-discuss
Hi everyone,

I have been reading most of the post related to tags and several articles, but I can't seem to find an answer to this: Is it possible to search for tags?

I have managed to add custom actions to add and remove tags to emails. Those are displayed in view fields as per:

(setq mu4e-view-fields '(:from :to  :cc :subject :flags :date :maildir
                               :mailing-list :tags :attachments))

Most solutions working with Gmail evolve about adding/removing the \Inbox tags for archiving emails or \Starred. I have added Magnus code for the prehook and also the code from Damien Cassou to archive messages by doing:
(defun my:mu4e-remove-message-from-inbox (msg)
   
(mu4e-action-retag-message msg "-\\Inbox"))

Regardless of what I do, I can't display the tags on mu4e, nor search for those using mu. mu find \Inbox fails with no results.

At the begining I though this was related to the config items of offlineimap. I double checked the synclabels = yes, labelsheader = X-Keywords configuration was set, but I got no success.

I looked for information about searching for tags in all examples, but I haven't seen any note regarding this kind of search. I have found information about filtering by flag, subject but none about tags.

Is there any argument to look for tags in mu/mu4e? Would it work with special tags like \Inbox or \Starred?

Best,
César


Magnus Therning

unread,
May 19, 2020, 2:46:50 AM5/19/20
to mu-di...@googlegroups.com
This isn't very helpful, maybe more taunting, sorry... but, it works for
me

In mu4e I can search for `tag:misc/mu`, or `tag:\\Inbox` and on the
command line this works:

```
mu find --muhome=<my-mu-home> tag:misc/mu
mu find --muhome=<my-mu-home> 'tag:\\Inbox'
```

/M

--
Magnus Therning OpenPGP: 0x927912051716CE39
email: mag...@therning.org
twitter: magthe http://magnus.therning.org/

Only put off until tomorrow what you are willing to die having left
undone.
— Pablo Picasso
signature.asc

Lars Chesterton

unread,
Feb 7, 2026, 9:45:47 PM (5 days ago) Feb 7
to mu-discuss
Hi Magnus,

I replied to you just now in another thread, hoping to recreate your setup. Like the OP I also cannot search for tags in my maildir. Are you able to share more about your setup if this is still working? I.e. mbsync/offlineimap config, or anything else that could lead to such a difference in functionality?

Thank you!

Lars

Reply all
Reply to author
Forward
0 new messages