Hello,
I am trying to get Dspam working on a Postfix system working as the
primary mail gateway for my domain. I have a working Postfix mail
gateway solution and am trying to integrate Dspam at the moment.
Some facts about the system:
OS: FreeBSD mailgateway.socruel.nu 6.2-RELEASE FreeBSD 6.2-RELEASE #0:
Mon Jan 29 10:49:35 CET 2007
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/MAILGATEWAY i386
Postfix version: 2.3.8 (from FreeBSD ports)
Dspam verion: 3.6.8 (from FreeBSD ports)
What I am trying to do is integrate Dspam running in daemon mode:
Postfix sends to Dspam with LMTP and Dspam sends back to Postfix by
SMTP.
[Postfix] (LMTP) -> [DSPAM] [Postfix] -> { Delivery
}
|___ (SMTP Reinjection) ____|
This is explained in the 'postfix.txt' and 'relay.txt' files which come
with the Dspam tar ball. Other resources I've looked at are
http://dspamwiki.expass.de/Installation/Postfix/RelayStepByStep,
http://forum.richard5.net/viewtopic.php?t=14 and
http://www.howtoforge.com/forums/showthread.php?t=103&highlight=dspam
The error I get when receiving e-mail from the internet is:
Mar 29 14:22:24 mailgateway.socruel.nu postfix/smtpd[72561]: connect
from smtp-vbr7.xs4all.nl[194.109.24.27]
Mar 29 14:22:24 mailgateway.socruel.nu postfix/smtpd[72561]: NOQUEUE:
filter: RCPT from smtp-vbr7.xs4all.nl[194.109.24.27]:
<smtp-vbr7.xs4all.nl[194.109.24.27]>: Client host triggers FILTER
dspam:dspam; from=<[EMAIL PROTECTED]> to=<[EMAIL PROTECTED]> proto=ESMTP
helo=<smtp-vbr7.xs4all.nl>
Mar 29 14:22:24 mailgateway.socruel.nu postgrey[679]: cleaning up old
logs...
Mar 29 14:22:25 mailgateway.socruel.nu postfix/smtpd[72561]: 8FD0233C0C:
client=smtp-vbr7.xs4all.nl[194.109.24.27]
Mar 29 14:22:25 mailgateway.socruel.nu postfix/cleanup[72564]:
8FD0233C0C:
message-id=<[EMAIL PROTECTED]>
Mar 29 14:22:25 mailgateway.socruel.nu postfix/qmgr[72531]: 8FD0233C0C:
from=<[EMAIL PROTECTED]>, size=993, nrcpt=1 (queue active)
Mar 29 14:22:25 mailgateway.socruel.nu postfix/qmgr[72531]: warning:
connect to transport dspam: Connection refused
Mar 29 14:22:25 mailgateway.socruel.nu postfix/smtpd[72561]: disconnect
from smtp-vbr7.xs4all.nl[194.109.24.27]
My postfix config:
'postconf -n' gives:
----
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases
body_checks = pcre:/usr/local/etc/postfix/body_checks.pcre
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 10
disable_vrfy_command = yes
header_checks = pcre:/usr/local/etc/postfix/header_checks.pcre
html_directory = no
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps =
local_transport = error:Local mail is disabled!
mail_owner = postfix
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 20480000
mydestination = mailgateway.$mydomain, localhost.$mydomain
mydomain = socruel.nu
myhostname = somehostname.xs4all.nl
mynetworks = 172.16.1.0/24, 172.16.0.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/local/bin/newaliases
proxy_interfaces = 213.84.247.136
queue_directory = /var/spool/postfix
readme_directory = no
relay_domains = $mydestination, hash:/usr/local/etc/postfix/relaydomains
relay_recipient_maps = hash:/usr/local/etc/postfix/relay_recipients
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtp_always_send_ehlo = yes
smtpd_banner = $myhostname NO UCE ESMTP
smtpd_client_restrictions =
smtpd_data_restrictions = reject_unauth_pipelining, permit
smtpd_error_sleep_time = 5
smtpd_hard_error_limit = 20
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions = reject_non_fqdn_sender,
reject_non_fqdn_recipient, reject_unknown_sender_domain,
reject_unknown_recipient_domain, permit_mynetworks,
reject_unauth_destination, check_recipient_access
pcre:/usr/local/etc/postfix/recipient_checks.pcre,
check_recipient_access hash:/usr/local/etc/postfix/recipient_checks,
check_helo_access pcre:/usr/local/etc/postfix/helo_checks.pcre,
check_helo_access hash:/usr/local/etc/postfix/helo_checks,
check_sender_access hash:/usr/local/etc/postfix/sender_checks,
check_client_access hash:/usr/local/etc/postfix/client_checks,
check_client_access
pcre:/usr/local/etc/postfix/dspam_filter_access.pcre,
reject_unauth_pipelining, reject_invalid_hostname,
reject_non_fqdn_hostname, check_policy_service
inet:127.0.0.1:10023 reject_rbl_client bl.spamcop.net,
reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client
list.dsbl.org, permit_mx_backup, permit
smtpd_sender_restrictions =
smtpd_soft_error_limit = 2
strict_rfc821_envelopes = yes
transport_maps = hash:/usr/local/etc/postfix/transport
unknown_address_reject_code = 554
unknown_client_reject_code = 554
unknown_hostname_reject_code = 554
unknown_local_recipient_reject_code = 450
virtual_mailbox_domains = $mydomain
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/vmailbox.cf
virtual_transport = lmtp:unix:/tmp/dspam.sock
----
My master.cf looks like:
----
#smtp inet n - y - - smtpd
pickup fifo n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr fifo n - y 300 1 qmgr
tlsmgr unix - - y 1000? 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
trace unix - - y - 0 bounce
verify unix - - y - 1 verify
flush unix n - y 1000? 0 flush
proxymap unix - - y - - proxymap
smtp unix - - y - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX
loops
relay unix - - y - - smtp
# -o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error 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
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
cyrus unix - n n - - pipe
user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension}
${user}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop
$recipient
# --------------------------------------------------------------------
# Dspam stuff
# --------------------------------------------------------------------
smtp inet n - n - - smtpd
-o content_filter=lmtp:unix:/tmp/dspam.sock
#
localhost:10026 inet n - 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
#
dspam-retrain unix - n n - 10 pipe
flags=Ru user=dspam argv=/usr/local/bin/dspam-retrain $nexthop $sender
$recipient
----
Last but not least my Dspam config:
----
Home /var/db/dspam
StorageDriver /usr/local/lib/libmysql_drv.so
DeliveryHost 127.0.0.1
DeliveryPort 10026
DeliveryIdent localhost
DeliveryProto SMTP
OnFail error
Trust root
Trust dspam
Trust www
Trust postfix
Debug *
DebugOpt process spam fp
TrainingMode teft
TestConditionalTraining on
Algorithm graham burton
PValue graham
MySQLServer /tmp/mysql.sock
#MySQLPort
MySQLUser dspam
MySQLPass 'mypassword'
MySQLDb dspam
MySQLCompress true
MySQLConnectionCache 10
MySQLUIDInSignature on
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
ParseToHeaders on
ChangeModeOnParse on
ChangeUserOnParse off
MaxMessageSize 20480000
ClamAVPort 3310
ClamAVHost 127.0.0.1
ClamAVResponse accept
ServerQueueSize 32
ServerPID /var/run/dspam.pid
ServerMode standard
ServerParameters "--deliver=innocent"
#ServerIdent "mailgateway.socruel.nu"
ServerIdent "localhost.socruel.nu"
ServerDomainSocketPath "/tmp/dspam.sock"
---
What I don't understand is that I don't have a 'dspam' transport
configured in master.cf, so why is the log referring to it?
Any feedback and or hints are appreciated.
MTIA.
Regards,
Lars.