Colin McKinnon via Postfix-users: > Hi, > > I want to provision load balancing for my relays. The catch is that > there is already some customized routing in place based on recipient > domain and large block lists. These are currently handled by a > transport map. > > I would prefer not to implement 2 layers of relays. If this were > implemented as a plugin which is told the recipient address it could > determine how the mail should be routed. But I need to ensure that I > don't create any loops - i.e. the routing decision is based on the > recipient AND where the email came from/via. > > The policy server (https://www.postfix.org/SMTPD_POLICY_README.html) > seems to be ideal for my requirements since I get both recipient_name > and helo_name, however the documentation only covers its use in the > context of 'smtpd_recipient_restrictions'. I tried provisioning using:
Unfortunately, check_policy_service is documented and supported only for smtpd_mumble_restrictions. transport_maps queries one or more (key, value) stores. Given one key, it returns one corresponding value (or not found, or error). A policy is different: iy takes a list of (key, value) pairs, and returns a list of (key, value) pairs or error. What you are looking for does not yet exist in Postfix: a routing policy that takes a list of (client, helo, sender, recipient, etc.) and that returns (transport, nexthop, maybe recipient). This is a use case that the other open-source MTA may handle better. If routing policy were implemented in Postfix, its precedence should be chosen carefully. For non-local deliveries, the (transport, nexthop) are determined from the envelope recipient with the current set of routing features, in descending precedence: transport_maps, sender_dependent_default_transport_maps, default_transport, sender_dependent_relayhost_maps, relayhost. We could place the routing policy last (i.,e. highest precedence), and feed it the (client, helo, sender, recipient, etc.) from the message, plus the (transport, nexthop) as determined with the above current set of routing features. Wietse _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org