Gmail and mutt at the command line

Tim Chase blinux.list at
Fri May 27 15:53:23 UTC 2016

On 2016-05-27 10:02, John J. Boyer wrote:
> Can I use gmail with mutt at the command line? Will it appear like
> messages usually do in mutt?

Yes, you should be able to use Gmail's IMAPS and SMTPS servers within
Mutt.  You might need a local MTA such as sendmail or "msmtp" that
can talk to Google's SMTP server.  You may also need the standard
suite of CA certificates though you should likely already have that
installed.  If not, something like

   sudo apt-get install msmtp openssl ca-certificates

Making the following assumptions:

  - you correctly have the above installed
  - your certs end up in /etc/ssl/certs/ca-certificates.crt
  - your username is "examplejohn at"
  - your password is "MySecretPassword"

you can configure it to send mail using gmail with the following in
your ~/.msmtprc file:

   account default
   port 587
   from "examplejohn at"
   tls on
   tls_starttls on
   tls_trust_file /etc/ssl/certs/ca-certificates.crt
   auth on
   user "examplejohn"
   password "MySecretPassword"
   logfile ~/.msmtp.log

Then your ~/.muttrc you want something like

  set imap_user = 'examplejohn at'
  set imap_pass = 'MySecretPasswordd'
  set spoolfile = imaps://
  set folder = imaps://
  set record=""
  #set record="imaps://[Gmail]/Sent Mail"
  set postponed="imaps://[Gmail]/Drafts"

and you may want

  bind editor <space> noop

if your Gmail folders have spaces in their names.

There's a bit more on the Mutt wiki:

but the page was being unresponsive when I tested it just now.


More information about the Blinux-list mailing list