15 msgHeader for message size?
3 msgaddress rewriting
2 msgaddress_verify_relayhost and relay_domains
5 msgpflogsumm reports
11 msgChanging Queue IDs
3 msganother authentication failure( with sasl)

Bypass Spam checks for certain destinations
\ Frodo Larik (19 Sep 2007)
. \ mouss (20 Sep 2007)

11 msgPostfix 'too nice' with content_filter
7 msgprofiling a milter (dkim in particular)
7 msgspammers tacking on headers how to block?
7 msg[Fwd: Re: RFC 821]
1 msgRe:
4 msg(No Subject)
2 msgRFC 821
7 msgSuspending mail delievery to a specific user
2 msgRe: OT - massive newsletter
12 msgList management issue: possibly Off Topic
2 msgbad protocol error Testing SASL configuration
2 msgwarning: smtpd_sasl_auth_enable is true, but SA...
1 msgQuota Problem
Subject:Bypass Spam checks for certain destinations
Group:Postfix-users
From:Frodo Larik
Date:19 Sep 2007


 
Hi all,

I'm using postfix with the following setup:

postfix -> dspam -> dbmail-smtp

This is working great, however I also have some domains which I want
to forward to other destinations (domains or email addresses). I
don't want to invoke dspam for those destinations which are not
located on my mailserver.

In my master.cf I have configured a dspam transport (I have not
content_filters):

dspam unix - n n - - pipe
flags=Ru user=dspam:dspam argv=/usr/bin/dspam --deliver=innocent
--user ${recipient}


In main.cf lookups go like this (complete main.cf at the end):

mailbox_transport = dbmail-lmtp:localhost:24
transport_maps = hash:/etc/postfix/transport
virtual_alias_maps = pgsql:/etc/postfix/sql-forwards.cfg
mydestination = pgsql:/etc/postfix/sql-mydestination.cfg

/etc/postfix/transport
spam dspam-retrain:spam
ham dspam-retrain:innocent

the sql-*.cfg files talk to a table which look likes this:
CREATE TABLE postfix_destinations
(
destination_id serial NOT NULL,
destination text NOT NULL, -- the domain
active boolean NOT NULL DEFAULT true,
"forward" boolean NOT NULL DEFAULT false, -- is this domain
getting forwarded
forward_to text, -- domain or email address
CONSTRAINT postfix_destinations_pkey PRIMARY KEY (destination_id),
)

/etc/postfix/sql-forwards.cfg
query = SELECT case when forward_to ~ '@' then forward_to else '%u@'
|| forward_to end from postfix_destinations WHERE active='t' and
forward='t' AND lower(destination)='%d'

pgsql:/etc/postfix/sql-mydestination.cfg
query = SELECT destination FROM postfix_destinations WHERE active='t'
AND lower(destination)='%s'

In smtpd_client_restrictions i have
check_client_access pcre:/etc/postfix/dspam_filter_access

where /etc/postfix/dspam_filter_access contains:
/./ FILTER dspam:dspam


Now when I (user) sent email to a destination
(user) which I want to forward to an external
destination (user), I get this in my logs:

Sep 20 00:09:34 pretpark postfix/smtpd[23448]: NOQUEUE: filter: RCPT
from sending.mailserver.domain[x.x.x.x]: <sending.mailserver.domain
[x.x.x.x]>: Client host triggers FILTER dspam:dspam;
from=<user> to=<user> proto=ESMTP
helo=<sending.mailserver.domain>
Sep 20 00:09:36 pretpark postfix/pipe[22948]: 65A1E14B8C00:
to=<user>, orig_to=<user>,
relay=dspam, delay=3.6, delays=2/0/0/1.5, dsn=5.3.0, status=bounced
(Command died with status 255: "/usr/bin/dspam")

This is obviously not the desired way. I don't want dspam to get
involved by postfix, but just let postfix send it to
user.

Two questions arise:

1. How can I actually forward the mail without invoking dspam?
2. Is my current setup ok, or did I made some mistakes in the setup
for forwarding domains?

Here is the output of my postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_destination_concurrency_limit = 20
default_process_limit = 100
disable_vrfy_command = yes
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps = pgsql:/etc/postfix/sql-recipients.cfg
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 51200000
mailbox_transport = dbmail-lmtp:localhost:24
message_size_limit = 51200000
mydestination = pgsql:/etc/postfix/sql-mydestination.cfg
myhostname = xxxxx
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_client_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject_rbl_client
combined.njabl.org, reject_rbl_client cbl.abuseat.org,
reject_rbl_client list.dsbl.org, reject_rbl_client
sbl.spamhaus.org, reject_rbl_client pbl.spamhaus.org,
reject_rbl_client ipwhois.rfc-ignorant.org,
check_client_access pcre:/etc/postfix/dspam_filter_access
smtpd_error_sleep_time = 60
smtpd_hard_error_limit = 10
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks, reject_unauth_pipelining,
reject_invalid_hostname, reject_unknown_sender_domain,
reject_unknown_recipient_domain, reject_non_fqdn_sender,
reject_non_fqdn_recipient, reject_unauth_destination,
reject_rbl_client combined.njabl.org, reject_rbl_client
cbl.abuseat.org, reject_rbl_client list.dsbl.org,
reject_rbl_client sbl.spamhaus.org, reject_rbl_client
pbl.spamhaus.org, reject_rbl_client ipwhois.rfc-ignorant.org
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_mynetworks, reject_rhsbl_sender
dsn.rfc-ignorant.org, permit_sasl_authenticated,
reject_sender_login_mismatch
smtpd_soft_error_limit = 60
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
virtual_alias_maps = pgsql:/etc/postfix/sql-forwards.cfg


Hope someone can help!

Sincerely,

Frodo Larik



© 2004-2008 readlist.com