How to Setup Postfix on CentOS 6.4
Postfix is a open-source mail transfer agent (MTA) that routes and delivers electronic mail. Postfix is an alternative for Sendmail service which provide the same function. This post will describe on how you can install and setup postfix on CentOS 6.4. After you installed postfix, you can use postfix command to controls the operation of the Postfix mail system such as start or stop the master daemon, do a health check, and other maintenance.
1. To install Postfix, use the following yum command :
[root@centos64 ~]# yum install postfix -y
2. To verify if Postfix is already installed, use the following rpm command :
[root@centos64 ~]# rpm -q postfix
Example :
[root@centos64 ~]# rpm -q postfix postfix-2.6.6-2.2.el6_1.x86_64
3. How to check Postfix version :
[root@centos64 ~]# postconf -d | grep mail_version
Example :
[root@centos64 ~]# postconf -d | grep mail_version mail_version = 2.6.6 milter_macro_v = $mail_name $mail_version
4. Configure Basic postfix main.cf file :
[root@centos64 ~]# vi /etc/postfix/main.cf
Uncomment and modify the following two line :
myhostname = centos6.4.ehowstuff.local mydomain = ehowstuff.local
myhostname: is the host name of the system (i.e, the system is called mail or mail.example.com).
mydomain: is the domain name for the email server (it can be a real or fake domain name).
5. Start the postfix service :
[root@centos64 ~]# service postfix start Starting postfix: [ OK ]
6. Restart the postfix service :
[root@centos64 ~]# service postfix restart Shutting down postfix: [ OK ] Starting postfix: [ OK ]
7. How to show postfix pid number on running for postfix services ?
[root@centos64 ~]# ps -ef | grep postfix root 3081 1 0 05:57 ? 00:00:00 /usr/libexec/postfix/master postfix 3083 3081 0 05:57 ? 00:00:00 pickup -l -t fifo -u postfix 3084 3081 0 05:57 ? 00:00:00 qmgr -l -t fifo -u root 3292 1963 0 06:40 pts/0 00:00:00 grep postfix
As always if you need any help you can reach us on twitter @ehowstuff or drop us a comment below.Jumping through archives page to read more articles..