Saturday, March 19, 2011

Postfix+ tpop3d + clamsmtp


The following steps create a mail server:

login: ogeb

pass: * * * *

FreeBSD 4.5-STABLE (INDOFREEBSD) # 3: Mon Oct 20 19:56:53 UTC 2005

$ sudo su
Disable sendmail via rc.conf

# pico / etc / rc.conf

sendmail_enable = "NONE" lalu save

Install postfix

#cd /usr/ports/mail/postfix

#make ; make install ; make clean

Install Clamav

#cd /usr/ports/security/clamav

#make ; make install ; make clean

Install clamsmtp

#cd /usr/ports/security/clamsmtp #make ; make install ; make clean

Install tpop3d

#cd /usr/ports/mail/tpop3d #make ; make install ; make clean

tahap selanjut nya adalah mengkonfigurasi yang telah kita install tadi

#mv /usr/local/etc/postfix/main.cf /usr/local/etc/postfix/main.cf.default #pico /usr/local/etc/postfix/main.cf

-----isi file main.cf-----

myhostname = mail.indofreebsd.or.id
mydomain = indofreebsd.or.id
mydestination = $myhostname, localhost.$mydomain
inetinterfaces =192.168.1.5,203.130.195.1
mynetworks = 127.0.0.0/8,192.168.1.0/24,203.130.195.1/29,222.124.1.1/29
aliasmaps = hash:/usr/local/etc/postfix/aliases
aliasdatabase = hash:/usr/local/etc/postfix/aliases
bouncequeuelifetime = 1d
maximalqueuelifetime = 1d
notifyclasses = 2bounce, bounce, delay, policy, protocol, resource, software
daemondirectory = /usr/local/libexec/postfix
commanddirectory = /usr/local/sbin
messagesizelimit = 502400000
mailboxsizelimit = 502400000
smtpdhelorequired = yes
disablevrfycommand = yes
strictrfc821envelopes = yes
smtpdetrnrestriction = reject
smtpdrecipientrestrictions =
rejectunknownsenderdomain
rejectnonfqdnsender
rejectunauthpipelining
rejectmultirecipientbounce,
checkrecipientaccess hash:/usr/local/etc/postfix/recipientaccess
permitmynetworks
rejectunauthdestination
rejectrblclient sbl-xbl.spamhaus.org
rejectrblclient list.dsbl.org
rejectrblclient dnsbl.sorbs.net
rejectrblclient bl.spamcop.net
rejectrhsblclient blackhole.securitysage.com
rejectrhsblsender blackhole.securitysage.com
smtpdrestrictionclasses =
mimeheaderchecks = regexp:/usr/local/etc/postfix/mimeheaderchecks
headerchecks = regexp:/usr/local/etc/postfix/headerchecks
bodychecks = regexp:/usr/local/etc/postfix/bodychecks
mailowner = postfix
smtpdbanner = $myhostname INDOFREEBSD MAIL SERVER
contentfilter = scan:127.0.0.1:10025
receiveoverrideoptions = noaddressmappings
readmedirectory = no
sampledirectory = /usr/local/etc/postfix
sendmailpath = /usr/local/sbin/sendmail
htmldirectory = no
setgidgroup = maildrop
manpagedirectory = /usr/local/man
newaliasespath = /usr/local/bin/newaliases
mailqpath = /usr/local/bin/mailq
queuedirectory = /var/spool/postfix
unknownlocalrecipientreject_code = 450

-isi file main.cf-

lalu save
kemudian edit master.cf untuk dukungan clamav

#pico /usr/local/etc/postfix/master.cf
—————-tambahkan ini ke master.cf—————

#AV scan filter (used by contentfilter)
scan unix – - n – 16 smtp
-o smtpsendxforwardcommand=yes

#For injecting mail back into postfix from the filter
127.0.0.1:10026 inet n – n – 16 smtpd
-o contentfilter=
-o receiveoverrideoptions=nounknownrecipientchecks,noheaderbodychecks
-o smtpdhelorestrictions=
-o smtpdclientrestrictions=
-o smtpdsenderrestrictions=
-o smtpdrecipientrestrictions=permitmynetworks,reject
-o mynetworksstyle=host
-o smtpdauthorizedxforwardhosts=127.0.0.0/8
—————-tambahkan ini ke master.cf—————

tahap selanjutnya adalah mengkonfigurasi clamav

#pico pico /usr/local/etc/clamd.conf
————————isi file clamd.conf—————————-

LogFile /tmp/clamd.log
LogFileUnlock
LogFileMaxSize 2M
LogTime
LogClean
LogSyslog
LogFacility LOG_MAIL
LogVerbose
PidFile /www/tmp/clamd.pid
TemporaryDirectory /www/tmp
LocalSocket /www/tmp/clamd
FixStaleSocket
MaxConnectionQueueLength 30
StreamMaxLength 26M
MaxThreads 20
FollowDirectorySymlinks
FollowFileSymlinks
User clamav qscand
ScanOLE2
ScanMail
ScanRAR
ArchiveMaxFileSize 25M
ArchiveMaxCompressionRatio 300
ArchiveBlockMax

————————isi file clamd.conf—————————-

tahap selanjutnya adalah mengkonfigurasi clamsmtp

#pico /usr/local/etc/clamsmtpd.conf
——————-isi file clamsmtpd.conf————————

OutAddress: 127.0.0.1:10026
Listen: 127.0.0.1:10025
ClamAddress: /www/tmp/clamd
Header: X-Virus-Scanned: INDOFREEBSD MAIL Anti Virus
TempDirectory: /www/tmp
Quarantine: on
User: clamav

——————-isi file clamsmtpd.conf————————

tahap selanjutnya jalankan satu persatu aplikasi yang kita install tadi

#cd /usr/local/etc/rc.d

#ln -s /usr/local/sbin/postfix postfix.sh #pico /etc/rc.conf
——————-tambahkan ini pada rc.conf——-

clamsmtpdenable=”YES”
clamavfreshclamenable=”YES”
clamavclamdenable=”YES”
tpop3denable=”YES”

——————-tambahkan ini pada rc.conf——-

#./tpop3d.sh start

#./clamav-clamd.sh start

#./clamav-freshclam.sh start

#postfix start

semua tahapan telah selesai silahkan mempergunakan email anda

Regards,

ogeb

0 comments: