Nicolas JEAN:
Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
> Em 25/02/2022 11:39, Wietse Venema escreveu:
> > Nicolas JEAN:
> >> Tested: adding above randmap also 'supersedes' a local_transport_map
> >> containing the domain-matching "my.domain virtual:"...
> >>
> >> I don't understand how "my.domain :" and "my.domain virtual:" can have
> >> different results, isn't it only the left part that matches incoming
> >> emails' addresses? How would having ':' or 'virtual:' on the right side
> >> change the matching?
> > I suspect that you have garbage in your maps, such as non-ASCII
> > whitespace. Examine with
> >
> > LANG=C grep '[^[:print:]]' /etc/postfix/local_transport_map | od -cb
> >
> > postmap -s hash:/etc/postfix/local_transport_map | \
> > LANG=C grep '[^[:print:]]' | od -cb
> >
> > Have fun.
>
> Thanks for the tip. Spotting irregular characters isn't my strength,
> couldn't figure out the issue.
>
> I moved to using the randmap in sender_dependent_default_transport_maps,
> instead of transport_map.
> Which by definition can't collide with local domains (mydestination,
> virtual_mailbox_domains).
>
> This also removes the need to have a "local_transport_map", which
> duplicated the info from virtual_mailbox_domains.
Congratulations.
Yes, sender_dependent_default_transport_maps=randmap:{...}
will eliminate routing mistakes for local domains.
I was thinking of adding default_transport_maps, i.e. lookup by
destination instead of sender, for destinations that use the default
transport.
This idea generalizes to other address classes, with
{default,relay,local,virtual_mailbox}_transport_maps. I find it
hard to come up with compelling use cases other than those that
involve randmap (i.e. load balancing or load migration}. But maybe
that is sufficient.
Wietse