rss logo

The Mutt Email Client on GNU/Linux

Mutt logo

Configuration

  • Mutt: 2.2.9

How To

Exclude Your Address from Reply-All

  • Add unset metoo to your ~/.muttrc configuration file:
user@host:~$ echo "unset metoo" >> ~/.muttrc

Enable IMAP IDLE Support

  • Add set imap_idle=yes to your ~/.muttrc configuration file:
user@host:~$ echo "set imap_idle=yes" >> ~/.muttrc

Enable Read Receipts

  • Add the header Disposition-Notification-To: <myemailaddress@domain> to your email. Press E in Mutt to edit the message with headers.

Fix “Unable to Save SSL Certificate” Error

  • Add the following lines to your ~/.muttrc configuration file:
user@host:~$ echo -e "set imap_idle=yes\nset certificate_file="~/.mutt_certificates"" >> ~/.muttrc

Random Signature

Per Day

  • Set the signature file in your .muttrc:
set signature="~/.signatures"
  • Store all possible signatures in a file called ~/.signatures.
  • Create a cron job file at /etc/cron.d/random_signature with the following content:

This will update ~/.signature every hour with a random line from your signature list:

00 * * * * user sort -R /home/user/.signatures | head -n 1 | fold -w 72 -s > /home/user/.signature

Per Email

  • Set the signature command in .muttrc:
set signature="sort -R /home/user/.signatures | head -n 1 | fold -w 72 -s|"

Common Mutt Commands

Mail Access
y List Mailboxes
c Change Folder — Open a different mailbox folder
b Bounce Message — Re-send the current message to another recipient (original headers preserved)
Ctrl+T Toggle Message Type — Switch between views (e.g. text/plain, text/html)

Organize Mailboxes

  • Create a Folder:
    • c — Change folder
    • ? — List folders
    • Shift + c — Create new mailbox
  • Delete a Folder:
    • c — Change folder
    • ? — List folders
    • d — Delete selected mailbox
  • Move a Mail to Another Folder:
    • s — Move the current mail
    • Shift + c — Copy the current mail
  • Move Multiple Mails:
    • t — Tag mails
    • ; — Switch to tagged mail mode
    • s — Move tagged mails
  • IMAP: Subscribe or Unsubscribe a Folder:
    • c — Change folder
    • ? — List folders
    • T — Toggle visibility of unsubscribed folders
    • u — Unsubscribe
    • s — Subscribe

In an IMAP environment, replace ~ with = to improve search performance.

  • Show only emails from a specific sender
    • l — Limit messages
    • ~f toto@domaine.local
  • Show emails from a specific date range
    • l — Limit messages
    • ~d 01/01/2018-31/12/2018
  • Show emails from multiple senders and a date range
    • l — Limit messages
    • (~f toto|~f titi) ~d 01/01/2018-31/12/2018
  • Show emails matching a subject
    • l — Limit messages
    • ~s "Elarge your P"
  • Show all emails
    • l — Limit messages
    • all
  • Search for an expression in the message body
    • / — Search
    • ~b EXPR
  • Search for an expression in the full message
    • / — Search
    • ~B EXPR

Configuration File Example

The following settings go in your ~/.muttrc file:

# configuration de base
set realname = "Firstname LASTNAME"
set header_cache =~/.mutt/cache/headers
#set message_cachedir =~/.mutt/cache/bodies
set certificate_file="~/.mutt_certificates"

# imap configuration
set folder="imaps://imap.shebangthedolphins.net:993"
set spoolfile="+INBOX"
set record="+INBOX.Sent"
set imap_user = "user@shebangthedolphins.net"
set imap_pass = "IMAP_password"
set imap_passive="no"
set imap_check_subscribed="yes"
set imap_list_subscribed="yes"
set ssl_starttls=yes
# Automatically poll subscribed mailboxes for new mail (new in 1.5.11)
set imap_check_subscribed
# Reduce polling frequency to a sane level
set mail_check=60

# configuration SMTP
set smtp_url = "smtps://user@shebangthedolphins.net@smtp.shebangthedolphins.net:465/" #with usershebangthedolphins.net as our SMTP user login
set smtp_pass = "SMTP_password"
set from = "user@shebangthedolphins.net"
set use_envelope_from=yes # Pour que postfix ou sendmail ne change pas votre from

#address book
#set alias_file = ~/.mutt/adresses
#source ~/.mutt/adresses

set implicit_autoview 
set editor=/usr/bin/vim
auto_view text/html application/x-pgp-message 
set mailcap_path="~/.mailcap" 
set mailcap_sanitize=yes
unset metoo   # supprime l'adresse de l'expéditeur lors d'une réponse 
#set signature="~/.mutt/signature"

#activer l'idle :
set imap_idle=no

#disable SSL3
set ssl_use_sslv3=no