I got this working -- in the midst of the different iterations, I had a mismatch in domains in sasl_passwd and relayhost_maps. Once those have been aligned, it's working as expected.
Thanks! On Wed, Nov 9, 2022 at 1:20 PM Bryan Arenal <b.are...@gmail.com> wrote: > > Hi there, > > I'm having issues with getting sender_dependent_relayhost_maps to work > (Rocky Linux 8, postfix v3.5.8). No matter what I try, it seems that > the sender_dependent_relayhost_maps is being ignored. > > Here's my main.cf: > > alias_database = hash:/etc/aliases > alias_maps = hash:/etc/aliases > command_directory = /usr/sbin > compatibility_level = 2 > daemon_directory = /usr/libexec/postfix > data_directory = /var/lib/postfix > debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin > ddd $daemon_directory/$process_name $process_id & sleep 5 > debug_peer_level = 2 > html_directory = no > inet_interfaces = localhost > inet_protocols = all > mail_owner = postfix > mailq_path = /usr/bin/mailq.postfix > manpage_directory = /usr/share/man > meta_directory = /etc/postfix > milter_default_action = accept > mydestination = $myhostname, localhost.$mydomain, localhost > newaliases_path = /usr/bin/newaliases.postfix > non_smtpd_milters = $smtpd_milters > queue_directory = /var/spool/postfix > readme_directory = /usr/share/doc/postfix/README_FILES > sample_directory = /usr/share/doc/postfix/samples > sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps > sendmail_path = /usr/sbin/sendmail.postfix > setgid_group = postdrop > shlib_directory = /usr/lib64/postfix > smtp_sasl_auth_enable = yes > smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd > smtp_sasl_security_options = noanonymous > smtp_sender_dependent_authentication = yes > smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt > smtp_tls_CApath = /etc/pki/tls/certs > smtp_tls_security_level = may > smtpd_milters = inet:localhost:8891 > smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem > smtpd_tls_key_file = /etc/pki/tls/private/postfix.key > smtpd_tls_security_level = may > unknown_local_recipient_reject_code = 550 > > Here's /etc/postfix/relayhost_maps: > > t...@example.com [smtp.office365.com]:587 > > And /etc/postfix/sasl_passwd: > > [smtp.office365.com]:587 t...@example.com:mypasswd > > Followed by running 'postmap' on each. /etc/postfix/relayhost_maps > and /etc/postfix/sasl_passwd are owned by root:root and are 600 (the > .db files are 644). Postfix is also then restarted. > > But if I do a 'echo |mailx -s "Test" -r "t...@example.com" > m...@example.com', it's delivered normally, seemingly ignoring the > smtp_sender_dependent_authentication directive and the mapping to send > through smtp.office365.com. Unless the way I'm testing isn't the > right way? I've tried so many different iterations but I'm at a loss > at this point. There's nothing in syslog that provides any leads. > > Any help would be GREATLY appreciated! > > Thank you!