SOURCECODEBD.NET

Live Experience

Home

Install Postfix

[root@mail ~]# yum -y install postfix
[root@mail ~]# vi /etc/postfix/main.cf

# line 76: specify hostname
myhostname = mail.sourcecodebd.net

# line 83: specify domain name
mydomain = sourcecodebd.net
 
# line 99: make valid
myorigin = $mydomain
 
# line 116: change
inet_interfaces = all

# line 164: add
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
 
# line 264: specify LAN
mynetworks = 127.0.0.0/8, 10.0.0.0/24
 
# line 419: make valid (use Maildir)
home_mailbox = Maildir/
 
# line 545: make valid
header_checks = regexp:/etc/postfix/header_checks
 
# line 546: add
body_checks = regexp:/etc/postfix/body_checks

# bottom: add (limit an email 5M)
message_size_limit = 5242880

# bottom: add (limit an email-box 100M)
mailbox_size_limit = 104857600

# these 4 lines are for SMTP-Auth

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

 
[root@mail ~]# vi /etc/postfix/header_checks

# add at the head of file
# reject empty address email

/^From:.*<#.*@.*>/ REJECT
/^Return-Path:.*<#.*@.*>/ REJECT
# hide Received section

/^Received:/ IGNORE

[root@mail ~]# vi /etc/postfix/body_checks

# reject email that includes example.com

/^(|[^>].*)example.com/ REJECT

 
[root@mail ~]# /etc/rc.d/init.d/sendmail stop
[root@mail ~]# chkconfig sendmail off
[root@mail ~]# 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
 
[root@mail ~]# /etc/rc.d/init.d/postfix start
[root@mail ~]# /etc/rc.d/init.d/saslauthd start
[root@mail ~]# chkconfig postfix on
[root@mail ~]# chkconfig saslauthd on

You are here: Home / Fedora_Mail / Install Postfix