On 2021-11-04 11:36, Wietse Venema wrote:
sru...@gemneye.org:
I am trying to re-write sender email address n...@host.some.domain to
be
name+host@other.domain.
In main.cf I have:
sender_canonical_classes = envelope_sender
sender_canonical_maps = pcre:/etc/postfix/generic-pcre
canonical_maps are recursive, as documented.
In /etc/postfix/generic-pcre I have:
/^(.*)@(\w+).([.\w]+)/ ${1}+${2}@other.domain
This is what smtp_generic_maps is intended to solve, and that mapping
is non-recursive (i.e. won't loop producing user+host+host...@host).
I originally had this in smtp_generic_maps, but that seemed to re-write
both sender and receiver email addresses and I only wanted to re-write
sender email addresses.
The above will loop because canonical maps are recursive, as
documented.
I mentioned in my original post that I don't think I understood
recursion as it applied to the canonical maps.
Thank You for the response.
Wietse