INSTALL POSTFIX MAIL SERVER ON RHEL 8
1. To install packages on RHEL 8 / CentOS 8 use dnf command. Install postfix package by using the following command:
# dnf install postfix
2. To enable and start systemd service enter:
systemctl enable postfix ; systemctl start postfix
3. To verify the service is working we can install the mailx package:
# dnf install mailx
4. As a normal user (named vikasnehra on the lab machine) we write a mail to the admin, in this example we request for more (what else?) disk space:
$ mail root
Subject: quota rise request
Dear admin,
Please increase my disk quota with 1 GB.
Thanks, vikasnehra
.
EOT
Where mail is the client we use, and root is the recipient. The last line containing only a dot will signal the mail client this is the end of our mail, which will be handed to postfix for delivery.
5. To verify the mail is arrived, log in as root (the recipient), and type mail. You should see the list of your mails, with this only item on the list sent in the last step:
Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/var/spool/mail/root": 1 message 1 new
N 1 foo@rhel8lab Mon Nov 26 19:05 20/634 "quota rise request"
&
Where N is "new", 1 is the ID of the message, vishnubane@rhel8 is the sender (username@hostname), delivery time and the subject can also be seen. By typing the message ID, in this case 1 and hitting enter you can read your local mail, verifying the mail delivery system is working as intended.
No comments:
Post a Comment