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?

On Sat, Apr 19, 2025 at 12:13:52PM +0200, Matus UHLAR - fantomas via 
Postfix-users wrote:
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.

On 19.04.25 21:09, Viktor Dukhovni via Postfix-users wrote:
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.

wouldn't "recipient_canonical_classes=envelope_recipient" avoid this problem?

However with postsrs, the only addresses that are local and in SRS format should be rewritten so I wouldn't consider this an issue.

To rewrite envelope recipients, use "virtual_aliases", not
"recipient_canonical_maps".

are these 100% interchangeable?

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.

--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
I intend to live forever - so far so good.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to