Secure Postfix with Amavisd, ClamAV, SpamAssassin – centos 6

1. install repo :

link : http://wiki.centos.org/AdditionalResources/Repositories/RPMForge?action=show&redirect=Repositories%2FRPMForge#head-f0c3ecee3dbb407e4eed79a56ec0ae92d1398e01

misal : ketika di uname -i muncul veri : x86_64

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

2. install tools nya :

yum install amavisd-new clamav clamav-devel clamd spamassassin -y

3. config Clamav

vi /etc/clamd.conf

kasih tanda #

# TCP port address.
# Default: no
# TCPSocket 3310

4. config Amavisd-new

vi /etc/amavisd/amavisd.conf or vi /etc/amavisd.conf

$mydomain = ‘smtp.exemple.com’;
$hostname = ‘smtp.exemple.com’;

5. Configure master.cf

vi /etc/postfix/master.cf

#628 inet n – n – – qmqpd
pickup fifo n – n 60 1 pickup
cleanup unix n – n – 0 cleanup
qmgr fifo n – n 300 1 qmgr
#qmgr fifo n – n 300 1 oqmgr
tlsmgr unix – – n 1000? 1 tlsmgr
rewrite unix – – n – – trivial-rewrite
bounce unix – – n – 0 bounce
defer unix – – n – 0 bounce
trace unix – – n – 0 bounce
verify unix – – n – 1 verify
flush unix n – n 1000? 0 flush
proxymap unix – – n – – proxymap
proxywrite unix – – n – 1 proxymap
smtp unix – – n – – smtp

amavisfeed unix – – n – 2 lmtp
-o lmtp_data_done_timeout=1200
-o lmtp_send_xforward_command=yes
127.0.0.1:10025 inet n – n – – smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks

6. config main cf

tambahkan line berikut :

# use amavisd as filter on port 10024
content_filter=amavisfeed:[127.0.0.1]:10024

7. restart service

# service clamd start
# service amavisd start
# chkconfig amavisd on
# chkconfig clamd on
# service postfix restart

7. test mail

Sep 23 00:33:35 smtp amavis[11522]: (11522-02) Passed CLEAN {RelayedOpenRelay}, [202.56.163.50]:41266 [202.56.163.50] -> ,, Message-ID: <5420F810.3070908@banjarnahor.com>, mail_id: G6KEIQI59Fq8, Hits: 1.274, size: 634, queued_as: 5FA461254618, 14177 ms
Sep 23 00:33:35 smtp postfix/lmtp[12009]: 3037A1254615: to=, relay=127.0.0.1[127.0.0.1]:10024, delay=14, delays=0.03/0.01/0/14, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 5FA461254618)

About the Author

Leave a Reply