1

GMail has some great features, one of which is label tagging to organize your inbox. However, I have a situation where I stuff all "waste of time" emails that sometimes I peruse into the following label structure:

Entertainment Entertainment/Politics Entertainment/Twitter Entertainment/etc...

So, I can easily search "has label:Entertainment/Facebook" although I would rather be able to search "has label:Facebook"

But, most of all, I'd really like to be able to search for ALL Entertainment emails at once, like

"has label:Entertainment*"

Unfortunately... GMail does not support wildcard (*, %) nor "nested" labels (I know they aren't actually nested).

Is this literally impossible or am I missing something?

1

I feel your pain. If you nest a label one would assume (prefer) that the parent label inherit the child label, but as you've noted, it does not.

A common solution is to add another filter that catches all the same messages as combining the 'child' labels into a single filter would.

Mail Filter 1:
   from:(johnnyteacher@domain.com) 
   Label: school/sonselementary

Mail Filter 2:
   from:(sallyteacher@domain.com) 
   Label: school/sallyssecondary

Mail Filter 3 (1 & 2 Combined):
   from:(johnnyteacher@domain.com) OR from:(sallyteacher@domain.com) 
   Label: school

This does the trick however becomes very difficult to manage over time. You need to remember to update rules in several places. You might have child labels that are themselves parent labels and the complexity becomes overwhelming.

I started building an Excel spreadsheet that creates the code for the rules for me and also manages the relationship between parents, children and siblings. It hasn't been without it's own 'learnings' along the way and I will likely try to finish it using a more DB/scripting approach as I am stretching Excel into shapes it doesn't look good in.

It is a huge advantage to me to delete and recreate rules as (1) you can update multiple rules quickly, (2) you can apply multiple rules quickly (i.e. Gmail asks if you'd like to apply them as part of the import process, (3) you can reorder your rules simply by deleting and reimporting your rules in a new order if you strip out unique identifiers before import. I have preferences for my order unrelated to when the rule was created.

5
  • 1
    I was afraid this would be the answer. A sad day indeed. But - thank you for this solution and I like where you are going with the automated rule generator. You might consider making this a GMail plugin if it exposes enough via their API (which I've not looked into yet). Then you could actually publish it as a plugin - just a thought. :)
    – Gr3go
    Sep 28 at 16:43
  • 1
    I'll post something back if I get that far. :-) Sep 28 at 21:33
  • 1
    @Gr3go my rule generator adventure has exposed challenges/limitations of generalizing it to other users' needs. HTML Gmail's search syntax is limited. Complicated searches, if achievable, have a high character count which is amplified if combined in parent filters. Combined searches are fraught with error paths even with insight into the needs and the syntax. I continue to evolve my approach as I learn more. I am trying a different approach using scripting to avoid some of the pitfalls. I'll update. Oct 14 at 18:15
  • This must be why one doesn't already exist after all these years... I do hope it is possible. I feel it would be a great plug in.
    – Gr3go
    Oct 18 at 17:04
  • I haven't been able to address it yet however I intend to and will post back when I do. 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.