Noel Jones: > The problem is "some incoming mail". Postfix has no method to > selectively send some mail to the smtpd_proxy_filter, and pass > other mail through (or to a different proxy). > > Yes, it would be a good idea in this case to selectively proxy > messages to the external host, but it's not currently possible. > > You're stuck in a nasty position. Your best course of action is to > get the postmaster at the other server to whitelist you. > > If you have C programming skills, it might be possible to enhance > the existing smtpd_proxy_filter speed_adjust feature to select the > proxy based on some message property. I have no idea off-hand how > complex that might be.
You could try to repurpose the speed_adjust feature as follows: 1) A new function smtpd_proxy_control() to change a property of an existing proxy filter handle (such as the destination server host and port). This function be patterned after vstream_control() or any similar function in Postfix. 2) A new smtpd access(5) action (PROXY_FILTER host:port) that invokes the new function to change the destination server host and port. But that does not mean that it will work well. The proxy filter client does not implement TLS or SASL authentication. It is designed to be used with a local filter, not a remote SMTP server. It will not work when Postfix announces features such as SMTPUTF8 or DSN that the remote SMTP server does not implement. The remote SMTP server will reject MAIL FROM or RCPT TO commands that the Postfix SMTP server has already accepted. It will not work when the remote SMTP server rejects a recipient selectively. As documented with the speed_adjust feature, rejecting or accepting all recipients is OK. Selective recipient rejection cannot be supported with speed_adjust, because the Postfix SMTP eerver has already accepted the recipients. Wietse