In my main.cf I have
sender_dependent_default_transport_maps = tcp:localhost:6002

and in my master.cf I have:
10025      inet  n       -       n       -       -       smtpd
  -o syslog_name=postfix/10025
  -o content_filter=scan:[127.0.0.1]:11125
  -o receive_override_options=no_address_mappings
scan       unix  -       -       n       -       10      smtp
  -o syslog_name=postfix/scan
  -o smtp_send_xforward_command=yes
  -o disable_mime_output_conversion=yes
  -o smtp_generic_maps=
[127.0.0.1]:11126 inet n   -       n       -       10      smtpd
  -o syslog_name=postfix/11126
  -o content_filter=
  -o 
receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_milters
  -o smtpd_helo_restrictions=
  -o smtpd_client_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o mynetworks=127.0.0.0/8
  -o smtpd_authorized_xforward_hosts=127.0.0.0/8
microsoft365 unix -       -       n       -       10       smtp
  -o syslog_name=postfix/microsoft365
  -o smtp_sasl_auth_enable=yes
  -o smtp_sender_dependent_authentication=yes
  -o smtp_sasl_password_maps=tcp:localhost:6001
  -o smtp_sasl_security_options=noanonymous
  -o smtp_sasl_tls_security_options=noanonymous
  -o smtp_tls_security_level=encrypt

My content filter is on port 11125 and returns the email back into postfix on 
port 11126.
For the sender in question my sender_dependent_default_transport_maps returns 
microsoft365:[podxxxxx.outlook.com]:587

My understanding is that mail coming in on port 10025 should first go to the 
content_filter scan:[127.0.0.1]:11125, my filter should scan it, gets 
reinjected on port 11126, the the default_transport from the 
sender_dependent_default_transport_maps should use the microsoft365 transport.

When I have sender_dependent_default_transport_maps in main.cf my 
content_filter is never calls.  The mail comes in on port 10025 and goes 
straight to the microsoft365 transport.  Without the 
sender_dependent_default_transport_maps mail does hit my content_filter.


Am I not understanding how content_filter should work?

I tried to use sender_dependent_relayhost_maps and it did call my filter.  How 
do I chose different transports based on the relayhost?

Reply via email to