turning off Postfix bounce notices (was: unexpected protocol delivery_request_protocol)

> I am seeing the subjected error for a small percentage of messages, and
> then those message stay in the deferred queue.
> 
> from the log:
> postfix/local[1124]: warning: unexpected protocol delivery_request_protocol
> from private/bounce socket (expected: delivery_status_protocol)

There is some serverfault webpage that suggests replacing the
"bounce" service in master.cf with "discard". While this prevents
Postfix from sending bounces, it also causes the discard daemon to
log multiple warnings about protocol errors.

With Postfix 3.6 and later, this unsupported hack no longer works.
Postfix logs an "unexpected protocol delivery_request_protocol"
warning, and moves the message to the deferred queue.

For Postfix 2.3 and later, here are the offically supported
ways to disable bounces.

1) In your mail generating application, append NOTIFY=NEVER to each
   RCPT TO command.

2) When submitting mail through the Postfix SMTP server, use the
   smtpd_command_filter feature to inject NOTIFY=NEVER into the
   RCPT TO command, as described in
   https://www.postfix.org/postconf.5.html#smtpd_command_filter

    /etc/postfix/main.cf:
        smtpd_command_filter = pcre:/etc/postfix/command_filter

    /etc/postfix/command_filter:
        # Bounce-never mail sink.
        /^(RCPT\s+TO:\s*<.*>.*)\s+NOTIFY=\S+(.*)/     $1 NOTIFY=NEVER$2
        /^(RCPT\s+TO:.*)/                             $1 NOTIFY=NEVER

3) When submitting mail through the Postfix sendmail command line,
   specify "-N never" as described in
   https://www.postfix.org/sendmail.1.html

   -N dsn (default: 'delay, failure')
        Delivery status notification control. Specify either a
        comma-separated list with one or more of failure (send
        notification when delivery fails), delay (send notification
        when delivery is delayed), or success (send notification
        when the message is delivered); or specify never (don't
        send any notifications at all).

Hopefully this text will eventually end up in search engines and
will be referenced in howtos. 
 

 

<< Назад

Наверх