I am trying to set up mutt for Gmail. I am following Crunchbang wiki instructions, however, after putting

set from = "yourusername@gmail.com"
set realname = "Your Real Name"

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

(with my details, of course), I get

$ mutt
Error in $HOME/.muttrc, line 12: imap_user: unknown variable
Error in $HOME/.muttrc, line 13: imap_pass: unknown variable
source: errors in $HOME/.muttrc
Press any key to continue...

If I try to send an email, it doesn't work because instead of IMAP, it tries to send email directly from my localhost's mail system. Mutt says it is version Mutt


So I downloaded mutt-devel on Macports, which is 1.5:

$ mutt -v
Mutt 1.5.21 (2010-09-15)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Darwin 11.3.0 (x86_64)
ncurses: ncurses 5.9.20110404 (compiled with 5.9)
libiconv: 1.14
libidn: 1.22 (compiled with 1.22)
Compile options:
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please visit http://bugs.mutt.org/.

As it stands, it is not configured to use smtp, but imap should be enabled. However, just starting mutt hangs on

Connecting to gmail.com...

Is there a way to check the logs or something to see if, say it can't find the server or the password is being rejected or something else?


After installing for ssl, imap, and smtp support, I still get these warnings/errors, even though it can connect to gmail.

Error in $HOME/.muttrc line 9: trash: unknown variable
Error in $HOME/.muttrc, line 11: header_cache: unknown variable

migrated from stackoverflow.com Mar 22 '12 at 17:17

This question came from our site for professional and enthusiast programmers.

  • Everything worked following that guide with mutt 1.5.21, which is from 2010-09-15. The #! guide shows that setup because it's debian based, and the debian stable repo has 1.5.20 – Rob Mar 22 '12 at 17:51
  • Thanks, @Rob! I have updated to 1.5.21, and it seems I can't connect to gmail yet. – highBandWidth Mar 22 '12 at 22:21
  • 1
    Did you set the rest of the file up? Here's my file (sans passwords) sprunge.us/RKdW – Rob Mar 22 '12 at 22:53
  • @Rob, thanks! However, it doesn't recognise some of the parameters like trash and header_cache. – highBandWidth Mar 30 '12 at 18:56

First you can check is you mutt support IMAP and SMTP by exec
mutt -v


if you want use IMAP ,in your muttrc must have

set imap_user = "YOUR.EMAIL@gmail.com"
set imap_pass = "PASSWORD" 
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX" 

If I try to send an email, it doesn't work because instead of IMAP, it tries to send email directly from my localhost's mail system

Maybe you wanted is SMTP

set smtp_url = "smtp://yourusername@smtp.gmail.com:587/"
set smtp_pass = "yourpassword"

or you can install external programs like esmtp or msmtp

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.