Hi KumoMTA team,
Is there any options/configuration in KumoMTA to relay email to another SMTP server but with a condition which is by sender or by recipient?
For example in Postfix is like the transport_maps and sender_dependent_relayhost_maps
Conditional rerouting is pretty straightforward but it does require Lua. There is no simple mapping like Postfix has. The link you were on is probably the best one to follow.
Let say I configure one Postfix server as relay and bunch of Postfix SMTP cluster for the actual delivery cluster (will deliver the email to the recipient MX).
The relay job is just to receive email from client then transport/route it again to the SMTP cluster.
In the SMTP relay there is a config for the routing to which cluster email will be transported, for example:
// will route email with from domain @ example.com to cluster1 via SMTP port 2025 @example.com smtp:cluster1:2025
// will route email with rcpt domain @ gmail.com to cluster2 via SMTP port 2525 @gmail.com smtp:cluster2:2525
What I want to achieve is to replace the Postfix Relay with KumoMTA if KumoMTA can do the routing like I explain above, can specify a condition and can specify the destination using specified host, protocol and port
You can do this in Lua by writing a conditional based on the domain.
The following is not tested, just done “off the cuff” as I type here but…
local cluster2 = “[10.1.1.3]” — assuming this is the op address of “cluster2”
If mydomain == “example.com” then
msg:set_meta(“routing_domain”,cluster2)
end```
If you are interested in some hourly consulting I’m happy to look at your Postfix config and try to work it into a KumoMTA config but frankly, you are probably better to rethink your strategy. It sounds like you are trying to compensate for Postfix shortcomings.
Thank you, I appreciate the help and the offer, maybe I will just try to explore some more.
and yeah, maybe it’s true that I want to compensate for Postfix shortcomings, like I said, I kinda stuck with the old topology. If I want to change it, that mean I have to change everything.