On Mon, Jul 03, 2023 at 10:07:55PM +0000, Israel britto via Postfix-users wrote:

> How can I delete all mailer-daemon messages from my mail server?

By not accepting mail for non-existent recipients.  With working
recipient validation on input, you can ignore the trickle of bounces
that might now and then happen for some other reason.

It is not a good idea to delete all bounces, some might be legitimate
reports of non-delivery of inadvertently mistyped addresses.

You've been warned!  With that, the below will delete deferred bounces
that have lingered in the queue for at least 4 hours:

    # postqueue -j |
        jq -r '
            select(.queue_name == "deferred" and
                   (.queue_id | test("^\\w+$")) and
                   (.sender == "" or .sender == "<>") and
                   .arrival_time < now - 14400)
            | .queue_id' |
      postsuper -d - deferred

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to