Postfix Configurations Centos Linux
Postfix Configurations Centos Linux
First we will start by removing firewalld and install iptables. We will then open correct ports.
Next we will disable selinux and do complete update. This steps are not necessary and you can
configure selinux and firewall to work with this configuration but to make deployment quicker
we will not use this features for now.
disable selinux by editing /etc/selinux/config and changing enforcing directive to disabled , you
will need to restart system after that.
#yum update -y
inet_interfaces = all # make sure the other ones are disabled - see below
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost
relay_domains = toys.com
mynetworks_style = hos t #uncomment
mynetworks = 192.168.0.23 #add this to only accept messaged for relay
from your trusted ip addressed in this case your internal SMTP server
transport_maps = hash:/etc/postfix/transport
Edit etc/postfix/transport
Install MailScanner
#yum install perl unzip gcc patch rpm-build cpp perl-DBI perl-MIME-tools
perl-DBD-SQLite binutils glibc-devel perl-Filesys-Df zlib zlib-devel automake
perl-devel
Install Spamassassin
Install ClamAV
Configuration
#mkdir /var/spool/MailScanner/spamassassin
#chown postfix /var/spool/MailScanner/spamassassin
#chown postfix /var/spool/MailScanner/incoming/*
#chkconfig postfix off
#systemctl disable postfix.service
#systemctl stop postfix.service
#vim /etc/postfix/main.cf
header_checks = regexp:/etc/postfix/header_checks
vim /etc/postfix/header_checks
/^Received:/ HOLD
vim /etc/MailScanner/MailScanner.conf
Make changes below
Start MailScanner
Install webmin
This step is also optional but it makes configuring and maintaining your server or vm much
quicker.
[Webmin]