• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

UNIX / Linux : How to install and configure mutt

by admin

Mutt is known for being a fast and highly configurable mail client, and since it is text-based, it’s ideal for checking email quickly over SSH.

Installing mutt

mutt can be installed by yum utility as follows.

# yum install mutt
....
Dependencies Resolved

========================================================================================================================================================================================================
 Package                                        Arch                                     Version                                                           Repository                              Size
========================================================================================================================================================================================================
Installing:
 mutt                                           x86_64                                   5:1.5.21-27.el7                                                   base                                   1.4 M
Installing for dependencies:
 mailcap                                        noarch                                   2.1.41-2.el7                                                      base                                    31 k
 tokyocabinet                                   x86_64                                   1.4.48-3.el7                                                      base                                   459 k
 urlview                                        x86_64                                   0.9-15.20121210git6cfcad.el7                                      base                                    27 k

Transaction Summary
========================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 1.9 M
Installed size: 7.3 M
Is this ok [y/d/N]: y

Configuring mutt

1. The configuration file for mutt is located at each users home directory as ~/.muttrc. Below is a sample configuration for the .muttrc file. This is all you need to get mutt up and running.

# vi ~/.muttrc
# About Me
set from = "user@domain.com"
set realname = "Firstname Lastname"

# My credentials
set smtp_url = "smtp://user@domain.com@smtp.domain.com:587/"
set smtp_pass = "password"
set imap_user = "user@domain.com"
set imap_pass = "password"

# My mailboxes
set folder = "imaps://imap.domain.com:993"
set spoolfile = "+INBOX"


# Where to put the stuff
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"

# Etc
set mail_check = 30
set move = no
set imap_keepalive = 900
set sort = threads
set editor = "vim"

# GnuPG bootstrap
# source ~/.mutt/gpg.rc

2. After configuration done, create cache directory.

# mkdir -p ~/.mutt/cache

Verify

To verify if everything is set up properly, send a test email from the server.

# echo "" | mutt -s "subject" -i body.txt -a attachment.txt recipient@example.com
-s used to specify subject of mail.
-i used to specify file containing message body.
-a used to specify attachment file.

Some other commonly used options with mutt are:

-b used to add Bcc address.
-c used to add Cc address.
-e if you want to specify sender's address (something other than default).
Linux / UNIX : Send mail with attachment using mutt
Linux / UNIX : How to send mails with attachments using mailx command
How to send mails with attachments using the solaris mailx command

Filed Under: Linux

Some more articles you might also be interested in …

  1. The /var/log/messages is empty, and so are the rotated log files such as messages.0, messages.1
  2. semanage Command Examples in Linux
  3. How to (Correctly) Change the UID and GID of a user/group in Linux
  4. CentOS / RHEL : How to configure alias (virtual interface) of bond interface (bondx:y)
  5. lvresize: command not found
  6. xfs_admin: command not found
  7. rpcclient Command Examples in Linux
  8. sudo: command not found
  9. How to use strace and ltrace commands in Linux
  10. ansible-pull – Pull ansible playbooks from a VCS repo and executes them for the local host

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright