How to Use the Command Line for Fast & Powerful Mutt Email Client With Gmail
You can access your Gmail account using the Mutt email client when you frequently work from the command line and prefer an email client program over a Web browser for email access. The Mutt email client requires helper applications for Post Office Protocol and Simple Mail Transfer Protocol access, however Mutt and Gmail both support the Internet Mail Access Protocol. Edit the Mutt configuration file to access your Gmail account over IMAP.
Instructions
-
-
1
Open a command line terminal and type “vi ~/.muttrc” and press the “Enter” key. The “mutt.rc” configuration file will open.
-
2
Use the “Arrow” keys to navigate the cursor to an empty line in document. Press the “I” key.
-
-
3
Type the following entries into the “mutt.rc” file:
set imap_user = "yourname@gmail.com"
set imap_pass = "password"
set smtp_url = "smtp://yourname@smtp.gmail.com:587/"
set smtp_pass = "password"
set from = "yourname@gmail.com"
set realname = "Your Name"set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed="+[Gmail]/Drafts"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates
set move = no
set sort = 'threads'
set sort_aux = 'last-date-received'
set imap_check_subscribedignore "Authentication-Results:"
ignore "DomainKey-Signature:"
ignore "DKIM-Signature:"
hdr_order Date From To Ccmacro index,pager y "<enter-command>unset trash\n <delete-message>" "Gmail archive message"
macro index,pager d "<enter-command>set trash=\"imaps://imap.googlemail.com/[GMail]/Bin\"\n <delete-message>" "Gmail delete message"
macro index,pager gi "<change-folder>=INBOX<enter>" "Go to inbox"
macro index,pager ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
macro index,pager gs "<change-folder>=[Gmail]/Starred<enter>" "Go to starred messages"
macro index,pager gd "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts" -
4
Replace the "yourname@gmail.com" in the “set imap_user = "yourname@gmail.com"" entry with the email address you use to login to Gmail.
-
5
Swap “password” in the “set imap_pass = "password"“ line with the password used to log in to your Gmail account.
-
6
Replace the “yourname” in the "smtp://yourname@smtp.gmail.com:587/" entry with the name of your Gmail account.
-
7
Swap the “yourname@gmail.com” in the “set from = "yourname@gmail.com"" entry with your Gmail email address.
-
8
Replace the “Your Name” in the “set realname = "Your Name"” line to your real name or nick name used with your Gmail email account.
-
9
Press the “ESC” key. Type “:wq” and press the “Enter” key.
-
10
Type “mutt” on the command line and press “Enter.” Write “a” on the command line when prompted to accept SSL certificates and press “Enter.”
-
11
Type the “g” and “I” keys at the same time to view your “Inbox.” Press the “g” and “d” keys at the same time to view contents in the “Drafts” directory.
-
12
Press the “g” and “s” keys at the same time to display all messages marked with a “Star.” Tap the “g” and “a” keys at the same time to see “All Mail.”
-
13
Tap the “j” key to move down. Type the “k” key to move up. Press the “y” key to archive a message that is open or that you have highlighted and press “Enter.” Touch the “d” key to delete an email message.
-
14
Touch the “s” key and enter a label for a highlighted message to save the highlighted message. Press the “c” key and then type the name of a folder, and press “Enter” to move to a different folder. Tap the “/” key and type a character string you wish to find in your email and press “Enter.”
-
15
Type “$” each time you wish to save pending changes, such as archiving or deleting messages, and press the “Enter” key.
-
16
Press the “m” key to open a new email message you wish to send. Type the destination email address and press the “Enter” key. Write a subject line and press “Enter.”
-
17
Type a message you wish to email and press “Enter” when the message is completed. Press “y” to send the message.
-
18
Tap the “q” key to exit the Mutt program.
-
1
References
Resources
- Photo Credit Stockbyte/Stockbyte/Getty Images