Linux 08172010
Linux 08172010
Linux 08172010
By Vincent Danen
If you're like me, you prefer command line tools over GUI tools, and for email you prefer
plaintext over HTML format. You can have the best of both worlds by using Gmail on the
command line with a tool like mutt, although it does take a bit of tweaking. If you prefer to keep
a copy of your mail locally, you can use POP3 (via fetchmail and procmail) or something like
OfflineIMAP to suck mail down and keep a local copy, syncing the mail back and forth.
With mutt, however, because later versions support IMAP and SMTP directly, you are able to
work with your Gmail or Google Apps account using nothing more than mutt itself: no
fetchmail, no procmail, no OfflineIMAP. All of these tools are great, but Gmail has pretty decent
filtering and the advantages of using the web UI when at a computer not your own might make
you prefer IMAP to sucking everything down via POP3 anyway.
Mutt is extremely straightforward when used with Gmail.
First, you need to create a ~/.muttrc with the following contents. These are really the bare-bones
commands you need for mutt to work with Gmail (customize to suit passwords and email
address):
# A basic .muttrc for use with Gmail
# Change the following six lines to match your Gmail account details
set imap_user = "[user]@gmail.com"
set imap_pass = "[password]"
set smtp_url = "smtp://[user]@[email protected]:587/"
set smtp_pass = "[password]"
set from = "[user]@gmail.com"
set realname = "[User Name]"