NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Dspam on NetBSD
Hi,
I really hope that someone can help me. I am having a problem with
dspam on NetBSD. This is really a low end system so I don't want to
even try spam assassin. It would be really good to have a working
spam filter because I am overwhelmed with spam.
I have been using settings that I found for postfix for a long time.
Since then I added procmail and have added many rules to
my .procmailrc. For the last year I have been also using dspam. I
still get over 500 spam emails a day. What I find the most amazing is
that if I look at my maillog it shows that postfix rejects over 90%
of the emails for one reason or another.
First, I am using the hash driver and I am using groups.
My dspam group:
antispam:shared,managed:*
Still, I can't see why it shouldn't work.
Here is my dspam config:
Home /var/dspam
DeliveryHost 127.0.0.1
DeliveryPort 2424
DeliveryIdent localhost
DeliveryProto SMTP
QuarantineAgent "/usr/local/bin/procmail -d spam"
OnFail unlearn
Trust root
Trust dspam
Trust apache
Trust mail
Trust mailnull
Trust smmsp
Trust daemon
Trust nobody
Trust postfix
Debug *
DebugOpt process spam fp
TrainingMode toe
TestConditionalTraining on
Feature noise
Feature whitelist
Feature tb=5
Algorithm graham burton
Tokenizer osb
PValue bcr
WebStats on
ImprobabilityDrive on
Preference "trainingMode=TOE" # { TOE | TUM | TEFT |
NOTRAIN } -> default:teft
Preference "spamAction=quarantine" # { quarantine | tag |
deliver } -> default:quarantine
Preference "spamSubject=[SPAM]" # { string } -> default:[SPAM]
Preference "statisticalSedation=5" # { 0 - 10 } -> default:0
Preference "enableBNR=on" # { on | off } -> default:off
Preference "enableWhitelist=on" # { on | off } -> default:on
Preference "signatureLocation=message" # { message | headers } ->
default:message
Preference "tagSpam=on" # { on | off }
Preference "tagNonspam=off" # { on | off }
Preference "showFactors=off" # { on | off } -> default:off
Preference "optIn=off" # { on | off }
Preference "optOut=off" # { on | off }
Preference "whitelistThreshold=10" # { Integer } -> default:10
Preference "makeCorpus=off" # { on | off } -> default:off
Preference "storeFragments=off" # { on | off } -> default:off
Preference "localStore=" # { on | off } ->
default:username
Preference "processorBias=on" # { on | off } -> default:on
Preference "fallbackDomain=off" # { on | off } -> default:off
Preference "trainPristine=off" # { on | off } -> default:off
Preference "optOutClamAV=off" # { on | off } -> default:off
Preference "ignoreRBLLookups=off" # { on | off } -> default:off
Preference "RBLInoculate=off" # { on | off } -> default:off
Preference "notifications=off" # { on | off } -> default:off
AllowOverride enableBNR
AllowOverride enableWhitelist
AllowOverride fallbackDomain
AllowOverride ignoreGroups
AllowOverride ignoreRBLLookups
AllowOverride localStore
AllowOverride makeCorpus
AllowOverride optIn
AllowOverride optOut
AllowOverride optOutClamAV
AllowOverride processorBias
AllowOverride RBLInoculate
AllowOverride showFactors
AllowOverride signatureLocation
AllowOverride spamAction
AllowOverride spamSubject
AllowOverride statisticalSedation
AllowOverride storeFragments
AllowOverride tagNonspam
AllowOverride tagSpam
AllowOverride trainPristine
AllowOverride trainingMode
AllowOverride whitelistThreshold
AllowOverride dailyQuarantineSummary
AllowOverride notifications
HashRecMax 98317
HashAutoExtend on
HashMaxExtents 0
HashExtentSize 49157
HashPctIncrease 10
HashMaxSeek 10
HashConnectionCache 10
ExtLookup off # Turns on/
off external lookup
# 'strict'
enforces both verify and map
# There are
plans to support both MySQL and Postgres.
# an
executable lookup program and its arguments.
# and
ExtLookupMode 'map' or 'strict'
Notifications off
TxtDirectory /var/dspam/txt
PurgeSignatures 14 # Stale signatures
PurgeNeutral 90 # Tokens with neutralish probabilities
PurgeUnused 90 # Unused tokens
PurgeHapaxes 30 # Tokens with less than 5 hits (hapaxes)
PurgeHits1S 15 # Tokens with only 1 spam hit
PurgeHits1I 15 # Tokens with only 1 innocent hit
LocalMX 127.0.0.1
SystemLog on
UserLog on
Opt out
ParseToHeaders on
ChangeModeOnParse on
ChangeUserOnParse full
MaxMessageSize 1048576
ServerQueueSize 32
ServerPID /var/run/dspam/dspam.pid
ServerMode auto
ServerParameters "--deliver=innocent"
ServerIdent "localhost.localdomain"
ServerDomainSocketPath "/var/dspam/dspam.sock"
ProcessorURLContext on
ProcessorBias on
StripRcptDomain off
GroupConfig /var/dspam/group
My postfix master.cf:
127.0.0.1:25 inet n - n - - smtpd
10.20.238.4:25 inet n - n - - smtpd
smtp inet n - n - - smtpd
-o content_filter=lmtp:unix:/var/dspam/dspam.sock
127.0.0.1:2424 inet n - - - - smtpd
-o content_filter=
-o
receive_override_options=no_unknown_recipient_checks,no_header_body_chec
ks
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o smtpd_authorized_xforward_hosts=127.0.0.0/8
-o syslog_name=postfix/dspam-out
dspam-retrain unix - n n - - pipe flags=XRu user=dspam argv=/usr/
local/bin/dspam-retrain-forward.pl
--debug=no
--client
--user antispam
--class=${nexthop}
--source=error
--full=yes
--headers-only=no
--bodies-only=yes
--first-only=no
--skip-first=no
--bin-dir=/usr/local/bin
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
I did the install via the pkgsrc. After the install I created a user
with ' cat 782081.emlx | dspam --mode=toe --process -deliver=stdout --
user antispam --client
Then I used a shell script to do corpus training:
#!/bin/sh
#
# The script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# It is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with backup module. If not, see <http://www.gnu.org/licenses/>.
# Author: Martin Wheldon
uid=$1
usage()
{
cat << EOM
USAGE: $0 user_id
EOM
}
# Check that we have a uid
if [ -z $uid ]; then
usage
exit 1
fi
# Configure the users preferences
dspam_admin change preference "$uid" "dailyQuarantineSummary" "off"
> /dev/null
if [ "$?" != "0" ]; then
echo "Unable to set dailyQuarantineSummary for $uid"
exit 1
fi
dspam_admin change preference "$uid" "enableBNR" "on"
if [ "$?" != "0" ]; then
echo "Unable to set enableBNR for $uid"
exit 1
fi
dspam_admin change preference "$uid" "enableWhitelist" "off"
if [ "$?" != "0" ]; then
echo "Unable to set enableWhitelist for $uid"
exit 1
fi
dspam_admin change preference "$uid" "fallbackDomain" "off"
if [ "$?" != "0" ]; then
echo "Unable to set fallbackDomain for $uid"
exit 1
fi
dspam_admin change preference "$uid" "ignoreGroups" "on"
if [ "$?" != "0" ]; then
echo "Unable to set ignoreGroups for $uid"
exit 1
fi
dspam_admin change preference "$uid" "ignoreRBLLookups" "on"
if [ "$?" != "0" ]; then
echo "Unable to set ignoreRBLLookups for $uid"
exit 1
fi
dspam_admin change preference "$uid" "makeCorpus" "off"
if [ "$?" != "0" ]; then
echo "Unable to set makeCorpus for $uid"
exit 1
fi
dspam_admin change preference "$uid" "optIn" "on"
if [ "$?" != "0" ]; then
echo "Unable to set optIn for $uid"
exit 1
fi
dspam_admin change preference "$uid" "optOut" "off"
if [ "$?" != "0" ]; then
echo "Unable to set optOut for $uid"
exit 1
fi
dspam_admin change preference "$uid" "optOutClamAV" "on"
if [ "$?" != "0" ]; then
echo "Unable to set optOutClamAV for $uid"
exit 1
fi
dspam_admin change preference "$uid" "processorBias" "off"
if [ "$?" != "0" ]; then
echo "Unable to set processorBias for $uid"
exit 1
fi
dspam_admin change preference "$uid" "showFactors" "off"
if [ "$?" != "0" ]; then
echo "Unable to set showFactors for $uid"
exit 1
fi
dspam_admin change preference "$uid" "signatureLocation" "headers"
if [ "$?" != "0" ]; then
echo "Unable to set signatureLocation for $uid"
exit 1
fi
dspam_admin change preference "$uid" "spamAction" "deliver"
if [ "$?" != "0" ]; then
echo "Unable to set spamAction for $uid"
exit 1
fi
dspam_admin change preference "$uid" "spamSubject" ""
if [ "$?" != "0" ]; then
echo "Unable to set spamSubject for $uid"
exit 1
fi
dspam_admin change preference "$uid" "statisticalSedation" "0"
if [ "$?" != "0" ]; then
echo "Unable to set statisticalSedation for $uid"
exit 1
fi
dspam_admin change preference "$uid" "storeFragments" "off"
if [ "$?" != "0" ]; then
echo "Unable to set storeFragments for $uid"
exit 1
fi
dspam_admin change preference "$uid" "tagNonspam" "off"
if [ "$?" != "0" ]; then
echo "Unable to set tagNonspam for $uid"
exit 1
fi
dspam_admin change preference "$uid" "tagSpam" "off"
if [ "$?" != "0" ]; then
echo "Unable to set tagSpam for $uid"
exit 1
fi
dspam_admin change preference "$uid" "trainingMode" "TOE"
if [ "$?" != "0" ]; then
echo "Unable to set trainingMode for $uid"
exit 1
fi
dspam_admin change preference "$uid" "trainPristine" "off"
if [ "$?" != "0" ]; then
echo "Unable to set enableWhitelist for $uid"
exit 1
fi
dspam_admin change preference "$uid" "whitelistThreshold" "9999999"
if [ "$?" != "0" ]; then
echo "Unable to set whitelistThreshold for $uid"
exit 1
fi
dspam_admin aggregate preference "$uid"
if [ "$?" != "0" ]; then
echo "Unable to set enableWhitelist for $uid"
exit 1
fi
# Train the user
dspam_train antispam --client dspam_training/spam/new dspam_training/
ham/new
What is interesting is that some of the files in /var/dspam/data/
antispam are not owned by dspam. It will process maybe one message.
Of course, this is easily fixed with 'chown -R dspam:dspam /var/dspam
Also, the data directory needs to have permissions set to rwxrwx---,
anything else it will work for a while, but then crash. This is
really hard for me understand, why it would work at all. And if I
don't run cssclean then it will crash after a short time. With this
dspam is stable, however it does fill my /var partition. After /var
is full, then named core dumps and shortly after that the system
crashes. I had major problems for about 2 days just recently and I
took dspam out of my config for a while. But because the amount of
spam that I am getting I put it back in. What doesn't work is
retraining. If I run dspam to retrain it works at first, but only
with spam, anything that was a false positive will not retrain. Then
it core dumps, or the main process stops. It gives me an error
'misconfigured' when I run dspamc to retrain. I read through some old
emails and it looks like there are people using dspam on NetBSD.
Could someone lend some info on how and what they are doing to retrain?
Kind Regards,
Al
Home |
Main Index |
Thread Index |
Old Index