Gmail labels and system labels

Mbox Viewer reads the Gmail labels stored in a Google Takeout mbox file. It lists them in the Labels section of the sidebar with a message count for each, and you search them with label:, is: and in:. Matching ignores case and accents and always compares the whole label. Files exported from Thunderbird or Apple Mail have no labels, so the section does not appear for them.

The sidebar with the All mail mailbox, the Labels section from Inbox to Recruiting, one folder named Trips and two tags
The Labels section lists the system labels first and your own labels after them in alphabetical order.

Where do the labels come from?

Google Takeout writes the labels of each message in a header named X-Gmail-Labels, and commas separate them. Mbox Viewer reads that header when it indexes the file and keeps each label as it is written, capital letters included. The labels include the ones you created in Gmail, such as "Projects/Atlas", and the ones Gmail sets itself, such as "Inbox", "Sent" or "Category Promotions".

Labels are part of the mbox file. Mbox Viewer opens the file read-only, so you cannot rename, add or remove a label in the app. Use tags for your own marks.

How do I filter by label from the sidebar?

  • A click on a label shows only the messages that carry it. The search bar then shows the matching label: query.
  • A second click on the same label clears the filter when the label is the whole query, and every message shows again.
  • ⌘+click on macOS, Ctrl+click on Windows or Shift+click adds a label to the current query, or removes it if it is already there. All the selected labels must match.

The same clicks work on tags and virtual folders, and they combine. A label and a tag selected together show the messages that carry both.

How do I write a label query?

Query Finds
label:Invoices messages labelled "Invoices"
label:"Category Promotions" a label with a space in its name
label:category-promotions the same label, written with hyphens
label:Projects/Atlas the nested label "Projects/Atlas"
label:projects-atlas the same nested label, written with hyphens
label:projects* every label whose name starts with "projects"
-label:Invoices messages without the label "Invoices"

label: compares the whole label. label:Projects does not find "Projects/Atlas". The hyphen form replaces each run of spaces, slashes or other signs with one hyphen, which is the way Gmail writes labels in its own search. Case and accents are ignored in both forms.

Which system labels can I search with is: and in:?

is: and in: are short forms for the labels that Gmail sets itself. They recognise the English and the French names, because Takeout writes the labels in the language of the account.

Query Label names it matches
is:unread Unread, Non lus
is:read messages without Unread or Non lus
is:starred Starred, Suivis
is:important Important
in:inbox Inbox, Boîte de réception
in:sent Sent, Envoyés, Messages envoyés
in:drafts Drafts, Draft, Brouillons
in:spam Spam
in:trash Trash, Corbeille
in:anywhere every message

in: followed by another name works like label:. in:Invoices is the same as label:Invoices. An is: value outside the table, such as is:archived, is ignored with the warning "Unsupported value for is:".

Why do some labels look different in the list?

The sidebar lists the system labels first in a fixed order. Inbox comes first, followed by Starred, Important, Sent, Drafts, Unread, Spam and Trash. Your own labels follow in alphabetical order.

In the message list and the reading pane, colored chips show your own labels and most Gmail categories. The app leaves out the system labels, "Archived" and "Category Personal" there. The label "Opened" is a technical marker that the app hides everywhere, but label:Opened still finds it.

Can I save a label view?

Yes. Run the label query, then use Save to folder above the list, as in Save a search as a folder. When the query is a single label: term, the app proposes the label name as the folder name.

Frequently asked questions

Does Mbox Viewer keep my Gmail labels?

Yes. A Google Takeout export writes the labels of each message in an X-Gmail-Labels header, and Mbox Viewer indexes them. They appear in the Labels section of the sidebar and you can search them with label:.

Why is there no Labels section for my Thunderbird or Apple Mail file?

Those exports carry no X-Gmail-Labels header, so the mailbox has no labels to show. Search by sender, subject, date or text instead, and use tags or virtual folders to group messages.

How do I search a label with a space in its name?

Put the name between quotation marks. The query label:"Category Promotions" finds that label. You can also replace the spaces with hyphens and type label:category-promotions.

How do I search a nested label such as Projects/Atlas?

Type label:Projects/Atlas or label:projects-atlas. To include every label under Projects, type label:projects*.

Does label:Projects also find Projects/Atlas?

No. label: matches a whole label, so label:Projects finds only messages labelled "Projects". Add a star, as in label:projects*, to find every label that starts with that name.

My Gmail account was in French. Does is:unread still work?

Yes. is: and in: recognise the English and French names of the Gmail system labels. For example, in:sent finds messages labelled "Sent", "Envoyés" or "Messages envoyés".

Why does the Opened label not appear in the sidebar?

Mbox Viewer hides "Opened" because Gmail uses it as a technical marker. You can still search it with label:Opened.

How do I show the messages of two labels at once?

Click the first label, then hold ⌘ on macOS or Ctrl on Windows and click the second one. The list then shows the messages that carry both labels. To get messages with either label, type label:Family OR label:Recruiting.

Can I add or rename a Gmail label in Mbox Viewer?

No. Labels come from the mbox file, which Mbox Viewer never modifies. Use a tag to mark messages yourself, and search it with tag:"Name".