Score:0

postfix transport and / or mxtransport is not trigerred if sending via sendmail

in flag

I have a postfix server with configured both transport_map and mxtransport that send via different SMTP server, if some criteria is present (yes, it checks for gmail/hotmail/live.com).

If I send via SMTP on 25 port, all works OK.

If I use sendmail executable (/usr/sbin/sendmail.postfix), the transport is not checked and trigerred.

I understand the reason why it does not trigger - mail go directly in the queue, but question is - is there a way to fix this?

I got lots of comments that transport_maps should work, then may be the problem is with mxtransport.

Here is how my files looks like:

main.cf

...
transport_maps              =   hash:/etc/postfix/transport
smtpd_sender_restrictions   =
        check_recipient_mx_access   pcre:/etc/postfix/mxtransport   ,
        check_sender_access     hash:/etc/postfix/sender_access
...

mxtransport

/google\.com$/          FILTER smtp:[mail.smtp.com]:8025
/googlemail\.com$/      FILTER smtp:[mail.smtp.com]:8025
/protection\.outlook\.com$/ FILTER smtp:[mail.smtp.com]:8025

mxtransport

domain1.com     smtp:mx.mail1.com
domain2.com     smtp:mx.mail2.com
jp flag
`transport_maps` works with `/usr/sbin/sendmail` too.
in flag
It does not. Will check and post again. I am with default version for CentOS 6 - is bit old. Could it be because of that?
jp flag
`transport_maps` are checked when the queue is processed, not at the moment of a message being injected into the queue. I don't think this behaviour of `postfix` has changed in the last two decades.
in flag
I am clarifying the question.
jp flag
I think you answered this question yourself already here https://serverfault.com/questions/1065595/mxtransport-setting-for-postfix-does-not-work/1065668#1065668 `smtpd_sender_restrictions` is checked only for incoming STMP connections.
in flag
yep. and seems is answered by me... point is how to work around it?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.