Loading Search...

Wednesday, February 11, 2009

postfix + postgrey + clamsmtp + sanesecurity = easy, clean & light email server

what's wrong with spamassassin? everybody else are using spamassassin for their mail server spam protection.
nothing wrong with it. it just use up too much resources. that's all.

what if we can built lighter system on lower resources system (think vps) with as good spam protection as spamassassin can provide..?

here's my attempt...

first thing first. install all at once.
sudo aptitude install postfix postgrey clamsmtp wget curl rsync gzip

then, configure postfix to use postgrey and clamsmtp.

add this to /etc/postfix/main.cf
smtpd_recipient_restrictions = permit_sasl_authenticated,
           permit_mynetworks,
           reject_unauth_destination,
           check_policy_service inet:127.0.0.1:60000

content_filter = scan:[127.0.0.1]:10026

add this to /etc/postfix/master.cf
# ClamSMTP anti virus scan filter (used by content_filter)
 scan      unix  -       -       n       -       16      smtp
   -o smtp_send_xforward_command=yes
   -o smtp_enforce_tls=no
 # For injecting mail back into postfix from the filter
 127.0.0.1:10025 inet  n -       n       -       16      smtpd
   -o content_filter=
   -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
   -o smtpd_helo_restrictions=
   -o smtpd_client_restrictions=
   -o smtpd_sender_restrictions=
   -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o mynetworks_style=host
   -o smtpd_authorized_xforward_hosts=127.0.0.0/8

restart postfix
sudo /etc/init.d/postfix restart

now, get scam and phishing signature for clamav from sanesecurity, msrbl, securiteinfo, and malwarepatrol.

$ wget ftp://seibercom.net/pub/scamp.tar.gz
$ tar zxvf scamp.tar.gz
$ vi scam.sh
# uncomment this:
# SIG_DB="/var/lib/clamav"
# IF your clamav version < 0.94 then uncomment this too:
# NO_LDB=1
# that's it. save. exit.
$ sudo cp scamp.sh /etc/cron.daily/
# run it once, the first time:
sudo /etc/cron.daily/scamp.sh

done.
you now got a lighter email server with great spam and virus protection.
enjoy less spam!

refs: http://wiki.dennyhalim.com/postfix


-- tips & tricks on computers and gadgets denny on IT ; let's doIT documenting the brain

No comments: