Tuesday, 21 April 2015

Postfix Server for a Stand-alone host in RHEL7

In this tutorial, we configure Postfix Email Server for a stand-alone host, which can send and receive mail.

NOTE:
- Ensure that DNS Server is configured for the network.
- To check for errors, view the log file 'var/log/maillog'

1) Edit the file '/etc/postfix/main.cf'. Make the following changes

    #the hostname of the machine
    myhostname = meru.mycompany.com
 

    # the domain name
    mydomain = mycompany.com  

    #the default domain name to append if @domain is missing
    myorigin = $myhostname

    # the network interface addresses on which to receive incoming mail.
    inet_interfaces = all

    # remember to comment this line
    #inet_interfaces = localhost

    #the domains for which this machine is the final destination.
    mydestination = $myhostname, localhost.$mydomain, localhost

2) To view the parameters changed run the following command.
     postconf -n

3) To check for systax errors, run the following command.
     postfix check

4) Open firewall port 25/TCP.
    firewall-cmd --zone=public --add-service=smtp --permanent
    firewall-cmd --reload

5) Restart postfix service
    systemctl restart postfix

No comments:

Post a Comment