On 4/11/2023 1:34 PM, Roberto Carna via Postfix-users wrote:
Dear all, we have set up Postfix 3.4.14 in a Debian 10 host as a SMTP
relay server.

All of our hosts send mail alerts using our Postfix relay server,
using our main mail domain (suppose ourdomain1.com).

But we have realized that if we send messages using another domains
than ourdomain1.com, the messages reach the recipients in Gmail,
Hotmail and other public mail platforms.

Is there any way to adjust the configuration of our Postfix relay
server to define just one or at most two sending mail domains?

For example, we wanna enable two mail domains to send messages using
our Postfix relay server:

ourdomain1.com --> for production hosts
ourdomain2.com --> for testing hosts

Special thanks!!!
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


The safe way to do this is with SASL authentication, and reject_authenticated_sender_login_mismatch. This prevents any unauthorized sender address.
http://www.postfix.org/postconf.5.html#reject_authenticated_sender_login_mismatch


The broad-brush way is with a check_sender_access map. Something like:

smtpd_sender_restrictions =
  permit_auth_destination
  check_sender_access inline:{example1.com=OK, example2.com=OK}
  reject

Notes:
This depends on the default smtpd_delay_reject=yes. The permit_auth_destination allows incoming mail from unknown senders. The check_sender_access map allows your domains; any supported map type can be used, inline shown for simplicity. The final reject will reject any other mail, which should only be outgoing mail with a different sender address. Optional: add reject_unlisted_sender or reject_unverified_sender just above the final reject to minimally check for an existing sender address.
http://www.postfix.org/postconf.5.html#reject_unlisted_sender
http://www.postfix.org/postconf.5.html#reject_unverified_sender


  -- Noel Jones
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to