Setup and Configure Basic E-mail Server

Follow the instruction to setup and configure basic E-mail Server

1. Start two terminal shells, one as root on desktopX, the other as root on serverX

2. On each machine, confirm that postfix and mutt packages are installed and that the
   postfix service is running.

   # yum install -y postfix mutt
   # service postfix status
 
3. On serverX, add the user elvis. Become elvis and open the mutt MUA to monitor
   incoming mail.
 
   # useradd elvis
   # yum install -y mutt
   # su - elvis
   $ mutt

4. Use the mutt MUA on desktopX to compose and send mail to elvis@serverX.example.com.

   Press m in mutt to compose a new message. Enter elvis@serverX.example.com in the
   To: field. Enter Test as the subject.Enter a few words in the body and save and exit
   (it opened the file in vi). Press y t send to mail.

5. Did elvis receive e-mail on serverX? check it

6. On desktopX use mailq to examine the delivery queue.Also browse /ver/log/maillog to
   look for any problems.

   # mailq
   # tail /var/log/maillog

7. On serverX, recall that postfix binds to localhost only be default according to Red Hat
   policy. Use netstat to confirm this is the case.

   # netstat -tuln | grep :25

8. Examine the current settings of the inet_interfaces directive in the main postfix
   configuration file /etc/postfix/main.cf

   # grep inet_interfaces /etc/postfix/main.cf

9. Edit /etc/postfix/main.cf. Find the line that has inet_interfaces = localhost and
   change it to inte_interfaces = all. Restart the postfix service and confirm the
   deamon is listening on all interface.

   # service postfix restart
   # netstat -tuln | grep :25

10.ON desktopX use postfix flush to manually flush the pending delivery queue.Confirm
   that the queue is now empty and that the mail was successfully delivered.
 
   # postfix flush
   # mailq
   # tail /var/log/maillog

11.On serverX use the mutt MUA to confirm e-mail delivery. Also examine /var/log/maillog
   for evidence the mail was successfully delivered.
 
   # mutt
   # tail /var/log/maillog

-- Happy E-mailing

Related topic:
                      Basic E-mail Delivery
                      Key e-mail delivery concepts
                      The postfix MTA