Hello, friends. Can you imagine being able to send an email from the terminal? Of course, it is possible. So, you will learn how to install Mutt on Debian 10 and configure it to do this.
To send an email from the terminal several tools will help us. But there is a complete client called Mutt that facilitates the whole process. If you are a frequent terminal user then you will love this tool because it is so fast and easy to set up.
Some of Mutt’s features include:
- color support
- message threading
- MIME support (including RFC2047 support for encoded headers)
- PGP/MIME (RFC2015)
- various features to support mailing lists, including list-reply
- active development community
- POP3 support
- IMAP support
- full control of message headers when composing
As you can imagine, this tool is popular with sysadmins and all users who spend a lot of time on the terminal. Because it is quite complete and easy to configure and use.
Install Mutt on Debian 10
The Mutt package is available from the official Debian repositories so you should have no problems installing it.
So, open a terminal and run
sudo apt update sudo apt upgrade
This way we will have the system up to date and ready for battle.
Now what we have to do is install the package in question
sudo apt install mutt Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: guile-2.2-libs libgc1c2 libgsasl7 libkyotocabinet16v5 libltdl7 libmailutils5 libmariadb3 libntlm0 libpython2.7 mailutils-common mariadb-common mysql-common Use 'apt autoremove' to remove them. The following additional packages will be installed: libgpgme11 libtokyocabinet9 Suggested packages: default-mta | mail-transport-agent urlview aspell | ispell mixmaster The following NEW packages will be installed: libgpgme11 libtokyocabinet9 mutt 0 upgraded, 3 newly installed, 0 to remove and 5 not upgraded. Need to get 2,204 kB of archives. After this operation, 7,773 kB of additional disk space will be used. Do you want to continue? [Y/n]
Then, we have to start the configuration process.
Configuring Mutt to send email from the terminal
Before we can use it, we need to make some configurations related to our email provider. But first, create the directories that the application needs to work.
mkdir -p ~/.mutt/cache/headers mkdir ~/.mutt/cache/bodies
Also, create the certificates and muttrc files. The latter is in charge of storing the application configuration.
touch ~/.mutt/certificates touch ~/.mutt/muttrc
Now, it is necessary to add the configuration that we need so that Mutt can start without problems.
nano ~/.mutt/muttrc
And add the following
set from = "[email protected]" set realname = "Your real name" set imap_user = "[email protected]" set imap_pass = "password" set folder = "imaps://imap-url-provider:port" set spoolfile = "+INBOX" set header_cache =~/.mutt/cache/headers set message_cachedir =~/.mutt/cache/bodies set certificate_file =~/.mutt/certificates set smtp_url = "smtp://[email protected]:port/" set smtp_pass = "password" set move = no set imap_keepalive = 900
Replace each value with the correct one in your case. In case you don’t know some of them you can search the net or contact your email provider.
Note: If you are using Gmail then you have to enable access to less secure applications from your account.
Save the changes and close the editor
Then, access Mutt by simply running the command.
mutt
And you are done.
Conclusion
Sending an email is such a common thing nowadays but we can do it via the terminal thanks to Mutt. This is quite simple and will help us with our workflow.