Contact:
Thorsten Gunkel
63456 Hanau
Germany
Mail
Vote to help me to improve this page!
Did this page satisfy your expectations?
vote3 Yes
vote2 Partly
vote1 No
Short comment?
Do not change this:
Add your comment to the
guestbook.
Last modified: 14-09-2005 02.30
NO ePATENTS

Mutt and Slrn

A short guide.
06-08-2005 13.09

Introduction

Mutt and Slrn are two small console applications for mail- and newsreading. Both programs are configured via a systemwide configuration file (in /etc/) and a configuration file in the user's home-directory.
06-08-2005 13.09

Mutt

The mailreader Mutt has very powerful configuration options. At the homepage there are the manual, configuration examples and screenshots. Pro-Linux has an introduction to the Mutt configuration.

Mutt Screenshot

A screenshot from my Mutt (pager menu):
Mutt Screenshot

Mutt Menus

MenuDescription
genericnot really a menu, matches every menu but pager and editor
indexlist of all your emails in a mailbox
pagerone email
browserListe der Mailboxen

Config

Some (hopefully helpful) options from my Mutt config. Further infos
about the used options may be found in the reference chapter in the Mutt manual.
  • Where to save new contacts:
    set alias_file="~/my_aliases"
  • Import an additionally config file (here our address-book):
    source ~/mutt/my_aliases
  • Show aliases instead of emailaddresses:
    set reverse_alias
  • Entries in the browser are listed in their original order:
    set sort_browser=unsorted
  • While reading an email display an index with other emails in the above third of the windows:
    set pager_index_lines=10
  • Display ~ characters at the end of each email:
    set tilde
  • Emails keep their N status even if you visit their mailbox:
    unset mark_old
  • What is a smileys :-) at the beginning of line (and not a further quote level):
    set smileys="(>From )|(:[-^]?[][)(><}{|/DP])"
  • While sending mails try to set not only the From: header but also the envelope From :
    set envelope_from
  • Show the following columns in the index menu:
    message-numbermessage-statusdatesendermessage-sizesubject
    and the date is displayed as in [Mon, 31.03.2003 22:09]:
    set index_format="%4C %Z %D %-20.20F (%4c) %s"
    set date_format="[%a, %d.%m.%Y %H:%M]"
  • What charsets should be used when sending emails (ascending order):
    set send_charset="us-ascii:iso-8859-1:iso-8859-15:utf-8"
  • Default from-address and all your other from-addresses. If a mail is sent to one of your from addresses your reply will automatically will have this address as a from-address. If the address was not in the list the default from-address will be chosen:
    set from="john@example.com"
    set reverse_name
    set alternates=(doe@example.com|john_doe@example.net|john_doe@example.com)
    #CVS:
    #alternates doe@example.com
    #alternates john_doe@example.net
    #alternates john_doe@example.com
  • There is only one editor ;-)
    set editor="/usr/bin/xemacs %s -f post-delete-quoted-signatures"
  • Emails are only in in the same thread if the In-Reply-To and References header matches:
    set strict_threads
    unset collapse_unread
  • Do not try to add the local domain to the from-address.
    unset use_domain
  • Never add a Bcc: header (there a rumours Exim doesn't strip them):
    unset write_bcc
  • Use your own value for the hostname (and ignore the auto-detection):
    set hostname="workstation18.example.com"
  • Mutt Hooks

    With hooks you can set configuration options depending on conditions:
    • Sort Emails in all but the spam folder by thread where we sort be received-date:
      folder-hook .       set sort="threads"
      folder-hook 'spam' set sort="date-received"
    • Some recipients need a "Outlook compatible" PGP encryption:
      send-hook .                       "unset pgp_create_traditional;unset pgp_outlook_compat"
      send-hook '~t noob@example\.net$|~t luser@example\.com$' "set pgp_create_traditional; set pgp_outlook_compat"
    • One of our from-addresses get a special signature:
      send-hook .           "set  signature=~/.signature"
      send-hook '~f john@example\.com' "set signature=~/.signature_john"
    • Add a X-header if recipients matches:
      send-hook .                       "unmy_hdr  Disposition-Notification-To:"
      send-hook '~t john@example\.com$|~t doe@example\.org$' "my_hdr Disposition-Notification-To: X Y <john_doe@example.net>"
    • Default folder for saving mails. If the subject is XY it will be XY_Mails, spam if you have a X-Spam-Level: *** header with a least
      three * and default otherwise:
      save-hook '~h ^X-Spam-Level:\ \\*{3,}' 'spam'
      save-hook '~s XY' 'XY_Mails'
      save-hook . 'default'
    • Outgoing mails for a special recipient are stored in the folder outbox_a, default will be outbox:
      set            record='outbox'
      fcc-hook '~t john@example\.com$' 'outbox_a'
  • Add a X-Operating-System: Debian GNU/X.X (Kernel X.X.X) header:
    my_hdr X-Operating-System: Debian GNU/`uname -s` `cat /etc/debian_version` (Kernel `uname -r`)
  • Display HTML-mails inline (e.g. use links -dump '%s' in your mailcap to extract the text-elements):
    auto_view text/html
  • All mailinglists which mails you receive:
    subscribe \
    example-mailings@example.com \
    newsletter@example.org
  • List of all your mailfolders:
    mailboxes               \
    /home/tgunkel/Mail/mbox \
    imaps://doe@example.org/INBOX \
    pop://john@example.com
  • Display only some headers (in a specified order and show these headers even in your editor):
    ignore *
    unignore Date: From: To: Cc: Bcc: Subject: Mail-Followup-To: Reply-To: User-Agent: X-Mailer: X-Spam-Status: Disposition-Notification-To: X-Diagnostic:
    hdr_order Date: From: To: Cc: Bcc: Subject: Mail-Followup-To: Reply-To: User-Agent: X-Mailer: X-Spam-Status: Disposition-Notification-To:
    set edit_headers
  • Color your headers:
    color header brightblue white ^From:
    color header brightblue white ^To:
    color header brightblue white ^Cc:
    color header brightblue white ^Bcc:
    color header brightblue white ^Subject:
    color header brightblue white ^Date:
    color header brightblue white ^User-Agent:
    color header brightblue white ^X-Mailer:
    color header brightblue white ^Mail-Followup-To:
    color header brightblue white ^Reply-To:
    color header brightred white ^Disposition-Notification-To:
    color header green white ^Received
    color header black white ^Sender:
    color header black white ^X-Mailing-List:
    color header black white ^List-
  • Check regularly for new mails:
    set check_new
    set beep_new
    set mail_check=3
    unset imap_passive
    set pop_checkinterval=60
    set timeout=60
  • Don't delete mails in POP3 boxes when you have read them:
    unset pop_delete
  • List password for your imap folders:
    set imap_authenticators="login"
    account-hook . 'unset imap_pass'
    account-hook imaps://john@example.com 'set imap_pass=secret1'
    account-hook imaps://frank@example.org 'set imap_pass=secret2'
  • How to authorises to your POP3 folders:
    account-hook .             'set pop_authenticators="apop:user"'
    account-hook pop://.*@example.com 'set pop_authenticators="user"'
  • Add extra functions to some keys:
    macro  pager    ';'   "<exit><tag-prefix>"                               "q+ ;"
    macro pager q "<exit>" "Leaves pager to index view"
    macro index q "<sync-mailbox><change-folder>?<toggle-mailboxes>" "Leaves Index to folder list"
    macro browser q "<exit><quit>" "Exit mutt"
    macro browser <Tab> "<toggle-mailboxes><check-new>" "Check New"
    macro generic <f1> "!zless /usr/share/doc/mutt/manual.txt.gz\n" "Show Mutt documentation"
    macro index <f1> "!zless /usr/share/doc/mutt/manual.txt.gz\n" "Show Mutt documentation"
    macro pager <f1> "!zless /usr/share/doc/mutt/manual.txt.gz\n" "Show Mutt documentation"
    bind generic \\ search-next
  • Reply to PGP mails with PGP mails:
    set    pgp_replyencrypt
    set pgp_replysign
    set pgp_replysignencrypted
    unset pgp_show_unusable
  • Forward as Attachment:
    set mime_forward=ask-yes
  • Use GNU-PGP:
    set pgp_clearsign_command=   "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
    set pgp_decode_command= "gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
    set pgp_decrypt_command= "gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
    set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
    set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg --passphrase-fd 0 -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
    set pgp_export_command= "gpg --no-verbose --export --armor %r"
    set pgp_getkeys_command= ""
    set pgp_import_command= "gpg --no-verbose --import -v %f"
    set pgp_list_pubring_command="gpg --no-verbose --batch --with-colons --list-keys %r"
    set pgp_list_secring_command="gpg --no-verbose --batch --with-colons --list-secret-keys %r"
    set pgp_sign_command= "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
    set pgp_verify_command= "gpg --no-verbose --batch --output - --verify %s %f"
    set pgp_verify_key_command= "gpg --no-verbose --batch --fingerprint --check-sigs %r"
  • Mutt SMIME

    In order to write the S/MIME part of this site I used among others this S/MIME Mutt Howto.
    • First decide where your certificates und secrets keys should be stored.
      set smime_certificates="~/.smime/certificates"
      set smime_keys="~/.smime/keys"
      This folders must exist and in each must be an empty file named
      .index
      . Untested: The command
      smime_keys init
      might do that automatically.
    • Where should the root certificates be stored:
      set smime_ca_location="~/mutt/.smime/ca-bundle.crt"
      You can initialize this file with the one you got from your CA or take on of the available list that e.g. one from the ca-certificates for Debian. You can always add certifikates with the command
      smime_keys
      .
    • Now you need your own keypair. If you like you can export it from your Mozilla-Suite. If you put it into a file names foo.p12 issue the command
      smime_keys add_p12 foo.p12
      to import it. The access to your private key is probably secured by a password. You're offered to change it when you import it (which might be a good idea).
    • The following Mutt S/MIME optionen are probably already included in your Mutt distribution.
      # These are used to extract a certificate from a message.
      # First generate a PKCS#7 structure from the message.
      set smime_pk7out_command="openssl smime -verify -in %f -noverify -pk7out"

      # Extract the included certificate(s) from a PKCS#7 structure.
      set smime_get_cert_command="openssl pkcs7 -print_certs -in %f"

      # Extract the signer's certificate only from a S/MIME signature (sender verification)
      set smime_get_signer_cert_command="openssl smime -verify -in %f -noverify -signer %c -out /dev/null"

      # This is used to get the email address the certificate was issued to.
      set smime_get_cert_email_command="openssl x509 -in %f -noout -email"

      # Add a certificate to the database using smime_keysng.
      set smime_import_cert_command="smime_keysng add_cert %f"

      ## Sction B: Outgoing messages

      # Algorithm to use for encryption.
      # valid choices are rc2-40, rc2-64, rc2-128, des, des3
      set smime_encrypt_with="des3"

      # Encrypt a message. Input file is a MIME entity.
      set smime_encrypt_command="openssl smime -encrypt -%a -outform DER -in %f %c"

      # Sign.
      set smime_sign_command="openssl smime -sign -signer %c -inkey %k -passin stdin -in %f -certfile %i -outform DER"

      ##Section C: Incoming messages

      # Decrypt a message. Output is a MIME entity.
      set smime_decrypt_command="openssl smime -decrypt -passin stdin -inform DER -in %f -inkey %k -recip %c"

      # Verify a signature of type multipart/signed
      set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content %f"

      # Verify a signature of type application/x-pkcs7-mime
      set smime_verify_opaque_command="openssl smime -verify -inform DER -in %s %C"
    • This should be sufficient to start with S/MIME however Mutt has currently a bug whoch prevents that you can select your S/MIME key interactively. Therefore you should tell Mutt which of key is yours so mutt must never ask you:
      # The (default) keyfile for signing/decrypting.  Uncomment the following
      # line and replace the keyid with your own.
      #set smime_default_key="12345678.0"
14-09-2005 02.30

Slrn

The newsreader Slrn allows it (with the help of it's scoring capabilities) to deal with large amounts of postings. At the homepage is the manual and in the documentation area is a short guide and an explanation of the scoring. Don't miss the screenshots.
Additional macros e.g. (GNU-)PGP and modify headers if you change the current newsgroup.

Slrn Screenshot

A screenshot from my slrn:
Slrn Screenshot

Slrn Config

Some relevant lines from my configuration.
06-08-2005 13.09
Powered by PHP Created with Xemacs Valid XHTML 1.0! Valid CSS!