On 2023/12/5 21:13, Jaroslaw Rafa via Postfix-users wrote:
Dnia 5.12.2023 o godz. 20:14:45 Cowbay via Postfix-users pisze:
I want this mail server to relay mails for specific domains only and
all the mails are relayed to another mail server ($relayhost
configured in main.cf).
I found that there is no $sendmail_relay_restrictions configuration
like what $smtpd_relay_restrictions does, so the $relay_domains is
useless for sendmail.
Relaying, by definition, occurs only when mail is coming in via SMTP and is
not delivered locally, but re-sent to another server.
When mail is generated locally via sendmail and sent out, there is no
relaying. Your server is the originating server for the message.
It's the other server, configured as $relayhost, that is doing the relaying.
So if you want to configure any relay restrictions, you should do it on that
other server, not on the originating one.
Thank you very much to correct me.
How to reject the unwanted destination domains when users use the
sendmail command ?
Use non_smtpd_milters= with a proper milter. You can use for example
milter-regex ( https://www.benzedrine.ch/milter-regex.html ) and specify
proper "accept envrcpt" rules in the configuration for domains you want to
accept as recipients, and "reject" anything else by default.
I downloaded and built the milter-regex. It's cool and it satisfy my needs.
Thank you very much.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org