Rabu, 16 September 2015

Cara Install Postfix, Amavisd dan Spamassassin Pada Centos 7


Dear All,

sudah sekian lama tidak nulis di blog, hampir 6 tahun blognya dianggurin ... hehe. entah karena malas, banyak kerjaan dsb, klo bahan sharing sebenarnya juga lumanyan :)

ok..ok langsung saja ... kali ini saya akan menulis tutorial mengenai cara install postfix, amavisd dan spamassassin pada centos 7. cekidot :


1. Install repo epel karena amavisd tersedia hanya di repo epl. selanjutnya install postfix, amavisd, clamd.

# yum install epel-release -y
# yum install postfix amavisd-new clamav clamav-update -y


2. Mengaktifkan auto update pada clamav (freshclam), dengan masuk ke file freshclam (/etc/sysconfig/freshclam) kemudian hapus empat baris terakhir berikut


### !!!!! REMOVE ME !!!!!!
### REMOVE ME: By default, the freshclam update is disabled to avoid
### REMOVE ME: network access without prior activation
FRESHCLAM_DELAY=disabled-warn   # REMOVE ME


selanjutnya menghapus satu line yang bertuliskan "Example" dalam configurasi freshclam.conf

# Comment or remove the line below.

Example


3. Pastikan file crond (auto running services) untuk clamd-update telah enable, dengan memastikan baris berikut ini tidak ada tanda pagar (uncommented) -- folder /etc/cron.d/clamav-update

## Adjust this line...
MAILTO=root

## It is ok to execute it as root; freshclam drops privileges and becomes
## user 'clamupdate' as soon as possible
0  */3 * * * root /usr/share/clamav/freshclam-sleep



4. Melakukan update manual


#freshclam


5. Menyesuaikan beberapa opsi pada file clamd.conf (/etc/clamd.d/clamd.conf) dengan file amavisd.conf (/etc/clamd.d/amavisd.conf), berikut beberapa penyesuaian pada clamd.conf  :


PidFile /var/run/clamd.amavisd/clamd.pid

LocalSocket /var/run/clamd.amavisd/clamd.sock

FixStaleSocket yes

User amavis


6. Mengganti variabel domain dan hostname pada file amavisd.conf (/etc/amavisd/amavisd.conf) :


$mydomain = 'contoh.net.id';
$myhostname = 'mail.contoh.net.id';


7. Melakukan reconfigurasi pada file master.cf (/etc/postfix/master.cf) agar email masuk setelah di proses oleh postfix akan dilakukan scanning oleh amavisd.


### section smtp ###
smtp      inet  n       -       n       -       -       smtpd
 -o receive_override_options=no_address_mappings
 -o content_filter=smtp-amavis:127.0.0.1:10024


### amavis section ###


smtp-amavis  unix  -    -       y       -       2       smtp
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes
 

127.0.0.1:10025 inet n  -       y       -       -       smtpd
-o smtp_send_xforward_command=yes 
-o content_filter= -o smtpd_sender_restrictions= 
-o smtpd_helo_restrictions= 
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o receive_override_options=no_header_body_checks
-o smtpd_helo_required=no
-o smtpd_client_restrictions=
-o smtpd_restriction_classes=
-o disable_vrfy_command=no
-o strict_rfc821_envelopes=yes



8. Melakukan enable system untuk semua service


#systemctl enable postfix
#systemctl enable spamassassin
#systemctl enable amavisd



9. Melakukan start untuk semua service


#systemctl start postfix
#systemctl start spamassassin
#systemctl start amavisd


Tidak ada komentar: