On Thu, Mar 21, 2024 at 03:20:23PM +0100, Matus UHLAR - fantomas via 
Postfix-users wrote:

> > Wietse Venema via Postfix-users:
> > > smtpd_discard_ehlo_keyword_address_maps =
> > >     cidr:{ {!10/8  silent-discard,dsn} }
> 
> On 23.02.24 11:12, Wietse Venema via Postfix-users wrote:
> > But that does not generalize to hosts with IPv4 and IPv6. In that case,
> > your approach will be more suitable.

Surely the generalisation is:

      smtpd_discard_ehlo_keyword_address_maps =
          cidr:{ 
            {if 0.0.0.0/0}
            # Private IPv4 addresses
            {!10.0.0.0/8  silent-discard,dsn}
            {!172.16.0.0/12  silent-discard,dsn}
            {!192.168.0.0/16  silent-discard,dsn}
            {endif}
            {if ::/0}
            # Unique local, site and link local IPv6 addresses
            {!fc00::/7  silent-discard,dsn}
            {!fe80::/9  silent-discard,dsn}
            {endif}
            }

Each set of negative rules can be constrained to its address family by
enclosing it in an if..endif block.

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

Reply via email to