Calmail mutt

From UCB Math Wiki
Jump to: navigation, search
Ambox content.png Some or all of the information on this page is outdated, irrelevant or confusing. Please help clean it up if you are able.


Configuring mutt for Calmail

mutt is a powerful command line mail client, capable of using IMAP. These instructions are not intended as a mutt tutorial, but for configuring mutt to use IMAP with Calmail.

.muttrc

The following rudimentary .muttrc file will allow you to get started. Replace LOGIN-NAME with your own login name on the Math systems.


# .muttrc
#
# GLOBAL
#
unset move
  set reply_to
  set sort=threads
  set sort_alias=alias
  set sort_aux=last-date-received
  set sort_browser=reverse-date
#
# SSL
#
  set certificate_file="~/.mutt_certificates"
#
# MAILBOXES
#
mailboxes imap://LOGIN-NAME@math.berkeley.edu@calmail.berkeley.edu
mailboxes imap://LOGIN-NAME@mail.math.berkeley.edu/
#
# KEYS BINDINGS
#
bind    index   <up>    previous-entry
bind    index   <down>  next-entry
bind    index   <delete> delete-message

bind  pager     <left>  exit
bind  pager     <right> view-attachments
bind  attach    <left>  exit
bind  attach    <right> view-attach

bind pager G bottom     # just like vi and less
bind attach <enter> view-attach
bind attach <return> view-attach
bind compose <enter> send-message
bind compose <return> send-message
bind index <enter> display-message
bind index <return> display-message
bind pager <enter> next-line
bind pager <return> next-line

Advanced Configuration

This section is primarily intended for those who already use mutt. In order to use mutt with Calmail, you'll need to configure some settings in your .muttrc file. Each of the following sections contains commands which should be added to your .muttrc file. For a complete, working example, take a look at the muttrc file in ~steve/.mutt, which sources several other files in that directory.

mutt.ssl

## SSL
#
  set ssl_starttls
  set certificate_file="~/.mutt/certificates"
  set ssl_usesystemcerts
  set entropy_file="/dev/random"
  set ssl_use_sslv2
  set ssl_use_sslv3
  set ssl_use_tlsv1

mutt.imap

## IMAP
#
unset imap_authenticators
  set imap_delim_chars="/."
  set imap_keepalive=600
unset imap_list_subscribed
unset imap_pass
  set imap_passive
  set imap_peek
  set imap_servernoise
  set imap_user=""

mutt.mailboxes

## MAILBOXES
#
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/consult
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/daemon
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/admin
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/cfengine
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/cron
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/lscr
mailboxes imap://steve@math.berkeley.edu@calmail.berkeley.edu/ucb-sysadmin
mailboxes imap://sizemore@calmail.berkeley.edu/

--Steve Sizemore - Unix System Manager 20:09, 24 March 2009 (UTC)

Note: mutt will be unable to save your ssl certificate if any directory in the

certificate_file

variable does not exist. Make sure to create this directory or use a file in your home directory.

folder, spoolfile, and additional mailboxes

In addition to your INBOX, you can create new folders on the calmail server. Some mailboxes, such as "Sent", the sent mail folder, are created by default. To get at a mailbox named MAILBOXNAME, use a URL of the form

imap://LOGIN-NAME@math.berkeley.edu@calmail.berkeley.edu/MAILBOXNAME

For example, to get mutt to write outgoing messages to your calmail sent mailbox, you can add

set copy=yes
set record=imap://LOGIN-NAME@math.berkeley.edu@calmail.berkeley.edu/Sent

to your muttrc.

To make it easy to browse through your calmail mailboxes, you may wish to add a line of the form

set folder=imap://LOGIN-NAME@math.berkeley.edu@calmail.berkeley.edu/

to your muttrc. Following the instructions below will then bring up a menu containing all of your mailboxes on the calmail server.

To make mutt open your calmail INBOX by default, add a line of the form

set spoolfile=imap://LOGIN-NAME@math.berkeley.edu@calmail.berkeley.edu/

If you change either of the $folder or $spoolfile variables in this fashion, and you have only one mailbox with incoming mail, then the only point of including a mailboxes command is to tell mutt where to check for incoming mail. By default, mutt will check any open mailbox for new mail every 10 minutes anyway, so the mailboxes command is unnecessary for such users. However, if the mailboxes command is omitted, then it is probably a good idea to tell mutt to check for new mail more often, say every 15 seconds, by adding

set timeout=15

to your muttrc.

Using mutt with the new configuration

After you have placed a line of the form

mailboxes imap://LOGIN-NAME@math.berkeley.edu@calmail.berkeley.edu

in your .muttrc file you can access your inbox in the following steps:

  • Press 'c' to change your mailbox.
  • Hit tab to bring up a menu containing your IMAP mailboxes. You may have to hit tab more than once.
  • Select your mailbox from the menu, and follow the prompts to login.

If you also added a line of the form

mailboxes imap://LOGIN-NAME@mail.math.berkeley.edu

then you will be able to access your old math mailbox in the same fashion. No new email will arrive here, so you might want to remove this line after you have copied all old mail to the new mailbox.

These instructions will also work if you changed the $folder variable as above. If you changed the $spoolfile variable as above, then your INBOX will open by default.