Subscribe:

Ads 468x60px

Pages

Tuesday, June 28, 2011

Installing and configuring the Postfix mail server


Postfix provides for easier administration, allows increased security, and supports virtual domains. It is also the default mail program on RHEL6. It is the outgoing mail server.


Step 1. To verify that Postfix is installed or not
# rpm -qa | grep postfix


If the package isn’t installed then install it
# yum install –y postfix


Step 2. To start service during system boot time
# chkconfig postfix on


Step 3. Nedd to Stop the sendmail service because you are going to use Postfix in place of the default Sendmail:
# service sendmail stop


Step 4. Need to off sendmail service during system boot if the service is on:
# chkconfig sendmail --list
# chkconfig sendmail off


Step 6. Change the default mail program to Postfix:
# alternatives --config mta
There are 2 programs which provide ‘mta’.
Selection Command
----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter to keep the current selection[+], or type selection number: 2


Step 7. Verify that the current default for mail is Postfix:
# alternatives --display mta | grep current


Edit the master.cf file:
# vim /etc/postfix/main.cf


Step 2. Change the following options:
myhostname = server1.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks = 192.168.1.0/24, 127.0.0.0/8


configure DNS server with the correct MX records before you start the Postfix service.


Step 3. Check sytax of config file:
# postfix check




Step 4. Start the Postfix service:
# service postfix start


Step 1.To open TCP port 25 for the SMTP service
# iptables -I INPUT 5 -p tcp -m tcp --dport 25 -j ACCEPT


Step 2. Save the rule:
# service iptables save


Step 3. Restart the iptables service:
# service iptables restart

0 comments:

Post a Comment