Hi All,

I'm trying to configure DSPAM as a spam filter on my home FreeBSD box
already having Postfix and Cyrus IMAP up and running:

--> Postfix ->LMTP-> DSPAM ->SMTP-> Postfix --> Cyrus mailbox_transport

DSPAM is running daemonized listening on Unix socket.
The problem is that it works as if there is no DSPAM chain at all, i.e.
spam still comes to my mailbox! I guess there should be some subtle
config error. Here are my configs (domain name was replaced by
example.org):

-------dspam.conf--------
Home /var/db/dspam
StorageDriver /usr/local/lib/libpgsql_drv.so
DeliveryHost        127.0.0.1
DeliveryPort        10027
DeliveryIdent   example.org
DeliveryProto       SMTP
EnablePlusedDetail      on
QuarantineMailbox       +junk
OnFail error
Trust root
Trust mail
Trust mailnull
Trust smmsp
Trust daemon
Trust dspam
Trust cyrus
Trust nobody
Debug *
DebugOpt process classify spam fp
TrainingMode teft
TestConditionalTraining on
Feature chained
Feature whitelist
Algorithm graham burton
PValue graham
Preference "spamAction=quarantine"
Preference "signatureLocation=headers"
Preference "showFactors=off"
Preference "spamAction=tag"
Preference "spamSubject=[SPAM]"
AllowOverride trainingMode
AllowOverride spamAction spamSubject
AllowOverride statisticalSedation
AllowOverride enableBNR
AllowOverride enableWhitelist
AllowOverride signatureLocation
AllowOverride showFactors
AllowOverride optIn optOut
AllowOverride whitelistThreshold
PgSQLServer     127.0.0.1
PgSQLPort       5432
PgSQLUser       dspam
PgSQLPass       change123
PgSQLDb         dspam
PgSQLConnectionCache    15
PgSQLUIDInSignature     on
HashRecMax              98317
HashAutoExtend          on
HashMaxExtents          0
HashExtentSize          49157
HashMaxSeek             100
HashConnectionCache     15
Notifications   off
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
TrackSources spam
Broken case
Broken lineStripping
MaxMessageSize 100000
ServerQueueSize 32
ServerPID              /var/run/dspam.pid
ServerMode      standard
ServerPass.Relay1       "secret123"
ServerIdent             "example.org"
ServerParameters        "--deliver=innocent,spam -d %u"
ServerDomainSocketPath  "/var/run/dspam.sock"
ClientIdent     "[EMAIL PROTECTED]"
ClientHost      /var/run/dspam.sock
ProcessorBias on
-----------------------------------------------------------

---------------- postfix/main.conf -----------------
queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
mail_owner = postfix
default_privs = nobody
myhostname=example.org
mydomain=example.org
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain
local_recipient_maps = $alias_maps unix:passwd.byname
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.0.0/16 127.0.0.0/8
relayhost=smtp.myisp.org
in_flow_delay = 10
alias_maps = hash:/usr/local/etc/postfix/aliases
alias_database = hash:/usr/local/etc/postfix/aliases
mail_spool_directory = /var/mail
smtpd_banner = $myhostname ESMTP $mail_name
debug_peer_level = 2
debugger_command =
        PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
        echo where) | gdb $daemon_directory/$process_name $process_id
2>&1
        >$config_directory/$process_name.$process_id.log & sleep 5
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
setgid_group = maildrop
html_directory = no
manpage_directory = /usr/local/man
sample_directory = /usr/local/etc/postfix
readme_directory = no
smtp_generic_maps = hash:/usr/local/etc/postfix/generic
smtpd_helo_required = yes
enable_sasl_authentication = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
 permit_mynetworks,
 hash:/usr/local/etc/postfix/access,
 reject_unauth_destination,
 permit_auth_destination,
 check_policy_service inet:127.0.0.1:10023
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
mailbox_transport = cyrus
cyrus_destination_recipient_limit = 1
smtpd_client_restrictions = permit_mynetworks
recipient_delimiter = +
----------------------------------------------------------------

-------------- postfix/master.conf -------------------
smtp      inet  n       -       n       -       -       smtpd
        -o content_filter=lmtp:unix:/var/run/dspam.sock

...skipped...

cyrus     unix  -       n       n       -       -       pipe
  user=cyrus argv=/usr/local/cyrus/bin/deliver -r ${sender} -m
${extension} ${user}
127.0.0.1:10027 inet  n -       n       -       -        smtpd
  -o content_filter=
  -o local_recipient_maps=
  -o relay_recipient_maps=
  -o smtpd_restriction_classes=
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o mynetworks=127.0.0.0/8
  -o strict_rfc821_envelopes=yes
  -o smtpd_error_sleep_time=0
  -o smtpd_soft_error_limit=1001
  -o smtpd_hard_error_limit=1000
  -o
receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-------------------------------------------------------------

---------------- /var/log/maillog -------------------
...skipped ...
Apr 14 10:34:24 erley postfix/smtpd[97828]: connect from localhost[127.0.0.1]
Apr 14 10:34:24 erley postfix/smtpd[97828]: D177A6188: 
client=localhost[127.0.0.1]
Apr 14 10:34:24 erley postfix/cleanup[97819]: D177A6188: message-id=<[EMAIL 
PROTECTED]
chyouremployer.com>
Apr 14 10:34:25 erley postfix/qmgr[95495]: D177A6188: from=<[EMAIL PROTECTED]
com>, size=4216, nrcpt=1 (queue active)
Apr 14 10:34:25 erley postfix/smtpd[97828]: disconnect from localhost[127.0.0.1]
Apr 14 10:34:25 erley postfix/lmtp[97820]: D30FA615C: to=<[EMAIL PROTECTED]>, 
orig_to=<
[EMAIL PROTECTED]>, relay=example.org[/var/run/dspam.sock], delay=5.4, 
delays=0.14/0.03/0/5.2, dsn=
2.6.0, status=sent (250 2.6.0 <[EMAIL PROTECTED]> Message accepted for delivery)
Apr 14 10:34:25 erley postfix/qmgr[95495]: D30FA615C: removed
Apr 14 10:34:25 erley postfix/pipe[97830]: D177A6188: to=<[EMAIL PROTECTED]>,
relay=cyrus, delay=0.51, delays=0.31/0.03/0/0.17, dsn=2.0.0, status=sent
(delivered via cyrus service)
Apr 14 10:34:25 erley postfix/qmgr[95495]: D177A6188: removed

-----------------------------------------------------

As I understand, spam should be tagged and quarantined into 'junk' folder
on IMAP server. Of coarse I tried to learn DSPAM like this:
----------
for i in `ls -Sl /var/spool/imap/SPAM/*.`
do
  dspam --client --user [EMAIL PROTECTED] --source=error --class=spam < $i
done
for j in `ls -Sl /var/spool/imap/HAM/*.`
do
  dspam --client --user [EMAIL PROTECTED] --source=error --class=innocent < $j
done
----------
Any ideas what could be wrong above?
I spent my second weekend already trying to figure out what it could be.
It seems this configuration isn't very common - no maildrop or piping to
DSPAM used, but I'd like to make it work.

Thanks in advance,
Alex

Reply via email to