My usual system of managing emails is pretty simple. Anything that I need to follow up or reference in the near future lives in my Inbox. If it’s something I want to save, it gets archived out of the way and I can search for it later. Pretty easy, right?
This is straightforward when using Gmail’s web interface – you have your Inbox view by default, and a big ‘Archive’ button to move those emails out of your way. When using most mail clients, such as Apple’s Mail.app, you achieve the same thing by dragging a mail from your Inbox view into Gmail’s “All Mail” folder (as it’s represented via IMAP). Deleting mails works fine, assuming you have your Trash folder set up to be Gmail’s “Bin”.
However, performing this via mutt isn’t quite so straightforward because of how Gmail’s tagging system works and how it’s interpreted by IMAP. By default, deleting a mail in mutt will move it out of your Inbox, but it won’t be stuck in Bin, so it’s effectively just archived. You need to tell mutt that your trash folder is “[Google Mail]/Bin”:
set trash=”imaps://imap.googlemail.com/[Google Mail]/Bin”
All good so far. So what about archiving? In mutt, it seems if you manually copy a mail to “[Google Mail]/All Mail” it stays in your Inbox, which is of no use to me. So instead, and after some experimentation, I use the following macros:
macro index,pager \Ca “<enter-command>unset trash\n <delete-message>”
macro index,pager d “<enter-command>set trash=\”imaps://imap.googlemail.com/[Google Mail]/Bin\”\n <delete-message>”
So now if I want to archive a mail I hit Ctrl-A in the index or in the pager, and if I properly want to delete a mail I just hit ‘d’ as before. Problem solved.