Converting from Pine to Mutt

Changeing from Pine to Mutt

Pine and Mutt are both console based e-mail clients for unix. Pine is by far the most user friendly of the two with more hints on keys to use, a built in editor and built-in configuration. Pine also does NNTP (usenet newsgroups). Mutt's main advantages are good threading (if you like that sort of thing) and good integration with PGP/GnuPG. The reason to change from Pine to Mutt is to get away from Pine's brain dead licencing which does not allow distribution of modified sources or binaries (why? it's not like they can be making money off it). Mutt is Free Software and can be copied and modified under the GNU GPL.

Mutt can't be configured from within itself, you have to edit the config file raw. Here is my configuration file, .muttrc:

set alias_file=~/.mutt_alias   # sets the address book
set folder=~/mail/             # sets where it will find your e-mail mbox files
set move=no                    # turns off the option that moves read file to ~/mbox
set mark_old=no                # stops messages being marked as old
set pager_stop=yes             # when you reach the end of one message don't go onto the next e-mail until told
set postponed=+postponed       # started but unsent e-mails
set signature=~/.sig           # the signature to put at the foot of every e-mail
set sort=date-received         # how to sort the mail boxes.  the default is threaded
set spoolfile=+inbox           # my main inbox, set procmail to send to this
set sig_dashes=no              # don't put two dashed above the .sig 
set editor='emacs -nw -l ~/.emacs-mutt'    # editor to edit e-mails in
set record = "=/sent-mutt-`date +%b-%Y`"  #where to put sent e-mails

# This sets which headers to show
ignore *
unignore To From Sender Reply Subject Date Cc CC Resent-From Resent-To

# Set your from address
my_hdr From: your-address@example.org
# This shows up in a nice message box at the top of e-mails for MS Outlook users
my_hdr X-message-flag: Please do NOT send HTML e-mail or MS Word attachments - use plain text instead

# These type of attachements will be shown inline

auto_view text/html
auto_view application/msword
auto_view application/octet-stream
auto_view application/rtf

A .mailcap file contains the applications to use to convert strange formatted e-mails into something readable.

application/msword; antiword %s; copiousoutput
application/octet-stream; antiword %s; copiousoutput
application/rtf; unrtf --text %s; copiousoutput
text/html;      lynx -dump %s; copiousoutput; nametemplate=%s.html

The .emacs-mutt file sets up emacs in a nice mode (of course you may want to use another editor).

(defun axels-mail-mode-hook () (turn-on-auto-fill) ;;; Auto-Fill is necessary for mails
(turn-on-font-lock) ;;; Font-Lock is always cool *g*
(flush-lines "^\\(> \n\\)*> -- \n\\(\n?> .*\\)*") ;;; Kills quoted sigs.
(not-modified) ;;; We haven't changed the buffer, haven't we? *g*
(mail-text) ;;; Jumps to the beginning of the mail text
(setq make-backup-files nil) ;;; No backups necessary.
)
(or (assoc "mutt-" auto-mode-alist) (setq auto-mode-alist (cons '("mutt-" . mail-mode) auto-mode-alist))) (add-hook \
'mail-mode-hook 'axels-mail-mode-hook) (server-start) ;;; For use with emacsclient

And your .procmail file should put sorted e-mail in ~/mail/foo with the default location as ~/mail/inbox. Using ~/mail/inbox rather than /var/spool/bar saved you having to change between these directories.


MAILDIR=$HOME/mail

...other procmail recipies...

:0
inbox

Now fire up mutt. It should drop you into your inbox. Some of the flags will probably be mixed up from Pine, New messages marked as Old for some reason. Press up and down to go between messages. To jump to a message just type in its number followed by enter. Press page up and page down to scroll up and down. Press Return to read a message.

Scrolling within a message is done with Return to go down and Backspace to go up. Pressing up and down will take you to the next and previous message. Press H to see the full headers. F will forward a message and B will bounce it. To change mailbox type C then ?. V will let you see the parts of an e-mail including attachments and S will then let you save them. A will add the sender to your address book. Q will let you leave the e-mail back to the index. Another Q quits you from Mutt completely.

To create an e-mail press M. Give it the To: address. To use the address book just type in the alias and press Return or type in the alias and press Tab to get a list of completions. Give it a subject and then you'll be thrown into your editor of choice. Just type away and when you're done quit in the normal way. You can now change the headers such as C to add a CC: and T to change the To:. Pressing P lets you sign or encrypt it with GPG. Q gives you the option of postponing for later or discarding the e-mail. When you next compose a new e-mail it will give you the option to continue with one of your postponed ones.

/ lets you search though any screen for text and Esc-/ lets you search backwards. ? will almost always give you a list of keys that you can use.

That's the basics to Mutt. Contact me with any omissions or suggestions.

Copyleft Jonathan Riddell 2003. May be copied under the terms of the GNU Free Documentation Licence only.