Sie sind auf Seite 1von 31

Setting up Qmail Server on CentOS 6.

5 x86_64
Original Author: m.kamal
Updated !: "eo #n $ing %&hang #nming'
#mail: teo.en.ming(gmail.)om
*ate: ++ $ar)h +,-4
Note: This article covers most options of qmail installation & configuration, as we have gathered most
needed Qmail packages to a powerful mail server, and satisfy all system administrator needs. Wish you
all the est of luck. !et"s start..,
is a secure, reliale, efficient, simple message transfer agent. #t is meant as a
replacement for the entire sendmail$inmail system on typical #nternet$connected %N#& hosts.
Se)ure: 'ecurity isn"t (ust a goal, ut an asolute requirement. )ail delivery is critical for users* it
cannot e turned off, so it must e completely secure.
.eliale: qmail"s straight$paper$path philosophy guarantees that a message, once accepted into the
system, will never e lost. qmail also supports maildir, a new, super$reliale user mailo+ format.
)aildirs, unlike mo+ files and mh folders, won"t e corrupted if the system crashes during delivery.
,ven etter, not only can a user safely read his mail over N-', ut any numer of N-' clients can
deliver mail to him at the same time.
#//i)ient: .n a /entium under 0'12.', qmail can easily sustain 344444 local messages per day5
that"s separate messages in(ected and delivered to mailo+es in a real test6 7lthough remote deliveries
are inherently limited y the slowness of 1N' and ')T/, qmail overlaps 34 simultaneous deliveries y
default, so it 8ooms quickly through mailing lists.
Simple: qmail is vastly smaller than any other #nternet )T7. 'ome reasons why:
9:; .ther )T7s have separate forwarding, aliasing, and mailing list mechanisms. qmail has
one simple forwarding mechanism that lets users handle their own mailing lists.
93; .ther )T7s offer a spectrum of delivery modes, from fast<unsafe to slow<queued.
qmail$ send is instantly triggered y new items in the queue, so the qmail system has (ust
one delivery mode: fast<queued.
9=; .ther )T7s include, in effect, a speciali8ed version of inetd that watches the load
average. qmail"s design inherently limits the machine load, so qmail$smtpd can safely run
from your system"s inetd.
>eplacement for sendmail: qmail supports host and user masquerading, full host hiding, virtual
domains, null clients, list$owner rewriting, relay control, doule$ounce recording, aritrary >-? @33
address lists, cross$host mailing list loop detection, per$recipient checkpointing, downed host ackoffs,
independent message retry schedules, etc. #n short, it"s up to speed on modern )T7 features. qmail also
includes a drop$in AsendmailB wrapper so that it will e used transparently y your current %7s.
3. .e0uired pa)kage1
There are five packages needed for this qmail install.
3.: netqmail$:.4C.tar.g8
qmail is a secure, reliale, efficient, simple message transfer agent. #t is designed for typical #nternet$
connected %N#& hosts. 7s of .ctoer 344:, qmail is the second most common ')T/ server on the
#nternet, and has y far the fastest growth of any ')T/ server.
3.3 ucspi$tcp$4.@@.tar.g8
#t is a tool similar to inetd. ucspi$tcp listens in 3D port and spawns qmail$smtpd when required. ucspi$
tcp stands for %ni+ ?lient 'erver /rogram #nterface for T?/.
3.= daemontools$4.EC.tar.g8
daemontools is actually a tool to manage & monitor daemons linu+. #t is used in qmail as well to
manage qmail daemons.
3.F checkpassword$4.G4.tar.g8
checkpassword provides a simple, uniform password$checking interface to all root applications. #t is
suitale for use y applications such as login, ftpd, and pop=d.
3.D qmail$smtpd$auth$4.=:.tar.g8
This patch enales ')T/ 7%TH protocol with following auth types: !.I#N, /!7#N and ?>7)$
)1D.
2. Qmail 3n1tall
#nstall required package:
yum install gcc gcc$c<< make patch pam$devel opensslJ wget vim$common vim$enhanced $y
=.: 4et the /ile1
1ownload files and place them into the 2usr2local2src directory. This document refers to that directory
for install procedures.
cd 2usr2local2src
wget http:22www.qmail.org2netqmail$:.4C.tar.g8
wget http:22cr.yp.to2ucspi$tcp2ucspi$tcp$4.@@.tar.g8
wget http:22cr.yp.to2daemontools2daemontools$4.EC.tar.g8
wget http:22cr.yp.to2checkpwd2checkpassword$4.G4.tar.g8
wget ftp:22ftp.freesd.org2pu2-ree0'12ports2local$distfiles2garga2qmail2qmail$smtpd$auth$4.=:.tar.g8
Now create 2package directory and move daemontools$4.EC.tar.g8 to 2package.
mkdir 2package
mv 2usr2local2src2daemontools$4.EC.tar.g8 2package
=.3 Create u1er1 and group1
>un following commands one y one, to create required users & groups
groupadd nofiles
useradd $g nofiles $d 2var2qmail qmaild
useradd $g nofiles $d 2var2qmail qmaill
useradd $g nofiles $d 2var2qmail qmailp
useradd $g nofiles $d 2var2qmail2alias alias
groupadd qmail
useradd $g qmail $d 2var2qmail qmailq
useradd $g qmail $d 2var2qmail qmailr
useradd $g qmail $d 2var2qmail qmails
=.= Compile 5 3n1tall
%ntar the Qmail source
cd 2usr2local2src
tar $+8vf netqmail$:.4C.tar.g8
Appl! the S$"6 pat)h
cd 2usr2local2src
tar $+8vf qmail$smtpd$auth$4.=:.tar.g8
cd qmail$smtpd$auth$4.=:2
cp >,71),.auth aseCF.c aseCF.h ..2netqmail$:.4C
patch $d ..2netqmail$:.4C K auth.patch
?ompile & install qmail.
cd 2usr2local2src2netqmail$:.4C
make setup check
F. Con/igure Qmail
F.: 6o1t 3n1tallation 1etup
/ost installation configuration can e done y running following script.
.2config$fast mail.teo$en$ming.com
F.3 Con/igure Qmail alia1e1.
?reate a user named AadminB to receive all administrator emails.
useradd admin*
cd Lalias*
echo admin M .qmail$postmaster*
echo admin M .qmail$mailer$daemon*
echo admin M .qmail$root*
echo admin M .qmail$ause*
chmod CFF Lalias2.qmailJ *
?reate )aildir for AadminB user
su admin
2var2qmail2in2maildirmake L2)aildir
F.= Con/igure Qmail to u1e $aildir
Now we need to configure qmail to use the )aildir -ormat.
?reate A2var2qmail2rcB with following contents.
N62in2sh
set $+
N %sing stdout for logging
N %sing control2defaultdelivery from qmail$local to deliver messages y default
e+ec env $ /7THOP2var2qmail2in:Q/7THP R
qmail$start PScat 2var2qmail2control2defaultdeliverySP
)ake A2var2qmail2rcB e+ecutale

chmod EDD 2var2qmail2rc
?reate A2var2qmail2control2defaultdeliveryB file.
echo .2)aildir2 M2var2qmail2control2defaultdelivery
F.F .epla)e Sendmail inarie1
chmod 4 2usr2li2sendmail *
chmod 4 2usr2sin2sendmail *
mv 2usr2li2sendmail 2usr2li2sendmail.ak *
mv 2usr2sin2sendmail 2usr2sin2sendmail.ak *
ln $s 2var2qmail2in2sendmail 2usr2li2sendmail *
ln $s 2var2qmail2in2sendmail 2usr2sin2sendmail *
D. 3n1tall u)1pi7t)p
%ntar the ucspi$tcp source.
cd 2usr2local2src2
tar $+8vf ucspi$tcp$4.@@.tar.g8
/atch ucspi$tcp with Aucspi$tcp$4.@@.errno.patchB provided with net qmail.
cd ucspi$tcp$4.@@
patch K 2usr2local2src2netqmail$:.4C2other$patches2ucspi$tcp$4.@@.errno.patch
#nstall ucspi$tcp.
make
make setup check
C. 3n1tall )he)kpa118ord%In case you want to install qmail-pop2d instead of dovecot. dont do this step'
%ntar checkpassword source.
cd 2usr2local2src
tar $+8vf checkpassword$4.G4.tar.g8
/atch checkpassword with Acheckpassword$4.G4.errno.patchB provided with net qmail.
cd checkpassword$4.G4
patch K 2usr2local2src2netqmail$:.4C2other$patches2checkpassword$4.G4.errno.patch
#nstall checkpassword.
make
make setup check
E. 3n1tall daemontool1
%ntar the daemontools source
cd 2package
tar $+8vf daemontools$4.EC.tar.g8
/atch daemontools with Adaemontools$4.EC.errno.patchB provided with net qmail.
cd 2package2admin2daemontools$4.EC2src
patch K 2usr2local2src2netqmail$:.4C2other$patches2daemontools$4.EC.errno.patch
#nstall daemontools
cd ..
package2install
@. Qmail Startup 1)ript
The AqmailctlB script is used as startup script for qmail.
@.: *o8nload 0mail)tl
cd 2var2qmail2in2
wget http:22lifewithqmail.org2qmailctl$script$dtE4
@.3 Setup 0mail)tl
mv qmailctl$script$dtE4 qmailctl
chmod EDD 2var2qmail2in2qmailctl
ln $s 2var2qmail2in2qmailctl 2usr2in
G. Setup 0mail71end 5 0mail71mtpd
G.: Create 1upervi1e 1)ript dire)torie1 /or 0mail daemon1
?reate supervise directories for qmail$send, qmail$smtpd & qmail$pop=d.
mkdir $p 2var2qmail2supervise2qmail$send2log
mkdir $p 2var2qmail2supervise2qmail$smtpd2log
mkdir $p 2var2qmail2supervise2qmail$pop=d2log
G.3 Create 1upervi1e 1)ript /or 0mail71end
?reate supervise script for qmail$send with name A2var2qmail2supervise2qmail$send2runB.
The file should have following contents.
N62in2sh
e+ec 2var2qmail2rc
G.= 0mail71end log daemon 1upervi1e 1)ript
?reate qmail$send log daemon supervise script with name A2var2qmail2supervise2qmail$send2log2runB.
The script should have following contents
N62in2sh
e+ec 2usr2local2in2setuidgid qmaill 2usr2local2in2multilog t 2var2log2qmail
G.F 0mail71mtpd daemon 1upervi1e 1)ript
?reate qmail$smtpd daemon supervise script with name A2var2qmail2supervise2qmail$smtpd2runB.
The script should have following contents
N62in2sh
set $+
Q)7#!1%#1OSid $u qmaildS
N.-#!,'I#1OSid $g qmaildS
)7&')T/1OScat 2var2qmail2control2concurrencyincomingS
!.?7!OShead $: 2var2qmail2control2meS
if T $8 PQQ)7#!1%#1P $o $8 PQN.-#!,'I#1P $o $8 PQ)7&')T/1P $o $8 PQ!.?7!P U* then
echo Q)7#!1%#1, N.-#!,'I#1, )7&')T/1, or !.?7! is unset in
echo 2var2qmail2supervise2qmail$smtpd2run
e+it :
fi
if T 6 $f 2var2qmail2control2rcpthosts U* then
echo PNo 2var2qmail2control2rcpthosts6P
echo P>efusing to start ')T/ listener ecause it"ll create an open relayP
e+it :
fi
e+ec 2usr2local2in2softlimit $m G444444 R
2usr2local2in2tcpserver $v $> $l PQ!.?7!P $+ 2etc2tcp.smtp.cd $c PQ)7&')T/1P R
$u D4G $g D4G 4 smtp 2var2qmail2in2qmail$smtpd 3M&:
?reate the concurrencyincoming control file.
echo 34 M 2var2qmail2control2concurrencyincoming
chmod CFF 2var2qmail2control2concurrencyincoming
G.D 0mail71mtpd log daemon 1upervi1e 1)ript
?reate qmail$smtpd log daemon supervise script with name A2var2qmail2supervise2qmail$
smtpd2log2runB.
The script should have following contents
N62in2sh
e+ec 2usr2local2in2setuidgid qmaill 2usr2local2in2multilog t 2var2log2qmail2smtpd
G.C Create the log dire)torie1 and add exe)ute permi11ion1 on the run 1)ript1.
mkdir $p 2var2log2qmail2smtpd
chown qmaill 2var2log2qmail
chown qmaill 2var2log2qmail2smtpd
chmod EDD 2var2qmail2supervise2qmail$send2run
chmod EDD 2var2qmail2supervise2qmail$send2log2run
chmod EDD 2var2qmail2supervise2qmail$smtpd2run
chmod EDD 2var2qmail2supervise2qmail$smtpd2log2run
:4. Create 1o/t link /or the daemon1 in 91ervi)e /older
:4.: Add 0mail71end to 91ervi)e /older
ln $s 2var2qmail2supervise2qmail$send 2service2qmail$send
:4.3 Add 0mail71mtpd to 91ervi)e /older
ln $s 2var2qmail2supervise2qmail$smtpd 2service2qmail$smtpd
Note 1 The !service directory is created when daemontools is installed.
Note 2 The qmail system will start automatically shortly after these links are created.
JJ 0efore running command qmailctl, Vou should run AdaemontoolsB with following command
2command2svscanoot &
.>
'tart daemontools with %pstart on ?ent.' C.D as it doesn"t work with sysvinit:
>emove the added line from 2etc2initta :
'W::3=FDC:respawn:2command2svscanoot
$ ?reate a new file 2etc2init2svscan.conf , with the startup code in it:
start on runlevel T=FDU
respawn
e+ec 2command2svscanoot
$ Tell init to re$read its configuration files and start svscanoot:
N initctl reload$configuration
N initctl start svscan
#f you want to run it now, do: qmailctl start
::. 3n1tall :popmail
::.: Compile 5 uild :popmail
cd 2usr2local2src2uild
wget http:22garr.dl.sourceforge.net2pro(ect2vpopmail2vpopmail$stale2D.F.==2vpopmail$D.F.==.tar.g8
tar +v8f vpopmail$D.F.==.tar.g8
cd vpopmail$D.F.==
groupadd vchkpw
mkdir 2var2vpopmail
useradd $g vchkpw $d 2var2vpopmail vpopmail
.2configure $$enale$clear$passwdOy $$enale$loggingOy $$enale$auth$loggingOy $$enale$roaming$
usersOy $$enale$ip$alias$domainsOy
make
make install$strip
:=. 3n1tall *ove)ot
1ovecot is an open source #)7/ and /./= email server for !inu+2%N#&$like systems, written with
security primarily in mind. 1ovecot is an e+cellent choice for oth small and large installations. #t"s
fast, simple to set up, requires no special administration and it uses very little memory.
:=.: *o8nload dove)ot
cd 2usr2local2src
wget http:22www.dovecot.org2releases2:.32dovecot$:.3.C.tar.g8
:=.3 #xtra)t dove)ot
tar $+8vf dovecot$:.3.C.tar.g8
:=.= Compile 5 uild dove)ot
cd dovecot$:.3.C
.2configure $$with$ioloopO#.!../ $$with$notifyON.T#-V $$with$sslOopenssl $$with$passwd $$with$
passwd$file $$with$shadow $$with$pam $$with$checkpassword $$with$vpopmail $$with$static$userd
make
make install
:=.F Create )erti/i)ate
mkdir $p 2etc2ssl2certs2
mkdir $p 2etc2ssl2private2
cd 2usr2local2src2dovecot$:.3.C2doc2
chmod EDD mkcert.sh
.2mkcert.sh
This will create 2etc2ssl2certs2dovecot.pem & 2etc2ssl2private2dovecot.pem
:=.D Create 9et)9pam.d9dove)ot
?ontents of 2etc2pam.d2dovecot is given elow.
auth required pamXuni+.so nullok
account required pamXuni+.so
:=.C Create dove)ot.)on/ /ile
cp $pv 2usr2local2etc2dovecot$e+ample.conf 2usr2local2etc2dovecot.conf
:=.E #dit dove)ot.)on/
)odify 2usr2local2etc2dovecot.conf as given elow.
protocols O imap imaps pop= pop=s
disaleXplainte+tXauth O no
sslXcertXfile O 2etc2ssl2certs2dovecot.pem
sslXkeyXfile O 2etc2ssl2private2dovecot.pem
firstXvalidXuid O @G
firstXvalidXgid O :
passd vpopmail Y
args O wemailO:3E.4.4.:
Z
userd vpopmail Y
args O quotaXtemplateOquotaXruleOJ:ackendO[q
Z
mailXlocation O maildir:2var2vpopmail2domains2[d2[n2)aildir
:=.@ Create *ove)ot 1tartup 1)ript
?reate 2etc2init.d2dovecot with following contents.
N62in2ash
N 2etc2rc.d2init.d2dovecot
N 'tarts the dovecot daemon
N chkconfig: \ CD =D
N description: 1ovecot #map 'erver
N processname: dovecot
N 'ource function lirary.
. 2etc2init.d2functions
test $+ 2usr2local2sin2dovecot ]] e+it 4
>,TW7!O4
progOP1ovecot #mapP
start9; Y
echo $n QP'tarting Qprog: P
daemon 2usr2local2sin2dovecot
>,TW7!OQ^
T Q>,TW7! $eq 4 U && touch 2var2lock2susys2dovecot
echo
Z
stop9; Y
echo $n QP'topping Qprog: P
killproc 2usr2local2sin2dovecot
>,TW7!OQ^
T Q>,TW7! $eq 4 U && rm $f 2var2lock2susys2dovecot
echo
Z
N 'ee how we were called.
case PQ:P in
start;
start
**
stop;
stop
**
reload]restart;
stop
start
>,TW7!OQ^
**
condrestart;
if T $f 2var2lock2susys2dovecot U* then
stop
start
fi
**
status;
status 2usr2local2sin2dovecot
>,TW7!OQ^
**
J;
echo QP%sage: Q4 Ycondrestart]start]stop]restart]reload]statusZP
e+it :
esac
e+it Q>,TW7!
Now, make 2etc2init.d2dovecot e+ecutale
chmod EDD 2etc2init.d2dovecot
:=.G Create dove)ot u1er
useradd dovecot
:=.:4 Start dove)ot
2etc2init.d2dovecot start
:F. :popmail )ommand1
Wpopmail tools are located in 2var2vpopmail2in2
authvchkpw clearopensmtp dotqmail3valias vaddaliasdomain vadddomain vadduser valias vchangepw
vchkpw vconvert vdeldomain vdelivermail vdeloldusers vdeluser vdominfo vipmap vkill vlist
vmkpasswd
vmoddomlimits vmoduser vpasswd vpopull vpopmaild vsetuserquota vusagec vuserinfo
:F.: Adding a domain
1omain can e added using following command
2var2vpopmail2in2vadddomain teo$en$ming.com
2var2vpopmail2in2vadddomain 8hang$enming.com
:F.3 Adding an email a))ount.
,mail address is added using following command
2var2vpopmail2in2vadduser teo$en$ming_teo$en$ming.com
2var2vpopmail2in2vadduser teo$en$ming_8hang$enming.com
:D. "8eak Qmail in1tallation /or S$"6 authenti)ation
:D.: Con/igure 0mail71mtpd run /ile
cd 2service2qmail$smtpd
cp $pv run run.ak
)odify run file as given elow.
N62in2sh
set $+
Q)7#!1%#1OSid $u qmaildS
N.-#!,'I#1OSid $g qmaildS
)7&')T/1OScat 2var2qmail2control2concurrencyincomingS
!.?7!OShead $: 2var2qmail2control2meS
if T $8 PQQ)7#!1%#1P $o $8 PQN.-#!,'I#1P $o $8 PQ)7&')T/1P $o $8 PQ!.?7!P U* then
echo Q)7#!1%#1, N.-#!,'I#1, )7&')T/1, or !.?7! is unset in
echo 2var2qmail2supervise2qmail$smtpd2run
e+it :
fi
if T 6 $f 2var2qmail2control2rcpthosts U* then
echo PNo 2var2qmail2control2rcpthosts6P
echo P>efusing to start ')T/ listener ecause it"ll create an open relayP
e+it :
fi
e+ec 2usr2local2in2softlimit $m G444444 R
2usr2local2in2tcpserver $v $> $l PQ!.?7!P $+ 2etc2tcp.smtp.cd $c PQ)7&')T/1P R
$u D4G $g D4G 4 smtp 2var2qmail2in2qmail$smtpd 3M&:
Note 1 "#$ is the %I& ' (I& of vpopmail
grep D4G 2etc2passwd
vpopmail:+:D4G:D4G::2var2vpopmail:2in2ash
Note 2 &ont forget to replace server.domain.com with your hostname in )*&N format.
:D.3 Con/igure v)hkp8
cp $pv 2var2vpopmail2in2vchkpw 2var2vpopmail2in2vchkpw.ak
chmod EDD 2var2vpopmail2
chmod FEDD 2var2vpopmail2in2vchkpw
chown root.root 2var2vpopmail2in2vchkpw
qmailctl stop
qmailctl start
qmailctl stat
:C .e1tart 1ervi)e1
Now, we have to restart Qmail & 1ovecot.
:C.: .e1tart Qmail
qmailctl stop
qmailctl start
:C.3 .e1tart *ove)ot
2etc2init.d2dovecot restart
:E. Spama11a11in; ClamA:; .ipmime; and SimS)an 3n1tallation.
SpamA11a11in is a mail filter to identify spam. #t is an intelligent email filter which uses a diverse
range of tests to identify unsolicited ulk email, more commonly known as 'pam. These tests are
applied to email headers and content to classify email using advanced statistical methods. #n addition,
'pam7ssassin has a modular architecture that allows other technologies to e quickly wielded against
spam and is designed for easy integration into virtually any email system..
Clam Anti:iru1 is an open source 9I/!; anti$virus toolkit for %N#&. #t provides a numer of utilities
including a fle+ile and scalale multi$threaded daemon, a command line scanner and advanced tool
for automatic dataase updates.
<re1h)lam is the automatic dataase update tool for ?lam 7ntiWirus. #t can work in two modes:
:. interactive \ on demand from command line
3. daemon \ silently in the ackground.
rip$3$# \ email attachment 2 decomposition tool.
1escription
rip)#), is a command line tool used to aid in the e+traction of email orne attachments to files which
can e processed using other %N#& tools. rip)#), supports oth the >-? )#), standards as well as
eing ale to ehave according to various )%7 `features" which are often used as e+ploitation holes.
SimS)an is a program developed y #nterE, the same people who wrote vpopmail, qmailadmin, and
several other programs which are commonly used on qmail servers. #t serves the same purpose for
which many people use qmail$scanner, however ecause it"s written in ? instead of /erl it runs much
more quickly, making it a etter choice for high$volume mail servers.
Now it is time to make our e$mail server more secure, so to do that we will install 'pamassassin,
?lam7W, >ipmime, and 'im'can.
:@. SpamA11a11in in1tallation:
:@.3 3n1talling 1pama11a11ain /rom SOU.C#:
yum install modXperl.+@CXCF modXperl$devel.+@CXCF perl$?/7N
cd 2usr2local2src
wget http:22archive.apache.org2dist2spamassassin2)ail$'pam7ssassin$=.=.3.tar.g8
tar $+8vf )ail$'pam7ssassin$=.=.3.tar.g8
cd 2usr2local2src2)ail$'pam7ssassin$=.=.3
perl $)?/7N $e shell
o conf prerequisitesXpolicy ask
force install 1igest::'H7 HT)!::/arser Net::1N' Net7ddr::#/ Time::Hi>es 7rchive::Tar #.::ali
1igest::'H7 )ail::'/- #/::?ountry >a8or3 Net::#dent #.::'ocket::#N,TC #.::'ocket::''!
?ompress::ali )ail::1b#) 10# !W/::%ser7gent HTT/::1ate ,ncode::1etect
o conf prerequisitesXpolicy ask
perl )akefile./!
make
make install
+t this moment ,pamassassin will complain a-out some dependences. -ut if no error message appear
we can go ahead and continue the installation with no pro-lems.
groupadd spamd
useradd $g spamd $d 2etc2mail2spamassassin $s 2in2false $m spamd
chown $> spamd.spamd 2etc2mail2spamassassin
.k, now we need to create a directory and set 'pamassassin to the initiali8ation:
mkdir 2var2run2spamd
chown $> spamd 2var2run2spamd
sa$update $1
:@.= .un 1pamd:
spamd $+ $u spamd $H 2etc2mail2spamassassin $s 2var2log2spamd.log $d
$pidfileO2var2run2spamd2spamd.pid &
!et"s create a script for the 'pamassassin initiali8ation.
?opy and paste the following script to the file 2etc2init.d2spamdctl:
N62in2sh
N description: the spamassassin daemon
case PQ:P in
start;
echo P'tarting the spamassassin daemon 9spamd;cP
spamd $+ $u spamd $H 2etc2mail2spamassassin $s 2var2log2spamd.log $d \pidfile
2var2run2spamd2spamd.pid
**
stop;
echo P'topping the spamassassin daemon 9spamd;cP
kill Scat 2var2run2spamd2spamd.pidS
**
restart;
echo P>estarting the spamassassin daemon 9spamd;cP
spamdctl stop
spamdctl start
**
help;
cat KKH,!/
stop 5 stops the spamassassin daemon
start 5 starts the spamassassin daemon
restart 5 stops and restarts spamd
H,!/
**
J;
echo P%sage: Q4 Ystart]stop]restart]helpZP
e+it :
**
esac
e+it 4
To make sure that smpad is running type the following command:
ps au+ ] grep spamd
:@.F Added 1pamd on logrotate:
touch 2etc2logrotate.d2spamd
.pen the file and paste the te+t ellow:
nano 2etc2logrotate.d2spamd
N 'pamassassin !ogrotate
2var2log2spamd Y
daily
notifempty
missingok
postrotate
2usr2in2killall $H%/ spamd 3M 2dev2null ]] true
endscript
Z
:G. 3n1talling )lamA::
cd 2usr2local2src
wget http:22mirror.troule$free.net2sources2clamav$4.GE.C.tar.g8
tar $+8vf clamav$4.GE.C.tar.g8
cd clamav$4.GE.C
groupadd clamav
useradd $g clamav clamav
.2configure
make
make install
:G.: Con/iguring /re1h)lam:
touch 2var2log2freshclam.log
chmod C44 2var2log2freshclam.log
chown clamav 2var2log2freshclam.log
cd 2usr2local2src
wget http:22shupp.org2software2toaster$scripts$4.G.:.tar.g8
tar +fv8 toaster$scripts$4.G.:.tar.g8
cp 2usr2local2src2toaster$scripts$4.G.:2freshclam 2etc2init.d2freshclam
chmod EDD 2etc2init.d2freshclam
ln $s 2etc2init.d2freshclam 2etc2rc.d2rc=.d2':44freshclam
chkconfig $$add freshclam
chkconfig freshclam on
chkconfig $$list freshclam
:G.3 Adding /re1h)lam to logrotate:
cp 2usr2local2src2toaster$scripts$4.G.:2freshclam.logrotate 2etc2logrotate.d2freshclam
mkdir $p 2var2qmail2supervise2clamd2log
mkdir $p 2var2log2clamd
chown clamav 2var2log2clamd
cp 2usr2local2src2toaster$scripts$4.G.:2clamd.run 2var2qmail2supervise2clamd2run
cp 2usr2local2src2toaster$scripts$4.G.:2clamd.log.run 2var2qmail2supervise2clamd2log2run
chmod EDD 2var2qmail2supervise2clamd2run
chmod EDD 2var2qmail2supervise2clamd2log2run
:G.= #dit the /ile /re1h)lam.)on/ and /ollo8 the 1tep1 ello8:
nano 2usr2local2etc2freshclam.conf
%pdate!og-ile 2var2log2freshclam.log
!ogTime yes
!og'yslog yes
!et"s start the daemon clamd:
ldconfig
ln $s 2var2qmail2supervise2clamd 2service
2etc2init.d2freshclam start
/01121 3ant change dir to !usr!local!share!clamav
JT. 'olve follow steps elow:
mkdir 2usr2local2share2clamav
chmod EDD 2usr2local2share2clamav
2etc2init.d2freshclam start
34. 3n1talling ripmime:
cd 2usr2local2src
wget http:22www.pldaniels.com2ripmime2ripmime$:.F.4.:4.tar.g8
tar $+8vf ripmime$:.F.4.:4.tar.g8
cd ripmime$:.F.4.:4
make
make install
3:. Sim1)an in1tallation:
cd 2usr2local2src
wget http:22garr.dl.sourceforge.net2pro(ect2simscan2simscan2simscan$:.F.42simscan$:.F.4.tar.g8
tar $+8vf simscan$:.F.4.tar.g8
cd simscan$:.F.4
wget http:22qmail.(ms:.net2simscan2simscan$:.F.4$comined.=.patch
>unning ripmime patch:
patch $p: K simscan$:.F.4$comined.=.patch
+ll right/ If everything is worked as e4pected with this configuration simscan will delete automaticaly
all the spam messages. In order to rela4 and control this process you can change the hit to the option 5
ena-le-spam-hits6num-er7 8e4 5ena-le-spam-hits697:.
-or any other type of configuration you can use:
.2configure $$enale$clamavOy \enale$attachOy $$enale$dropmsgOy $$enale$spamOy $$enale$
spamc$userOy $$enale$qmail$queueO2var2qmail2in2qmail$queue $$enale$ripmime $$enale$
receivedOy $$enale$userOclamav \enale$spam$auth$userOy \enale$clamavd$
pathO2usr2local2share2clamav
make
make install
?ontents of 2var2qmail2control2simcontrol:
:clamOyes,spamOyes,spamXpassthruOyes,attach.vs:.lnk:.scr:.wsh:.hta:.pif
2var2qmail2in2simscanmk $g
?ontents of 2etc2tcp.smtp:
:3E.:allow,>,!7V?!#,NTOPP
qmailctl stop
qmailctl cd
qmailctl start
qmailctl stat
33. 3n1tall Auto.e1ponder1:
cd 2usr2local2src
wget http:22www.interE.com2devel2autorespond$3.4.D.tar.g8
tar 8+vf autorespond$3.4.D.tar.g8
cd autorespond$3.4.D
gcc $Wall $o autorespond autorespond.c
cp autorespond 2usr2local2in
3=. 3n1tall #=mlm %$ailing >i1t':
cd 2usr2local2src
wget http:22untrouled.org2e8mlm2archive2E.:.:2e8mlm$id+$E.:.:.tar.g8
tar 8+vf e8mlm$id+$E.:.:.tar.g8
cd e8mlm$id+$E.:.:
make
make man
make setup
3F. 3n1tall QmailAdmin %?e Control 3nter/a)e':
cd 2usr2local2src
wget http:22garr.dl.sourceforge.net2pro(ect2qmailadmin2qmailadmin$devel2qmailadmin$:.3.:C.tar.g8
tar 8+vf qmailadmin$:.3.:C.tar.g8
cd qmailadmin$:.3.:C
.2configure
make
make install$strip
3D. 3n1tall S0uirrelmail %?e @a1ed #mail Che)king':
cd 2usr2local2src
wget http:22garr.dl.sourceforge.net2pro(ect2squirrelmail2stale2:.F.332squirrelmail$wemail$
:.F.33.tar.g8
tar +fv8 squirrelmail$wemail$:.F.33.tar.g8
mv squirrelmail$wemail$:.F.33 2var2www2html
cd 2var2www2html
mv squirrelmail$wemail$:.F.33 squirrelmail
cd squirrelmail
config2conf.pl
?onfigure squirrelmail as necessary.
mkdir $p 2var2local2squirrelmail2data2
mkdir $p 2var2local2squirrelmail2attach2
To test your squirrelmail installation, go to http:22mail.teo$en$
ming.com:@4@42squirrelmail2src2configtest.php
N cronta $e
F4 J J J J 2usr2local2share2sqwemail2cleancache.pl 3M&: M 2dev2null
chmod $> EDD 2var2www2html2squirrelmail
chmod $> a<r+ 2usr2local2share2sqwemail
3C. Adding $A re)ord1 to *BS 1erver:

Das könnte Ihnen auch gefallen