Setup mail client on CentOS 7


A lot of people often need to be able to send e-mail from a server at home. For instance, you may be running a Raspberry Pi that is monitoring something or doing something fun such as filming or taking pictures of your neighbor. I wrote this small guide as it is probably the easiest way of doing it for CentOS 7.

1. To start with, you probably have an ISP with an e-mail server, such as This will be needed later in step 4 of the guide.

2. Make sure postfix is installed. Or else, yum install postfix. At the time of writing this is what I am running.

[root@serv1 ~]# yum list installed|grep postfix
postfix.x86_64 2:2.10.1-6.el7 @anaconda

3. Backup your /etc/postfix/ file to /etc/postfix/

4. Edit the file /etc/postfix/ and change the following settings:

myorigin =
mydestination =, localhost
relayhost =

Where can be something like or whatever the name is of your own domain.

5. Restart postfix, service postfix restart

6. Try it by doing something like this, if you want to monitor your RAID

/usr/sbin/mdadm --detail /dev/dm-1 > /root/RAID_STATUS.log
/bin/mail -s "RAID STATUS" "" < /root/RAID_STATUS.log

One thought on “Setup mail client on CentOS 7

  1. Pingback: Monitor for new wine releases using systembolaget API | kickass infosec

Leave a Reply

Your email address will not be published. Required fields are marked *