On Thu, Sep 25, 2025 at 03:27:14PM +0300, lists+postfix--- via Postfix-users 
wrote:

> master.cf:
> dx    unix  -       n       n       -       20      pipe
>   flags=Rq argv=/usr/local/bin/someprog ${sender} ${recipient}

Works as documented for me:

    $ postconf foo_destination_recipient_limit
    foo_destination_recipient_limit = 300

    $ postconf -Mf pickup/unix foo/unix
    pickup     unix  n       -       n       60      1       pickup
        -o content_filter=foo:
    foo        unix  -       n       n       -       -       pipe flags=Fq.
        user=nobody argv=/var/tmp/logcnt $sender $nexthop $recipient

    $ cat /var/tmp/logcnt
    #!/bin/sh
    exec /usr/bin/logger -p user.info "$1 $2 $#"

    $ </dev/null sendmail -f t...@log.ex -i rcpt{1..500}@t.ex
    $ grep t...@log.ex /var/log/messages
    Sep 25 23:46:22 amnesiac nobody[2257]: t...@log.ex t.ex 302
    Sep 25 23:46:22 amnesiac nobody[2258]: t...@log.ex t.ex 202

Logging shows a single delivery of the first 300 recipients, then
another for the next 200.  On the other handl when the recipient
domains are not all the same:

    $ </dev/null sendmail -f t...@log.ex -i rcpt{1..50}@t.ex{0..9}
    $ grep t...@log.ex /var/log/messages
    Sep 25 23:49:27 amnesiac nobody[2282]: t...@log.ex t.ex0 52
    Sep 25 23:49:27 amnesiac nobody[2283]: t...@log.ex t.ex1 52
    Sep 25 23:49:27 amnesiac nobody[2284]: t...@log.ex t.ex2 52
    Sep 25 23:49:27 amnesiac nobody[2286]: t...@log.ex t.ex3 52
    Sep 25 23:49:27 amnesiac nobody[2287]: t...@log.ex t.ex4 52
    Sep 25 23:49:27 amnesiac nobody[2288]: t...@log.ex t.ex5 52
    Sep 25 23:49:27 amnesiac nobody[2289]: t...@log.ex t.ex6 52
    Sep 25 23:49:27 amnesiac nobody[2290]: t...@log.ex t.ex7 52
    Sep 25 23:49:27 amnesiac nobody[2292]: t...@log.ex t.ex8 52
    Sep 25 23:49:27 amnesiac nobody[2293]: t...@log.ex t.ex9 52

That's because with "foo" as the content filter, the nexthop is taken
from the recipient domain.  To force a single nexthop, the content
filter should be "foo:dummy" or some other fixed nexthop value.

-- 
    Viktor.  🇺🇦 Слава Україні!
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to