Sorry, this is postfix on an Ubuntu 16.04 (yes I know, old kernel) server. Postfix is version 3.1.0. I think it's using pcre (php) in the background.
So in the main.cf I have:
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
In the sender_canonical file, I have (currently):
/^.*@domain\.net/
photocopier@domain.net
This works just fine for changing the sender address on anything that comes in using a domain.net sender address. The issue is that if the sender is
this.secure@domain.net, it gets changed to
photocopier@domain.net.
That is the format of the file (as far as I can tell from reading man pages):
/reg exp/ <tab> new sender address