×

How To Install Postfix on CentOS 6 ?

How To Install Postfix on CentOS 6 ?

About Postfix

Postfix is free open source Mail Transfer Agent which works to route and deliver email.

Please follow the steps to install the Postfix:

Step 1: First of install postfix on centos

[[email protected] ~]# yum -y install postfix

Step 2: Edit the main file of the postfix

[[email protected] ~]# vi /etc/postfix/main.cf

# line 70: uncomment and specify hostname
myhostname = mail.server.world
# line 77: uncomment and specify domain name
mydomain = server.world
# line 93: uncomment
myorigin = $mydomain
# line 110: change
inet_interfaces = all
# line 155: add
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
# line 255: uncomment and specify LAN
mynetworks = 127.0.0.0/8, 10.0.0.0/24
# line 410: uncomment (use Maildir)
home_mailbox = Maildir/
# line 536: uncomment; line 537: add
header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks
# line 562: add
smtpd_banner = $myhostname ESMTP
# add at the bottom
# limit an email size 5M
message_size_limit = 5242880
# limit mailbox 100M
mailbox_size_limit = 104857600

# for SMTP-Auth setting
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth-client
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject

Step 3: Edit header_check file

[[email protected] ~]# vi /etc/postfix/header_checks
# add at the head
# reject if email address is empty
/^From:.*<#.*@.*>/ REJECT
/^Return-Path:.*<#.*@.*>/ REJECT
[[email protected] ~]# vi /etc/postfix/body_checks
# reject if includes ‘example.com’ in mail body
/^(|[^>].*)example.com/ REJECT

Step 4: before starting of postfix please stop the sendmail

[[email protected] ~]# /etc/rc.d/init.d/sendmail stop

Shutting down sm-client:[ OK ]
Shutting down sendmail:[ OK ]

Step 5:
[[email protected] ~]# chkconfig sendmail off
[[email protected] ~]# alternatives –config mta # change default MTA

 

 

http://ideastack.com/vps.html

Leave a Reply

Your email address will not be published.