wiki:UseCases/Gmail

Version 4 (modified by MichaelRay, 4 years ago) (diff)

!escape title (again) and add spaces for new wikiml in last fix

UserStory/GMailOverIMAP

This is a quick guide to setting up mutt to work with GMail's new IMAP interface.

Essentials: configuration options

  set imap_user = 'yourusername@gmail.com'
  set imap_pass = 'yourpassword'

  set spoolfile = imaps://imap.gmail.com/INBOX
  set folder = imaps://imap.gmail.com/
  set record="imaps://imap.gmail.com/[Gmail]/Sent Mail"
  set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"

You probably want to

  set `record=""`

if you're using the GMail SMTP server, as it handles saving the sent mail anyway.

You can also set the mbox:

  set mbox="imaps://imap.gmail.com/[Gmail]/All Mail"

...which means that when you exit mutt, it will prompt you to archive your read messages.

If you are using the trash_folder patch

  set trash="imaps://imap.gmail.com/[Gmail]/Trash"

You can change folders using the change-folder command, but you'll need to hit <space> to view the files instead of just changing folders.

Web keyboard shortcut macros

  bind editor <space> noop
  macro index,pager y "<save-message>=[Gmail]/All Mail<enter><enter>" "Archive"
  macro index,pager d "<save-message>=[Gmail]/Trash<enter><enter>" "Trash"
  macro index gi "<change-folder>=INBOX<enter>" "Go to inbox"
  macro index ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
  macro index gs "<change-folder>=[Gmail]/Starred<enter>" "Go to starred messages"
  macro index gd "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts"

You need the "noop" bind so that the line editor accepts IMAP folders with spaces in their names. The gi, ga, gs and gd shortcuts help get around the "navigation quirks" mentioned above too.