Directories:
/usr/local/bin
/usr/local/etc/mail/spamassassin
/usr/local/share/spamassassin
/var/db/spamassassin/
Files:
/usr/local/etc/rc.d/sa-spamd
/usr/local/etc/mail/spamassassin/local.cf
Spamassassin optimieren
Aus dem Alltag eines Sysadmin: SA-Update – Frische Instruktionen
Roaming Users
A quick guide to vpopmail with MySQL
$ ls -la /var/qmail/service/smtpd
-rwxr-xr-x 1 root qmail 164 Mar 11 2007 add-relayclient
drwxr-sr-x 2 root qmail 512 Mar 11 2007 env
drwxr-sr-x 5 root qmail 512 Mar 11 2007 log
-rwxr-xr-x 1 root qmail 517 Jun 2 11:51 run
drwx------ 2 root qmail 512 Jun 2 15:01 supervise
lrwxr-xr-x 1 root qmail 32 Mar 11 2007 tcp -> /usr/local/vpopmail/etc/tcp.smtp
lrwxr-xr-x 1 root qmail 36 Mar 11 2007 tcp.cdb -> /usr/local/vpopmail/etc/tcp.smtp.cdb
$ ls -la /usr/local/vpopmail/etc
-rw-r--r-- 1 vpopmail vchkpw 30 Mar 17 2007 inc_deps
-rw-r--r-- 1 vpopmail vchkpw 88 Mar 17 2007 lib_deps
-rw-r--r-- 1 vpopmail vchkpw 0 Mar 16 2007 open-smtp
-rw-r--r-- 1 vpopmail vchkpw 0 Mar 16 2007 open-smtp.lock
-r--r--r-- 1 vpopmail vchkpw 82 Mar 11 2007 tcp.smtp
-r--r--r-- 1 vpopmail vchkpw 26 Mar 11 2007 tcp.smtp-dist
-rw-r--r-- 1 vpopmail vchkpw 2162 Sep 30 19:40 tcp.smtp.cdb
-rw-r--r-- 1 vpopmail vchkpw 1107 Mar 11 2007 vlimits.default
-rw-r--r-- 1 vpopmail vchkpw 1107 Mar 17 2007 vlimits.default-dist
-rw-r----- 1 vpopmail vchkpw 843 Mar 17 2007 vpopmail.mysql
Hints
Fine-tuning SpamAssassin
Location of spamd log file?
$ fgrep spamd /var/log/maillog | less
Patches
Bug 6937 – 3.3.2 and Perl 5.18.0: Altering hash requires restarting loop else UNDEFINED behavior.
Spamassassin problem since upgrading Perl
Rules
/var/db/spamassassin/3.003002/updates_spamassassin_org/
Aktuelle SpamAssassin-Regeln von Heinlein Support
RCVD_IN_PBL
MIME_HTML_MOSTLY
Sep 30 14:13:54 te-clan spamd[16391]: spamd: processing message <007701cfdca4$9823e430$c86bac90$@XXX.ch> for vpopmail:89
Sep 30 14:13:56 te-clan spamd[16391]: spamd: identified spam (7.5/7.0) for vpopmail:89 in 1.6 seconds, 2697 bytes.
Sep 30 14:13:56 te-clan spamd[16391]: spamd: result: Y 7 - BAYES_20,DOS_OUTLOOK_TO_MX,FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,HTML_MESSAGE,MIME_HTML_MOSTLY,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_NONE scantime=1.6,size=2697,user=vpopmail,uid=89,required_score=7.0,rhost=localhost,raddr=127.0.0.1,rport=58348,mid=<007701cfdca4$9823e430$c86bac90$@XXX.ch>,bayes=0.055594,autolearn=no
X-Spam-Status Header
Forcing SpamAssassin To Add The X-Spam-Status Header To Ham For Debugging
IPv6
Nov 15 00:39:04 ns2 spamd[2138]: spamd: unauthorized connection from localhost [::1]:19467 to port 783, fd 5 at /usr/local/bin/spamd line 1603.
Nov 15 00:39:04 ns2 spamd[711]: prefork: child states: II
Installing and configuring Spamassassin
spamd: unauthorized connection from IP to port 783
[...]
- spamd_flags="-u vpopmail -A 127.0.0.1 -d -m4 -r ${spamd_pidfile}"
+ spamd_flags="-u vpopmail -A 127.0.0.1,::1 -d -m4 -r ${spamd_pidfile}"
[...]
$ sa-update
[Reboot]
$ fgrep spamd /var/log/maillog
[...]
Nov 15 21:49:25 ns2 spamd[750]: Can't locate Mail/SpamAssassin/CompiledRegexps/body_0.pm in @INC (you may need to install the Mail::SpamAssassin::CompiledRegexps::body_0 module) (@INC contains: /var/db/spamassassin/compiled/5.020/3.004001 /var/db/spamassassin/compiled/5.020/3.004001/auto /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/site_perl/mach/5.20 /usr/local/lib/perl5/5.20/mach /usr/local/lib/perl5/5.20 /usr/local/lib/perl5/site_perl/5.20 /usr/local/lib/perl5/site_perl/5.20/mach) at (eval 1083) line 1.
$ sa-compile
Nov 15 21:58:29.043 [1085] info: generic: base extraction starting. this can take a while...
Nov 15 21:58:29.044 [1085] info: generic: extracting from rules of type body_0
6% [========== ] 29.86 rules/sec 00m16s LEFT
zoom: rule __FOR_SALE_PRC_10K will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
15% [=========================== ] 32.63 rules/sec 00m13s LEFT
zoom: rule __PILL_PRICE_01 will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
26% [============================================= ] 22.85 rules/sec 00m13s LEFT
zoom: rule __FOR_SALE_PRC_100K will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
29% [=================================================== ] 29.08 rules/sec 00m12s LEFT
zoom: rule __FOR_SALE_NET will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
42% [========================================================================== ] 32.50 rules/sec 00m09s LEFT
zoom: rule __FOR_SALE_OBO will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
65% [================================================================================================================= ] 26.84 rules/sec 00m06s LEFT
zoom: rule __PILL_PRICE_02 will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
76% [===================================================================================================================================== ] 24.63 rules/sec 00m04s LEFT
zoom: rule __FOR_SALE_LTP will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
91% [============================================================================================================================================================== ] 28.43 rules/sec 00m01s LEFT
zoom: rule __LARGE_PERCENT_AFTER will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
98% [========================================================================================================================================================================== ] 32.95 rules/sec 00m00s LEFT
zoom: rule __FOR_SALE_PRC_1K will loop on SpamAssassin older than 3.3.2 running under Perl 5.12 or older, Bug 6558
100% [==============================================================================================================================================================================] 29.56 rules/sec 00m17s DONE
100% [============================================================================================================================================================================= ] 99.19 bases/sec 00m23s DONE
Nov 15 21:59:10.375 [1085] info: body_0: 1146 base strings extracted in 41 seconds
cd /tmp/.spamassassin1085z6fPDbtmp
reading bases_body_0.in
cd Mail-SpamAssassin-CompiledRegexps-body_0
re2c -i -b -o scanner1.c scanner1.re
re2c -i -b -o scanner2.c scanner2.re
re2c -i -b -o scanner3.c scanner3.re
re2c -i -b -o scanner4.c scanner4.re
re2c -i -b -o scanner5.c scanner5.re
re2c -i -b -o scanner6.c scanner6.re
/usr/local/bin/perl Makefile.PL PREFIX=/tmp/.spamassassin1085z6fPDbtmp/ignored INSTALLSITEARCH=/var/db/spamassassin/compiled/5.020/3.004001
Generating a Unix-style Makefile
Writing Makefile for Mail::SpamAssassin::CompiledRegexps::body_0
Writing MYMETA.yml and MYMETA.json
make
cp body_0.pm blib/lib/Mail/SpamAssassin/CompiledRegexps/body_0.pm
Running Mkbootstrap for Mail::SpamAssassin::CompiledRegexps::body_0 ()
chmod 644 body_0.bs
/usr/local/bin/perl /usr/local/lib/perl5/5.20/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.20/ExtUtils/typemap body_0.xs > body_0.xsc && mv body_0.xsc body_0.c
cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" body_0.c
cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" scanner1.c
cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" scanner2.c
cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" scanner3.c
cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" scanner4.c
cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" scanner5.c
cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" scanner6.c
rm -f blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
cc -shared -L/wrkdirs/usr/ports/lang/perl5.20/work/perl-5.20.3 -L/usr/local/lib/perl5/5.20/mach/CORE -Wl,-rpath=/usr/local/lib/perl5/5.20/mach/CORE -lperl -L/usr/local/lib -fstack-protector body_0.o scanner1.o scanner2.o scanner3.o scanner4.o scanner5.o scanner6.o -o blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
chmod 755 blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
/usr/local/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- body_0.bs blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.bs 644
Manifying blib/man3/Mail::SpamAssassin::CompiledRegexps::body_0.3
make install
Running Mkbootstrap for Mail::SpamAssassin::CompiledRegexps::body_0 ()
chmod 644 body_0.bs
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /var/db/spamassassin/compiled/5.020/3.004001/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
Installing /var/db/spamassassin/compiled/5.020/3.004001/Mail/SpamAssassin/CompiledRegexps/body_0.pm
Installing /tmp/.spamassassin1085z6fPDbtmp/ignored/lib/perl5/site_perl/man/man3/Mail::SpamAssassin::CompiledRegexps::body_0.3
Appending installation info to /tmp/.spamassassin1085z6fPDbtmp/ignored/lib/perl5/5.20/mach/perllocal.pod
cp /tmp/.spamassassin1085z6fPDbtmp/bases_body_0.pl /var/db/spamassassin/compiled/5.020/3.004001/bases_body_0.pl
cd /
rm -rf /tmp/.spamassassin1085z6fPDbtmp