On Sat, Dec 14, 2024 at 04:20:26PM +1000, Laura Steynes via Postfix-users wrote:

> I've noticed since implementing milter-regex that if there is an inbound
> message addressed to two addresses, that if one is caught by a milter-regex
> reject rule (stopping a html message to a system address which does some
> automation), but the other recipient being a normal addressee not caught by
> this rule, their copy of the message is also rejected.
> 
> I'm sure this is just the way milters work since it's pretty high level,
> but I'm wondering what if anything can be configured in postfix to reject
> the trapped address message but pass the non trapped address so postfix can
> accept it and process it like all other mail?
> 
> Since this is pre-queue? I am assuming this is the problem with the milter
> itself to resolve?

It is impossible (regardless of the MTA, Postfix, Exim, ...) in SMTP to
reject recipients based on message content, because the recipients are
processed (either accepted or rejected) first, before any of the message
content is received:

    S(erver): 220 server.example ESMTP Greetings and felicitations
    C(lient): EHLO client.example
           S: 250-server.example
              ...
              250-PIPELINING
              250 8BITMIME
           C: MAIL FROM:<margaret.thatcher@client.example>
              RCPT TO:<ronald.reagan@server.example>
              RCPT TO:<james.carter@server.example>
              DATA
           S: 250 OK
              250 OK
              250 OK
              354 Make my day
           C: From: Maggie <margaret.thatcher@client.example>
              To: Ronnie <ronald.reagan@server.example>
              Cc: Jimmy <james.carter@server.example>
              Subject: Stick it to Gorby

              Dear Ronnie and Jimmy,

              <message body>
              .
              QUIT
           S: 250 OK
              221 OK


The server's end of data response can only be 2XX (accept the message
for all recipients) or 5XX (reject the message for all recipients).
No other choices are available given the SMTP protocol.

A server could potentially **silently drop** (or perhaps quarantine) the
message for one of the purportedly accepted recipients (say Jimmy has no
interest to correspond with Maggie), but it impossible to reject Jimmy
as a recipient, with Maggie receiving a bounce to that effect from her
MTA.

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to