This post was originally published on my personal blog mariadcampbell.com.
Table of Contents
- What is mutt?
- Installing mutt
- Sending an email locally to another user which contains an attachment
- Other user receives email and saves email attachment locally
- Asymmetric encryption and decryption series
What is mutt?
mutt is a powerful Command Line email client that sends and receives
emails via Terminal. I use it in addition to mailx, because unlike
mailx, it is able to send real email attachments as well as save
those attachments on a user's local machine.
mutt supports MIME, GPG, PGP, and threading, making it a
powerful tool for managing emails directly from the Linux Command Line.
mutt also allows system administrators to automate and streamline their
workflows with automated notifications. Email plays a critical role in
system security and can be used to deliver security alerts, confirm user
actions, and even recover lost passwords. By properly managing emails
using mutt, we can enhance the security of our Linux system.
There are many other uses for mutt. To learn more, please visit the
article entitled Mastering Mutt: How to Install Mutt Command in Linux.
Installing mutt
One thing to note: in whichever directory we initialize mutt is the
default directory where email attachments are saved.
mutt is not native to Linux. We have to install it. I am on the
Ubuntu derivative Linux Mint, so I can install it with the
following command(s):
sudo apt update
sudo apt upgrade
sudo apt install mutt
Since I only want to use it locally because I have Linux Mint
installed with VirtualBox and only have so much virtual (and hard)
disk space to work with, I decided to pass up on using an external
(gmail) email address to send and receive emails. My main reason for
wanting to use mutt was because of its ability to send
email attachments and save received attachments locally. There are many
other powerful features available, but this is the feature that grabbed
my attention.
Sending an email locally to another user which contains an attachment
I want to send a file to another user on the local network in Linux
using mutt. I would take the following steps:
- First, I would
cdinto thedirectorywhere Ifirstinitializedmutt.Inmycase, it was myhome directory,/home/maria. - Next, I would
determinewhich emailattachmentIwanttosendto theother user.
Next, I will send a text file called email_attachment.txt to local user
magdala, which contains the text
This is some dummy text for the mutt email attachment demo I am creating for my post entitled "Setting up and using the mutt email client in Linux."
I run the following command in Terminal:
mutt -s "Sending Magdala the email_attachment.txt" -a email_attachment.txt -- magdala@maria-VirtualBox
This opens up the mutt interface in the nano text editor. it looks
something like the following:
Then I hit the Return key, and something like the following appears:
Next, I hit Return and the following appears:
The next part is very important to follow correctly. After I have
completed the body of my email, I hit Control + O (not zero) key and
then the Return key, and then the following appears:
As shown at the top of the window, I hit the y key to actually send
the email to user magdala. Then, at the bottom of the window, "Mail
sent" appears, and then I am taken back to the Terminal command prompt.
Other user receives email and saves email attachment locally
Next, user magdala opens her emails using the mutt command, and
something like the following appears:
Next, user magdala makes sure to select the email which contains the
attachment she wants to save to her local machine using the Up or
Down arrow key, and then she hits the V key. This results in
something like the following:
Next, user magdala hits the S key, and that is when the text
"Save to file: email_attachment.txt" appears. And then the following
appears after that:
Next, user magdala hits the Q key, and is taken back to the Terminal
command prompt:
And as also shown in the screenshot, she then runs the ls command to
make sure that the email_attachment.txt file has been saved to her home
directory. And it was!
We have now covered the basics of sending, receiving, and saving
email attachments using mutt.
Asymmetric encryption and decryption series
- Making and verifying digital signatures using GPG in Linux
- Making and verifying a detached signature using a PGP key pair in Linux
- Making and verifying a clear text signature using a PGP key pair in Linux
- Using a specific PGP key pair for digital signing
- Exchanging public keys using a PGP key pair
- Setting up and using the mutt email client in Linux








Top comments (0)