Configuring `postfix` is a relatively simple task that will cause email systems to fail if done incorrectly. In this hands-on lab, you’ll be able to practice that configuration and test it in a controlled environment.
Successfully complete this lab by achieving the following learning objectives:
- Configure the hostname and domain
First, we should check out what our hostname and domain are:
With that information recorded in our notes we can elevate to root and verify
sudo -i rpm -q postfix
Now we can configure
sudo vim /etc/postfix/main.cf
Scroll down until we find the
myhostnamevariable. We can set that to “server1.example.com”.
mydomainvariable to “example.com”
Search for the
mail_spool_directoryvariable and uncomment the one that says “/var/mail”
Save and quit, then restart postfix.
sudo systemctl restart postfix
- Send a test email to cloud_user
This task requires understanding how email servers communicate.
Enter in the following commands in order to send the email:
telnet localhost 25
mail from: firstname.lastname@example.org
rcpt to: cloud_user
Subject: Test email
To close out of composing the message, place a
.on a new line and press return.
Ctrl + ]and press return
closeand press return
Check to see that the e-mail sent:
sudo tail /var/log/maillog
Look for the current data, and then confirmation that an e-mail was received.
Change to the