Gmail in linux terminal (with Mutt)

mutt-whiteMutt is a light-weight and powerful mail client for unix-like systems. You have to install it with goobook to manage gmail in your linux user terminal (Debian users can download packages from Kevin’s goobook page and follow the debian wiki on mutt).
After the installation, you should create a cache typing in user terminal:

mkdir -p ~/.mutt/cache/{bodies,headers}

Create ~/.mutt/muttrc with the following lines:

# Name Info
set realname = "User Name"
set from = ""

# IMAP Settings
set imap_user =
set imap_pass = `grep 'Gmail' ~/Private/passwords.txt | awk '{print $2}'`
set folder = imaps://
set imap_check_subscribed

# SMTP Settings
set smtp_url=smtps://$
set smtp_pass = `grep 'Gmail' ~/Private/passwords.txt | awk '{print $2}'`

# keep imap connection alive by polling intermittently (time in seconds)
set imap_keepalive = 900

# set timeout (time in seconds)
set timeout = 600

# how often to check for new mail (time in seconds)
set mail_check = 5

# Folders
mailboxes = "+INBOX"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = /dev/null

# Need trash patch for this to work
set trash = "+[Gmail]/Trash"

# store message headers locally to speed things up
set header_cache = ~/.mutt/cache/headers

# how about store messages too
set message_cachedir =~/.mutt/cache/bodies

# Mailcap (autoexecute program declarations)
set mailcap_path = ~/.mutt/mailcap

# Auto display html
set implicit_autoview
auto_view text/html application/x-pgp-message

# Archive Messages (A) and some other nifty commands
bind editor noop #fix for spaces in names of folders
macro index,pager A "unset trash\n " "Gmail archive message"
macro index,pager gi "=INBOX" "Go to inbox"
macro index,pager ga "=[Gmail]/All Mail" "Go to all mail"
macro index,pager gs "=[Gmail]/Sent Mail" "Go to starred messages"
macro index,pager gd "=[Gmail]/Drafts" "Go to drafts"
macro pager \cu |urlview\n

# Goobook query (google contacts)
set query_command="goobook query '%s'"
bind editor \t complete-query

# Add contacts to google
macro index,pager a "goobook add" "add the sender address to Google contacts"

# Reload goobook db
macro index,pager gr "!goobook reload\n" "Goobook reload"

# Dont request to move messages
set move = no

# Auto include copy of original message when you reply
set include = yes

# Thread Sort (Top = newest messages)
set sort = threads
set sort_aux = 'reverse-last-date-received'

# Unset Markers (don't add + signs if message wraps)
unset markers

# allow mutt to open new imap connection automatically
unset imap_passive

# Colors (transparent background)
color error brightred white
color indicator brightyellow red
color status brightgreen blue
color search white black

Create ~/.mutt/mailcap with the following lines:

text/html; lynx -dump -force_html %s; needsterminal; copiousoutput;
image/*; feh -F %s;
application/pdf; evince %s;

Create ~/.netrc with the following lines:

password user-password

Type mutt and test once the address-book: just start an email and hit the tab key to query the contact database. Edit ~/.netrc and replace your user-password with “”, so that your password will be no longer in the .netrc file.

For further readings:

30 giorni a novembre, con …

n-b@debian:~$ date -d "2012-12-06 +60 days"
Mon Feb 4 00:00:00 CET 2013

Un utile comando nel terminale linux per calcolare la data di scadenza, a partire da un giorno iniziale (ad esempio 2012-12-06) e un periodo definito (ad esempio 60 days).

Twitter’s Decalogue (not for dummies)

  1. Create an account on a specific item (not personal or general): it is the only way to make it useful and worth of following.
  2. Create a list for each item you are involved in.
  3. Add each contact to only one list (if every list is unfit for a contact, evaluate to add a list or to unfollow the contact).
  4. Respect the maximum length of a tweet.
  5. Try to add a link, or at least a media, to your tweett (if it can help you to explain).
  6. Verify used hashtags before you use them.
  7. Do not post more than a tweet a day.
  8. Retweet only important piece of news or add value to your retweet.
  9. Read tweets on your RSS reader adding this feed: (it will make you believe in the previous rules!).
  10. Use instead of (you can post from on twitter both).

Linux per professionisti e manager

Talk @ Linux Day 2012
BUC Machinery, Fermo (IT)

Linux Day 2012 – Il software libero nelle piccole e medie imprese

Linux Day 2012 a Fermo - Il software libero nelle piccole e medie imprese