Instead of organizing emails by maildirs, you can use GMail's all-label way of categorizing emails. GMail keeps all emails in one "maildir" called "[Gmail]/All Mail", which I have offlineimap map to a maildir called "Archive". You need only sync Archive and Trash. Rely on labels to formulate mu4e "bookmarks." Emails with the label:
are what you see in your GMail inbox (all categories Primary, Social, etc.),
for what GMail considers spam,
for drafts emails,
deleted emails scheduled for purging per GMail settings, and
your "folder names" are just labels of the same name (no leading backslash). Sub-folders are separated with a slash:
, for example.
Accessing GMail Categories
One of the difficulties of integrating mu4e with GMail, is getting access to the very helpful "Categories" assigned by GMail to incoming emails. There is nothing in the email header to indicate the category. You can fix this by creating a filter in GMail that applies a label to emails based on their categories. Add a filter with the following in the "Has the words field": category:(promotions), or category:(primary), etc. In the action, tell GMail to apply a label, such as "CatPromotions". Now, you can use the label in a mu4e search to handle Gmail categories as you like. For example, filter for unread inbox with "x:CategoryPrimary" as one of the selectors.
Example GMail Inbox Bookmark
:query "x:\\\\Inbox and x:CatPrimary and m:/Archive and not g:list"
:name "Unread Inbox"
:query "x:\\\\Inbox and x:CatPrimary and m:/Archive and g:unread and not g:list"
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by ddoherty03