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. > 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. -- Regards, Jaroslaw Rafa r...@rafa.eu.org -- "In a million years, when kids go to school, they're gonna know: once there was a Hushpuppy, and she lived with her daddy in the Bathtub." _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org