How to use Gmail tabs with IMAP

gmailgmail-imapgnusimapmutt

Is there any way to apply an IMAP label to only the messages under the "Primary" tab in my Gmail?

I'd like to use a console-based email client like Mutt or Gnus or Wanderlust to reply to messages, but I only want to see messages which Gmail has filtered into the "Primary" tab.

Best Answer

Unfortunately, Gmail doesn’t expose its “Categories” to IMAP. I'm using Mail.app as my email client, and I had the same desire to have my mail categorized with Gmail’s bayesian-or-whatever classifiers, so I found a fix.

This workaround uses filters to automatically apply labels to categories. Once labeled the old fashioned way, they can then be exposed to IMAP.

  1. Create a new filter via Gmail/settings/filters
  2. Enter category:primary in the “Has the words” field and click “Create filter with this search.”
  3. Check “apply a label to this filter” and create the filter.
  4. Expose the filter to IMAP via Gmail/settings/labels

This will link up your Gmail categories to your Mail.app.

Related Question