Hello,

I'm trying to configure DSPAM as a spam filter on my home FreeBSD 7 box
already having Postfix and Cyrus IMAP up and running:
--> Postfix Postfix --> Cyrus IMAP as mailbox_transport
      \->LMTP-> DSPAM ->SMTP-^
Looks like my configuration, except I use maildrop and Courier.
As for postfix-dspam setup I now use it like this:

smtpd_recipient_restrictions =
...
check_client_access pcre:/usr/local/etc/postfix/dspamd_filter_access,
.....

$ cat /usr/local/etc/postfix/dspamd_filter_access
/./   FILTER lmtp:[127.0.0.1]:24

My problem is that I cannot make DSPAM handle messages properly -
there is no dspam-related headers appearing in my emails. But there
are dspam piping messages in logs (for the second configuration).

1. Use dspam as a daemon:
echo 'dspam_enable="YES"' >> /etc/rc.conf.local
2. Enable debugging
echo 'dspam_debug="YES"' >> /etc/rc.conf.local
3. Turn on debugging in /usr/local/etc/dspam.conf
(Debug / DebugOpt directives -- this assumes you chose DEBUG in OPTIONS
screen)

Restart your dspam instance:
/usr/local/etc/rc.d/dspam restart

Send an email message to your mailserver and take a look in
/var/log/dspam/dspam.debug

Post the relevant except from your mail log and your dspam.debug.


OK, now I did:

#grep dspam /etc/rc.conf
dspam_enable="YES"
dspam_debug="YES"

#cd /usr/local/etc/postfix
#cat filter_access
/./ FILTER lmtp:unix:/var/run/dspam.sock
#postmap /usr/local/etc/postfix/filter_access

#cat main.conf
      ...skipped...
smtpd_recipient_restrictions = permit_sasl_authenticated,
 permit_mynetworks,
 reject_unauth_pipelining,
 reject_non_fqdn_recipient,
 reject_unknown_recipient_domain,
 permit_sasl_authenticated,
 reject_unauth_destination,
 permit_auth_destination,
 reject_non_fqdn_hostname,
 reject_non_fqdn_sender,
 reject_invalid_hostname,
 hash:/usr/local/etc/postfix/access,
 check_client_access pcre:/usr/local/etc/postfix/filter_access
      ...skipped...

#grep -v ^# access
192.168.0.0/16  OK
127.0.0.1       OK

#cat master.conf
      ...skipped...
smtp      inet  n       -       n       -       -       smtpd
      ...skipped...
cyrus     unix  -       n       n       -       -       pipe
user=cyrus argv=/usr/local/cyrus/bin/deliver -r ${sender} -m $ {extension} ${user}
      ...skipped...
127.0.0.1:10027 inet  n -       n       -       -        smtpd
  -o content_filter=
  -o smtpd_authorized_xforward_hosts=127.0.0.0/8
  -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 receive_override_options =no_unknown_recipient_checks,no_header_body_checks
      ...skipped...

#cat ../dspam.conf
      ...skipped defaults...
Debug *
DebugOpt process classify spam fp
Opt out
DeliveryHost        127.0.0.1
DeliveryPort        10027
DeliveryIdent       MYDOMAIN.NAME.HERE
DeliveryProto       SMTP
Trust root
Trust mail
Trust mailnull
Trust smmsp
Trust daemon
Trust dspam # user fo dspam
Trust nobody
Preference "showFactors=on"
Preference "signatureLocation=headers"
Preference "spamAction=tag"
Preference "spamSubject=[SPAM]"
AllowOverride spamAction spamSubject
Broken case
Broken lineStripping
ServerPID              /var/run/dspam.pid
ServerMode      standard
ServerPass.Relay1       "secret123"
ServerParameters        "--deliver=innocent,spam"
ServerIdent             "MYDOMAIN.NAME.HERE"
ServerDomainSocketPath  "/var/run/dspam.sock"
ClientIdent     "[EMAIL PROTECTED]"
ClientHost      /var/run/dspam.sock
PgSQLServer     127.0.0.1
PgSQLPort       5432
PgSQLUser       dspam
PgSQLPass       changeme123
PgSQLDb         dspam
PgSQLConnectionCache    3
PgSQLUIDInSignature     on
      ...skipped defaults...
#/usr/local/etc/rc.d/dspam restart
#/usr/local/etc/rc.d/postfix reload

Now I sent an email to some account '[EMAIL PROTECTED]' and got this in logs:
#tail -f /var/log/maillog
Apr 1 15:39:20 erley postfix/smtpd[190]: connect from fg- out-1718.google.com[72.14.220.156] Apr 1 15:39:20 erley postfix/smtpd[190]: 7C29950C1: client=fg- out-1718.google.com[72.14.220.156] Apr 1 15:39:20 erley postfix/cleanup[193]: 7C29950C1: message-id=<[EMAIL PROTECTED] > Apr 1 15:39:20 erley postfix/qmgr[99814]: 7C29950C1: from=<[EMAIL PROTECTED] >, size=1923, nrcpt=1 (queue active) Apr 1 15:39:20 erley postfix/pipe[195]: 7C29950C1: to=<[EMAIL PROTECTED] >, relay=cyrus, delay=0.35, delays=0.21/0.03/0/0.12, dsn=2.0.0, status=sent (delivered via cyrus service)
Apr  1 15:39:20 erley postfix/qmgr[99814]: 7C29950C1: removed
Apr 1 15:39:50 erley postfix/smtpd[190]: disconnect from fg- out-1718.google.com[72.14.220.156]

Nothing was logged in /var/log/dspam

Seems DSPAM didn't get that message via
  check_client_access pcre:/usr/local/etc/postfix/filter_access
thing.
BTW, I checked that DSPAM is compiled with debug features:
#dspam --version
...skipped...
Configuration parameters: --sysconfdir=/usr/local/etc --with-logdir=/ var/log/dspam --with-dspam-home=/var/db/dspam --with-dspam-home-owner=root --with- dspam-home-group=mail --with-dspam-home-mode=0770 --with-dspam-owner=root --with-dspam- group=mail --enable-syslog --enable-debug --enable-daemon --with-pgsql-includes=/usr/local/ include
 --with-pgsql-libraries=/usr/local/lib --with-storage-driver=pgsql_drv
--with-delivery-agent=/usr/local/cyrus/bin/deliver --with-dspam- mode=4510
 --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/
 --build=i386-portbld-freebsd7.0

So, finally email arrived without DSPAM headers, I'm still lost...

Have a nice day,
Alex

Reply via email to