mxtransport setting for postfix does not work
I have server with postfix. Because google did not liked my IP address, I did used external SMTP server for delivering emails. I setup check_recipient_mx_access
and I know it worked "sometime ago". Unfortunately today I saw it no longer works.
main.cf
have following:
smtpd_sender_restrictions =
check_recipient_mx_access pcre:/etc/postfix/mxtransport
sender_dependent_relayhost_maps = hash:/etc/postfix.host/sender_relay
transport_maps = hash:/etc/postfix.host/transport
/etc/postfix.host/sender_relay
and /etc/postfix.host/transport
are empty.
/etc/postfix/mxtransport
are as follows:
/google\.com$/ FILTER smtp:[my.smtpd.com]:2500
/googlemail\.com$/ FILTER smtp:[my.smtpd.com]:2500
/protection\.outlook\.com$/ FILTER smtp:[my.smtpd.com]:2500
I tried several ways, but they not seems to work.
Solution 1:
Ok, mystery solved.
check_recipient_mx_access
works only if the email comes from SMTP, e.g. telnet on port 25.
If I use sendmail
or mailx
the message go directly in the queue (postdrop) and these checks seems to be skipped.