Hi,
We have an issue with integrating a spam filter into postfix. When a
mail enters the mail system a loop start between postfix and dspam. And
I don't know why the loop start because when the mail returns to postfix
(localhost:10026) we override mailbox_transport and the mail should be
delivered with the mailbox_command option (dovecot). What am I doing
wrong?
Thanks,
Martijn
part of the logs:
Jan 7 13:57:02 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
connect from localhost[127.0.0.1]
Jan 7 13:57:02 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
5C8C420A79: client=localhost[127.0.0.1]
Jan 7 13:57:02 chuck postfix-dspam/cleanup[8665]: [ID 197553
mail.info] 5C8C420A79:
message-id=<aanlkti=gvq95v3vp6z4jdmdjmb_q_nehotu_ro+rf...@mail.gmail.com>
Jan 7 13:57:02 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
disconnect from localhost[127.0.0.1]
Jan 7 13:57:02 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
5C8C420A79: from=<martijndemun...@gmail.com>, size=19021, nrcpt=1 (queue
active)
Jan 7 13:57:02 chuck postfix-dspam/pipe[8681]: [ID 197553 mail.info]
9A97E20A6F: to=<martijn_dspam.redknot...@chuck.redknot.nl>,
orig_to=<martijn_dspam.redknot.nl>, relay=dspam, delay=0.79,
delays=0.04/0/0/0.75, dsn=2.0.0, status=sent (delivered via dspam
service)
Jan 7 13:57:02 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
9A97E20A6F: removed
Jan 7 13:57:03 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
connect from localhost[127.0.0.1]
Jan 7 13:57:03 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
120E220A7E: client=localhost[127.0.0.1]
Jan 7 13:57:03 chuck postfix-dspam/cleanup[8665]: [ID 197553
mail.info] 120E220A7E:
message-id=<aanlkti=gvq95v3vp6z4jdmdjmb_q_nehotu_ro+rf...@mail.gmail.com>
Jan 7 13:57:03 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
disconnect from localhost[127.0.0.1]
Jan 7 13:57:03 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
120E220A7E: from=<martijndemun...@gmail.com>, size=19430, nrcpt=1 (queue
active)
Jan 7 13:57:03 chuck postfix-dspam/pipe[8667]: [ID 197553 mail.info]
5C8C420A79: to=<martijn_dspam.redknot...@chuck.redknot.nl>,
orig_to=<martijn_dspam.redknot.nl>, relay=dspam, delay=0.74,
delays=0.03/0.02/0/0.69, dsn=2.0.0, status=sent (delivered via dspam
service)
Jan 7 13:57:03 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
5C8C420A79: removed
Jan 7 13:57:03 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
connect from localhost[127.0.0.1]
Jan 7 13:57:03 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
DE3F120A83: client=localhost[127.0.0.1]
Jan 7 13:57:03 chuck postfix-dspam/cleanup[8665]: [ID 197553
mail.info] DE3F120A83:
message-id=<aanlkti=gvq95v3vp6z4jdmdjmb_q_nehotu_ro+rf...@mail.gmail.com>
Jan 7 13:57:03 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
disconnect from localhost[127.0.0.1]
Jan 7 13:57:03 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
DE3F120A83: from=<martijndemun...@gmail.com>, size=19839, nrcpt=1 (queue
active)
Jan 7 13:57:03 chuck postfix-dspam/pipe[8681]: [ID 197553 mail.info]
120E220A7E: to=<martijn_dspam.redknot...@chuck.redknot.nl>,
orig_to=<martijn_dspam.redknot.nl>, relay=dspam, delay=0.87,
delays=0.03/0.01/0/0.83, dsn=2.0.0, status=sent (delivered via dspam
service)
Jan 7 13:57:03 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
120E220A7E: removed
Jan 7 13:57:04 chuck postfix-dspam/smtpd[8660]: [ID 197553 mail.info]
disconnect from mail-gx0-f179.google.com[209.85.161.179]
Jan 7 13:57:04 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
connect from localhost[127.0.0.1]
Jan 7 13:57:04 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
B553F20A88: client=localhost[127.0.0.1]
Jan 7 13:57:04 chuck postfix-dspam/cleanup[8665]: [ID 197553
mail.info] B553F20A88:
message-id=<aanlkti=gvq95v3vp6z4jdmdjmb_q_nehotu_ro+rf...@mail.gmail.com>
Jan 7 13:57:04 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
disconnect from localhost[127.0.0.1]
Jan 7 13:57:04 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
B553F20A88: from=<martijndemun...@gmail.com>, size=20247, nrcpt=1 (queue
active)
Jan 7 13:57:04 chuck postfix-dspam/pipe[8667]: [ID 197553 mail.info]
DE3F120A83: to=<martijn_dspam.redknot...@chuck.redknot.nl>,
orig_to=<martijn_dspam.redknot.nl>, relay=dspam, delay=0.97,
delays=0.06/0/0/0.91, dsn=2.0.0, status=sent (delivered via dspam
service)
Jan 7 13:57:04 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
DE3F120A83: removed
Jan 7 13:57:05 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
connect from localhost[127.0.0.1]
Jan 7 13:57:05 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
8B60C20A8E: client=localhost[127.0.0.1]
Jan 7 13:57:05 chuck postfix-dspam/smtpd[8673]: [ID 197553 mail.info]
disconnect from localhost[127.0.0.1]
Jan 7 13:57:05 chuck postfix-dspam/pipe[8681]: [ID 197553 mail.info]
B553F20A88: to=<martijn_dspam.redknot...@chuck.redknot.nl>,
orig_to=<martijn_dspam.redknot.nl>, relay=dspam, delay=0.91,
delays=0.1/0/0/0.8, dsn=5.3.0, status=bounced (Command died with status
22: "/opt/redknot/bin/dspam")
Jan 7 13:57:05 chuck postfix-dspam/cleanup[8665]: [ID 197553
mail.info] 9ED8D20A91:
message-id=<20110107125705.9ed8d20...@chuck.redknot.nl>
Jan 7 13:57:05 chuck postfix-dspam/bounce[8940]: [ID 197553 mail.info]
B553F20A88: sender non-delivery notification: 9ED8D20A91
Jan 7 13:57:05 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
9ED8D20A91: from=<>, size=22173, nrcpt=1 (queue active)
Jan 7 13:57:05 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
B553F20A88: removed
Jan 7 13:57:06 chuck postfix-dspam/smtp[8941]: [ID 197553 mail.info]
9ED8D20A91: to=<martijndemun...@gmail.com>,
relay=gmail-smtp-in.l.google.com[74.125.77.27]:25, delay=0.7,
delays=0.03/0.05/0.04/0.58, dsn=2.0.0, status=sent (250 2.0.0 OK
1294405026 k50si6972956eei.97)
Jan 7 13:57:06 chuck postfix-dspam/qmgr[8581]: [ID 197553 mail.info]
9ED8D20A91: removed
postconf -n output:
address_verify_map = btree:${data_directory}/verify
alias_maps = dbm:/etc/opt/redknot/postfix/aliases
config_directory = /etc/opt/redknot/postfix-dspam/
data_directory = /opt/redknot/var/lib/postfix-dspam
disable_vrfy_command = yes
home_mailbox = Maildir/
inet_interfaces = testmx.dspam.redknot.nl
mailbox_command = /opt/redknot/libexec/dovecot/deliver -a "$RECIPIENT"
-m "$EXTENSION" -s
mailbox_transport = dspam
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = chuck.redknot.nl
myhostname = chuck.redknot.nl
queue_directory = /opt/redknot/var/spool/postfix-dspam
recipient_delimiter = +
relay_domains = $mydestination,
dbm:/etc/opt/redknot/postfix/relaydomains,
dbm:/etc/opt/redknot/postfix/relaydomains-mailman
smtpd_banner = $myhostname ESMTP
smtpd_data_restrictions = reject_unauth_pipelining, permit
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_recipient_restrictions = reject_non_fqdn_helo_hostname,
reject_non_fqdn_sender, reject_non_fqdn_recipient,
reject_unknown_sender_domain, reject_unknown_recipient_domain,
reject_unauth_destination, reject_rbl_client virbl.dnsbl.bit.nl,
permit
smtpd_tls_cert_file = /etc/opt/redknot/ssl/chuck.redknot.nl.cer
smtpd_tls_key_file = /etc/opt/redknot/ssl/chuck.redknot.nl.key
smtpd_use_tls = yes
soft_bounce = no
strict_rfc821_envelopes = yes
syslog_name = postfix-dspam
transport_maps =
dbm:/etc/opt/redknot/postfix/transport,dbm:/etc/opt/redknot/postfix/transport-mailman
unknown_address_reject_code = 550
unknown_hostname_reject_code = 550
unknown_local_recipient_reject_code = 550
unverified_recipient_reject_code = 550
virtual_alias_maps =
dbm:/etc/opt/redknot/postfix/virtual,dbm:/etc/opt/redknot/postfix/virtual-mailman
relevant parts in master.cf:
### dspam content filter
dspam unix - n n - 10 pipe
flags=Rhqu user=dspam argv=/opt/redknot/bin/dspam --client
--deliver=innocent,spam --user ${mailbox} --mode=tum
--mail-from=${sender}
### mail returning from dspam
localhost:10026 inet n - n - 10 smtpd
-o smtpd_proxy_filter=
-o mailbox_transport=
-o alias_maps=
-o
receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_milters
-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