Post by Noel Jones Post by Wietse Venema Post by Noel Jones
Please refer to the recent incredibly long and wandering thread on
postfix-users with subject: Need to clarfiy how to implement
spamtrap address checking & discard with before-queue filtering.
Is there any interest in a REJECT_ALL/REJECT_DAMMIT access action?
I thought the poster wanted to dicard, not reject?
Part of the discussion was that there is no convenient way to reject
all recipients of a message based on a single blacklist recipient,
Replying with "521", which results in automatic disconnect since
Postfix 2.6, would also prevent the mail from coming in. But no-one
would come up with that unless they are a Postfix veteran.
Post by Noel Jones
The alternative is to PREPEND a "X-RejectMe: Yes" header, then
REJECT that header in header_checks, which I suppose isn't all that bad.
He could not use DISCARD in the before-filter SMTP server, so we
offer a PREPEND solution instead. Exceptions and workarounds like
this make Postfix difficult to use: PREPEND works with before-filter
SMTP daemons, but DISCARD/REDIRECT/FILTER/HOLD not, SMTP-level
actions can differ per recipient, header/body_checks not.
Some limitations are fundamental; for example there is no robust
way to propagate FILTER, REDIRECT, HOLD, etc. through an SMTP-based
filter (passing them along in custom mail headers is not robust).
Some features require a great deal of implementation effort; for
example to implement DISCARD in a before-filter SMTP server one
would have to change the before-filter SMTP server's plumbing
on-the-fly to divert the remainder of a MAIL transaction to a null
output driver. This requires a major restructuring of the way that
the SMTP server writes a MAIL transaction to queue file, cleanup
daemon or proxy filter with proper constructors and destructors
that clean up when a transaction is canceled.