Hello,
Thank you for your explications guys, it cleared up lots of Postfix
internals for me...
here is a reordered (and slighlty modified) list of restrictions:
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks
reject_unauth_destination
check_client_access pcre:/$path/filter_access
reject_non_fqdn_sender
reject_non_fqdn_recipient
reject_invalid_hostname
reject_non_fqdn_hostname
reject_unknown_sender_domain
I did all modifications and now Postfix main.conf looks this way:
---------begin---------
#postconf -n
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
default_privs = nobody
disable_vrfy_command = yes
html_directory = no
in_flow_delay = 10
inet_interfaces = all
local_recipient_maps = $alias_maps unix:passwd.byname
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_transport = cyrus
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, localhost.$mydomain, $mydomain
mydomain = MYDOMAIN.NAME.HERE
myhostname = mail.MYDOMAIN.NAME.HERE
mynetworks = 192.168.0.0/16 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
relayhost = smtp.free.fr
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
show_user_unknown_table_name = no
smtp_always_send_ehlo = yes
smtp_generic_maps = hash:/usr/local/etc/postfix/generic
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_etrn_restrictions = reject
smtpd_hard_error_limit = 8
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks, reject_unauth_destination, check_client_access
pcre:/usr/local/etc/postfix/filter_access reject_non_fqdn_sender,
reject_non_fqdn_recipient, reject_invalid_hostname,
reject_non_fqdn_hostname, reject_unknown_sender_domain
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
strict_rfc821_envelopes = yes
unknown_local_recipient_reject_code = 550
--------- end ---------
And dspam.conf is:
----------begin----------
Home /var/db/dspam
StorageDriver /usr/local/lib/libpgsql_drv.so
DeliveryHost 127.0.0.1
DeliveryPort 10027
DeliveryIdent MYDOMAIN.NAME.HERE
DeliveryProto SMTP
EnablePlusedDetail off
QuarantineMailbox +junk
OnFail error
Trust root
Trust mail
Trust mailnull
Trust smmsp
Trust daemon
Trust dspam
Trust nobody
Debug *
DebugOpt process classify spam fp
TrainingMode teft
TestConditionalTraining on
Feature whitelist
Algorithm graham burton
PValue graham
ImprobabilityDrive on
Preference "showFactors=on"
Preference "signatureLocation=headers"
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 changeme123
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"
ServerParameters "--deliver=innocent,spam"
ServerIdent "MYDOMAIN.NAME.HERE"
ServerDomainSocketPath "/var/run/dspam.sock"
ClientIdent "[EMAIL PROTECTED]"
ClientHost /var/run/dspam.sock
ProcessorBias on
---------- end ----------
Now when I try to send an email, it gets to DSPAM:
------------begin--------------
#tail-f /var/log/maillog
Apr 2 23:03:13 erley postfix/smtpd[83292]: connect from fk-
out-0910.google.com[209.85.128.187]
Apr 2 23:03:14 erley postfix/smtpd[83292]: NOQUEUE: filter: RCPT from
fk-out-0910.google.com[209.85.128.187]: <fk-
out-0910.google.com[209.85.128.187]>: Client host triggers FILTER
lmtp:unix:/var/run/dspam.sock; from=<[EMAIL PROTECTED]> to=<[EMAIL PROTECTED]
> proto=ESMTP helo=<fk-out-0910.google.com>
Apr 2 23:03:14 erley postfix/smtpd[83292]: 288DF5169: client=fk-
out-0910.google.com[209.85.128.187]
Apr 2 23:03:14 erley postfix/cleanup[84340]: 288DF5169: message-id=<[EMAIL PROTECTED]
>
Apr 2 23:03:14 erley postfix/qmgr[82973]: 288DF5169: from=<[EMAIL PROTECTED]
>, size=1925, nrcpt=1 (queue active)
Apr 2 23:03:14 erley dspam[84319]: bailing on error -2
Apr 2 23:03:14 erley dspam[84319]: received invalid result (!
DSR_ISSPAM || DSR_INNOCENT) : -2
Apr 2 23:03:14 erley dspam[84319]: process_message returned error
-2. delivering.
Apr 2 23:03:14 erley postfix/smtpd[84343]: connect from
localhost[127.0.0.1]
Apr 2 23:03:14 erley postfix/smtpd[84343]: A96215171:
client=localhost[127.0.0.1]
Apr 2 23:03:14 erley postfix/cleanup[84340]: A96215171: message-id=<[EMAIL PROTECTED]
>
Apr 2 23:03:14 erley postfix/qmgr[82973]: A96215171: from=<[EMAIL PROTECTED]
>, size=2113, nrcpt=1 (queue active)
Apr 2 23:03:15 erley postfix/smtpd[84343]: disconnect from
localhost[127.0.0.1]
Apr 2 23:03:15 erley postfix/lmtp[84342]: 288DF5169: to=<[EMAIL PROTECTED]
>, relay=mail.MYDOMAIN.NAME.HERE[/var/run/dspam.sock], delay=0.97,
delays=0.21/0.03/0/0.72, dsn=2.6.0, status=sent (250 2.6.0 <[EMAIL PROTECTED]
> Message accepted for delivery)
Apr 2 23:03:15 erley postfix/qmgr[82973]: 288DF5169: removed
Apr 2 23:03:15 erley postfix/pipe[84345]: A96215171: to=<[EMAIL PROTECTED]
>, relay=cyrus, delay=0.47, delays=0.31/0.03/0/0.12, dsn=2.0.0,
status=sent (delivered via cyrus service)
Apr 2 23:03:15 erley postfix/qmgr[82973]: A96215171: removed
Apr 2 23:03:44 erley postfix/smtpd[83292]: disconnect from fk-
out-0910.google.com[209.85.128.187]
------------- end ----------
And what's in dspam.debug ? ;-)
received invalid result (!DSR_ISSPAM || DSR_INNOCENT) : -2
It's strange, but there is nothing appears in dspam.debug except that:
----------
4732: [04/02/2008 23:41:32] attribute StorageDriver = /usr/local/lib/
libpgsql_drv.so
84732: [04/02/2008 23:41:32] attribute PgSQLServer = 127.0.0.1
84732: [04/02/2008 23:41:32] attribute PgSQLPort = 5432
84732: [04/02/2008 23:41:32] attribute PgSQLUser = dspam
84732: [04/02/2008 23:41:32] attribute PgSQLPass = changeme123
84732: [04/02/2008 23:41:32] attribute PgSQLDb = dspam
84732: [04/02/2008 23:41:32] attribute PgSQLConnectionCache = 15
84732: [04/02/2008 23:41:32] attribute PgSQLUIDInSignature = on
84732: [04/02/2008 23:41:32] attribute HashRecMax = 98317
84732: [04/02/2008 23:41:32] attribute HashAutoExtend = on
84732: [04/02/2008 23:41:32] attribute HashMaxExtents = 0
84732: [04/02/2008 23:41:32] attribute HashExtentSize = 49157
84732: [04/02/2008 23:41:32] attribute HashMaxSeek = 100
84732: [04/02/2008 23:41:32] attribute HashConnectionCache = 15
84732: [04/02/2008 23:41:32] attribute LocalMX = 127.0.0.1
84732: [04/02/2008 23:41:32] attribute ProcessorBias = on
----------
I've just recompiled DSPAM again with all DEBUG options on - no
effect...
I'll investigate it more...
Tell you that dspam can't classify the message; probably it can't
find (depending on your seup) the user 'test' or
'[EMAIL PROTECTED]' (actually an uid for it).
To debug this further I need more info from you.
Do you have an 'test' system user ?
Yes, I have the _real_ unix user 'test' and [EMAIL PROTECTED] is
a valid email address.
PS
I guess I'll try with something else like "mailbox_command" to see
what it gives...
Tell you about results soon
Have a nice day,
Alex