On Sat, Apr 19, 2025 at 12:13:52PM +0200, Matus UHLAR - fantomas via Postfix-users wrote:
> On 18.04.25 22:00, Dmytro Alieksieiev via Postfix-users wrote: > > So you say it's better to do recipient_canonical_maps on incoming mail? > > How it will improve situation? SRS will still throw same error and > > Postfix still reply with 4xx, no? > > canonical_maps apply when postfix receives mail. > > Using recipient_canonical_maps on postfix instance that receives mail from > the internet is fine - this way you can check for valid SRS address when > receiving and can immediately refuse that mail. I recommend against "recipient_canonical_maps", it rewrites a subset of the message headers, (To/Cc or Resent-To/Resent-Cc), while in almost all cases one should really rewrite all address-valued headers or none. To rewrite envelope recipients, use "virtual_aliases", not "recipient_canonical_maps". > Using sender_canonical_maps is better when you send mail to the > internet, e.g. forward it - so mail recveived from internet will not > have sender rewritten, but any mail forwarded from your system with > remote sender address will. There is no dedicated equivaelnt mechanism to rewrite just envelope senders on input, but the combination of: sender_canonical_classes = envelope_sender sender_canonical_maps = ... is close enough. For header rewriting, use "canonical_maps", which consistently rewrites all headers. -- Viktor. _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org