KumoMTA configuration for relaying email to another SMTP server

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

I already search in the documentation page and the best I find is this one: https://docs.kumomta.com/userguide/policy/routing/

But in that documentation page there is no explanation how to config the by sender or by recipient in KumoMTA.

We’re not Postfix experts, it would be better if you laid out a use case rather than referring to an option name in another MTA.

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.

Here is the use case example:

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

I still can’t understand how to set the destination when following that documentation,

In the examples there is no configuration that match my need, which is to specify the destination host, protocol and port,

Is it even possible to achieve using KumoMTA and the Lua config?

Ok but why one router to a cluster? What problem are you solving by layering Postfix like that?

IDK how to explain this​:upside_down_face:

Maybe I can say that I’m stuck with old topology, layering postfix like that is to separate the receiver server and the sender server.

I’m interested in KumoMTA because of it’s capability to receive so many email so fast. Now I just need a way to route that email to the sender cluster

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```

That is pretty simplistic. You could turn that into a table lookup or regex map or some other larger mechanism.

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.:upside_down_face:

Keep in mind that with KumoMTA you would not need the layers at all, so you would be able to flatten the topology.

Yes, I do notice that when reading the KumoMTA documentation,

I’m quite interesting with the KumoMTA cluster architecture and topology, also how Kumo handle the source IP & Proxy.

I’ll keep that in mind, maybe for future references.