Hopefully I'm one step away from having this working :)
I have Postfix and DBMail working. I have set up a content_filter to
hand mail to dspam. I have told dspam to check the dbmail_aliases table
for users:
# dspam.conf ( bit of it )
MySQLVirtualTable dbmail.dbmail_aliases
MySQLVirtualUIDField deliver_to
MySQLVirtualUsernameField alias
When I restart everything and send mail to myself, I get:
--
Nov 7 09:27:59 [postfix/smtpd] connect from localhost[127.0.0.1]
Nov 7 09:27:59 [postfix/smtpd] NOQUEUE: filter: RCPT from
localhost[127.0.0.1]: <[EMAIL PROTECTED]>: Recipient address
triggers FILTER dspam:unix:/var/run/dspam/dspam.sock;
from=<[EMAIL PROTECTED]> to=<[EMAIL PROTECTED]>
proto=ESMTP helo=<[127.0.0.1]>
Nov 7 09:27:59 [postfix/smtpd] 5AD29B494E5: client=localhost[127.0.0.1]
Nov 7 09:27:59 [postfix/cleanup] 5AD29B494E5:
message-id=<[EMAIL PROTECTED]>
Nov 7 09:27:59 [postfix/qmgr] 5AD29B494E5:
from=<[EMAIL PROTECTED]>, size=586, nrcpt=1 (queue active)
Nov 7 09:27:59 [postfix/smtpd] disconnect from localhost[127.0.0.1]
Nov 7 09:27:59 [dspam] query error: Column 'deliver_to' cannot be null:
see sql.errors for more details
- Last output repeated twice -
Nov 7 09:27:59 [dspam] bailing on error -2
Nov 7 09:27:59 [dspam] received invalid result (! DSR_ISSPAM ||
DSR_INNOCENT) : -2
Nov 7 09:27:59 [dspam] query error: Column 'deliver_to' cannot be null:
see sql.errors for more details
Nov 7 09:27:59 [dspam] process_message returned error -2. delivering.
Nov 7 09:27:59 [postfix/smtpd] connect from localhost[127.0.0.1]
Nov 7 09:28:00 [postfix/smtpd] 04A68B4954D: client=localhost[127.0.0.1]
Nov 7 09:28:00 [postfix/cleanup] 04A68B4954D:
message-id=<[EMAIL PROTECTED]>
Nov 7 09:28:00 [postfix/qmgr] 04A68B4954D:
from=<[EMAIL PROTECTED]>, size=781, nrcpt=1 (queue active)
Nov 7 09:28:00 [postfix/smtpd] disconnect from localhost[127.0.0.1]
Nov 7 09:28:00 [postfix/lmtp] 5AD29B494E5:
to=<[EMAIL PROTECTED]>,
relay=dkasak.nusconsulting.com.au[/var/run/dspam/dspam.sock], delay=1.1,
delays=0.22/0.13/0.05/0.7, dsn=2.6.0, status=sent (250 2.6.0
<[EMAIL PROTECTED]> Message accepted for delivery)
Nov 7 09:28:00 [postfix/qmgr] 5AD29B494E5: removed
Nov 7 09:28:01 [postfix/lmtp] 04A68B4954D:
to=<[EMAIL PROTECTED]>, relay=127.0.0.1[127.0.0.1]:24,
delay=1.2, delays=0.37/0.21/0.02/0.6, dsn=2.0.0, status=sent (215
Recipient <[EMAIL PROTECTED]> OK)
Nov 7 09:28:01 [postfix/qmgr] 04A68B4954D: removed
--
The sql.errors file simply says:
[11/07/2006 09:27:59] 31279: Column 'deliver_to' cannot be null: insert
into dbmail.dbmail_aliases (deliver_to, alias) values(NULL, 'filter')
I realise that this isn't *strictly* a dbmail issue ( or at least I
think it's a problem with my dspam config ), but on the other hand, I'm
hoping someone else who has integrated spam with dbmail & postfix can
help out ... and the issue looks like it's related to the integration
part, as we're getting dspam to fetch data from dbmail's virtual user
table. So why is dspam trying to create a new record here?
In my postfix main.cf I have:
smtpd_recipient_restrictions =
reject_unauth_destination
check_recipient_access pcre:/etc/postfix/dspam_incoming
permit
... and /etc/postfix/dspam_incoming containts:
/./ FILTER dspam:unix:/var/run/dspam/dspam.sock
My full dspam.conf:
Home /var/spool/dspam
StorageDriver /usr/lib/libmysql_drv.so
DeliveryHost 127.0.0.1
DeliveryPort 10025
DeliveryIdent localhost
DeliveryProto SMTP
OnFail error
Trust root
Trust dspam
Trust apache
Trust mail
Trust mailnull
Trust smmsp
Trust daemon
Trust filter
TrainingMode teft
TestConditionalTraining on
Feature chained
Feature whitelist
Algorithm graham burton
PValue graham
Preference "spamAction=quarantine"
Preference "showFactors=off"
AllowOverride trainingMode
AllowOverride spamAction spamSubject
AllowOverride statisticalSedation
AllowOverride enableBNR
AllowOverride enableWhitelist
AllowOverride signatureLocation
AllowOverride showFactors
AllowOverride optIn optOut
AllowOverride whitelistThreshold
MySQLServer /var/run/mysqld/mysqld.sock
MySQLUser dspam
MySQLPass 1217686808104064
MySQLDb dspam
MySQLCompress true
MySQLCompress true
MySQLVirtualTable dbmail.dbmail_aliases
MySQLVirtualUIDField deliver_to
MySQLVirtualUsernameField alias
HashRecMax 98317
HashAutoExtend on
HashMaxExtents 0
HashExtentSize 49157
HashMaxSeek 100
HashConnectionCache 10
Notifications off
PurgeNeutral 90
LocalMX 127.0.0.1
SystemLog on
UserLog on
Opt out
ChangeUserOnParse full
ServerPID /var/run/dspam/dspam.pid
ServerMode auto
ServerParameters "--user filter --deliver=innocent"
ServerDomainSocketPath "/var/run/dspam/dspam.sock"
ProcessorBias on
Any help greatly appreciated.
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au