If you’re like me, you prefercommand line tools over GUI tools, and for email you prefer plaintext over HTMLformat.
You can have the best of both worlds by using Gmail on the command linewith a tool like mutt, although it does take a bit of tweaking.
If you preferto keep a copy of your mail locally, you can use POP3 (via fetchmail andprocmail) or something like OfflineIMAP to suck mail down and keep a localcopy, syncing the mail back and forth.
With mutt, however, because laterversions support IMAP and SMTP directly, you are able to work with your Gmailor Google Apps account using nothing more than mutt itself: no fetchmail, noprocmail, no OfflineIMAP.
All of these tools are great, but Gmail has prettydecent filtering and the advantages of using the web UI when at a computer notyour own might make you prefer IMAP to sucking everything down via POP3 anyway.
Mutt is extremely straightforwardwhen used with Gmail.
First, you need to create a~/.muttrc with the following contents. These are really the bare-bones commandsyou need for mutt to work with Gmail (customize to suit passwords and emailaddress):
CODE:
#A basic .muttrc for use with Gmail#Change the following six lines to match your Gmail account detailssetimap_user = "[user]@gmail.com"setimap_pass = "[password]"setsmtp_url = "smtp://[user]@gmail.com@smtp.gmail.com:587/"setsmtp_pass = "[password]"setfrom = "[user]@gmail.com"setrealname = "[User Name]"#Change the following line to a different editor you prefer.seteditor = "vim"#Basic config, you can leave this as issetfolder = "imaps://imap.gmail.com:993"setspoolfile = "+INBOX"setimap_check_subscribedsethostname = gmail.comsetmail_check = 120settimeout = 300setimap_keepalive = 300setpostponed = "+[Gmail]/Drafts"setrecord = "+[Gmail]/Sent Mail"setheader_cache=~/.mutt/cache/headerssetmessage_cachedir=~/.mutt/cache/bodiessetcertificate_file=~/.mutt/certificatessetmove = nosetincludesetsort = 'threads'setauto_tag = yeshdr_orderDate From To Ccauto_viewtext/htmlbindeditor complete-querybindeditor ^T completebindeditor noop#Gmail-style keyboard shortcutsmacroindex,pager y "unset trash\n" "Gmail archive message"macroindex,pager d "settrash=\"imaps://imap.googlemail.com/[Gmail]/Bin\"\n" "Gmail delete message"macroindex,pager gl ""macroindex,pager gi "=INBOX" "Go toinbox"macroindex,pager ga "=[Gmail]/All Mail""Go to all mail"macroindex,pager gs "=[Gmail]/Starred""Go to starred messages"macroindex,pager gd "=[Gmail]/Drafts""Go to drafts"macroindex,pager gt "=[Gmail]/Sent Mail""Go to sent mail"
Next, you need to create thedirectories that mutt will need to store cache information, and also create themailcap file in order to view HTML messages and attachments:
$mkdir -p ~/.mutt/cache/{headers,bodies}$echo "text/html; /usr/bin/elinks -force-html %s" >~/.mailcap
Change the path to the preferred CLIHTML browser of your choice: elinks is a great browser; lynx is good also.
Youcan also add other entries to your mailcap if you prefer; such as launchingOpenOffice.org to view Word files (application/msword) or Evince for PDF files(application/pdf).
After this, you can start mutt andhave immediate access to your Gmail or Google Apps account. You will be askedto save the certificate information; if you select Always Allow, you won’t beprompted for it again.
This configuration is obviouslyquite sparse, and there are many tutorials online on how to spruce up mutt withcolors and other features. This is pretty much the bare minimum to get mutt towork with Gmail; you can send mail and read mail via IMAP, which allows you toget access to your mail account from anywhere that you can ssh into. Thekeybindings noted also mimic some of those keyboard shortcuts used in the webUI. For the paranoid, if you omit the passwords in the configuration file, muttwill ask you each time you start it up.
0 comments:
Post a Comment