Working with Postfix
In a previous recipe, we learned how to install and configure Postfix as our domain-wide e-mail server. When it comes to working with e-mails, there are lots of different tools and programs available for Linux and we already showed you how to send e-mails through the sendmail
program as well as the swaks
utility. Here in this recipe, we will show you how to work with one of the most commonly used mail utilities in Unix and Linux, called mailx
, which has some useful features missing in the sendmail package for sending mails or reading your mailbox.
How to do it...
We will begin this recipe by installing the mailx
package on our server running our domain-wide Postfix service, as it is not available on CentOS 7 by default.
- Begin by logging in as root and typing the following command:
yum install mailx
- The easiest way is to use
mailx
with its standard input mode, as follows:echo "this is the mail body." | mail -s "subject" john@centos7.home
- You can also...