> On 11 Feb 2022, at 9:09 am, michael.osi...@siemens.com wrote:
> 
> What I have come up with is doing in /usr/local/etc/postfix/canonical:
>> @localhost @myhostname
> 
> I had to add the actual hostname since @$myhostname is not supported.
> My question: Is this the proper way to go with Postfix to mimic sendmail 
> behavior?

This has drawbacks, it disables recipient validation, by making all
recipients "exist" (match the canonical table).

If this is intended solely for locally generated messages (submitted
via the sendmail(1) CLI, rather than incoming via SMTP), then you
should restrict this setting to a cleanup instance that handles
only local submission.

That can be achieved elegantly via a multi-instance setup (see
null-client description in MULTI_INSTANCE_README), or just wedged
in by setting in master.cf:

        # Modified pickup
        pickup unix ...  pickup
          -o cleanup_service_name=cleanup_l

        # Additional cleanup entry for local mail via pickup(8)
        cleanup_l unix ... cleanup
          -o canonical_maps=$local_canonical_maps

and in main.cf:

        local_canonical_maps = ...

I think the multi-instance approach is saner.

-- 
        Viktor.

Reply via email to