Mutt

mutt is a text-based mailer: when you have big mailboxes, it’s much much faster and efficient than standard web mail interfaces and heavy clients. But of course, because it’s text-based, it’s also less “nice, fancy and beautiful”. But I care much more about speed than design, so, here is my config file to use mutt with INRIA zimbra:

set copy="yes"                           # Save sent mail on Zimbra
set from="christophe.cerisara@inria.fr"     # Your email 
set folder="imaps://zimbra.inria.fr:993"    # The remote Zimbra IMAP URI
set spoolfile="imaps://zimbra.inria.fr/" # Where your inbox is located on Zimbra
set imap_idle="yes"                      # Use IMAP IDLE for pushing mail
set imap_user="cerisara"                 # Your IMAP username
set imap_pass="$MUTTPASS1"
set mail_check="60"                      # Poll every 60 seconds rather than waiting 24 minutes for new mail
set postponed="+Drafts"                  # Saving postponed messages on Zimbra for later
set realname="First Last"                # Your first name and last name
set reverse_alias="yes"                  # If email is saved in your alias file, show the name of the mail 
set signature="~/.mutt/sig.txt"          # Your email signature, if any
set smtp_url="smtp://cerisara@smtp.inria.fr" # The SMTPS URI for sending mail
set smtp_pass="$MUTTPASS1"
set record="+Sent"                       # Save sent mail to "/Sent" on Zimbra
set sort_alias="alias"                   # Sort the alias file by alias
source ~/.mutt/aliases                   # Alias file to store your "address book"
source ~/.mutt/lists                     # Store any mailing lists here, and respond to the list, rather than "reply to all"Create the file if it 
does not already exist

set header_cache = ~/.cache/mutt
set message_cachedir = ~/.cache/mutt

This set-up works with INRIA zimbra. There are a few additional tricks to check though:

  • install the library libsasl2-modules, otherwise, sending mail via smtp will not work (and there won’t be any self-explaining error !)
  • the password is stored in an file ecrypted with gpg, which contains:

    export MUTTPASS1="mypassword"
  • and I’ve define a wrapper bash script around mutt that decrypt this file before calling mutt

    #!/bin/bash
    
    pwds=`echo gpgpassphrase | gpg --batch -q --passphrase-fd 0 -d ~/.passwords.mutt`
    eval "$pwds"
    exec mutt "$@"

Of course, this wrapper is chmoded 700 so that nobody else sees my simple passphrase. You may also use your standard gpg keys and agent, but I don’t want to enter my master gpg password too often, and this solution seems good enough for me on my machine.

See also