Help Needed with Kumomta Source Grouping and Routing

Hi everyone,

I’m configuring Kumomta to route emails through specific VMTAs based on the recipient’s domain. Here’s my current setup:

cofiguration code is attached

Goal:

mta1 & mta2 ➜ Gmail/Google Workspace
mta3 & mta4 ➜ Outlook/Hotmail
mta5 & mta6 ➜ Yahoo
mta7 to mta12 ➜ All other domains (fallback pool)
The emails aren’t consistently routing through the expected VMTAs. I’m looking for advice on ensuring that these rules are applied correctly and any insights into potential issues with the current setup.

Thanks in advance!
kumo_outbound.txt (2.29 KB)

There is no such event as get_outbound_source_group.

There is no such config scope as source_group.

Work from the docs instead of AI, it did you no favors.

there is no docs related to destination ESP based routing for pool, if i am missing something, could you please help me to navigate menu

That’s because it is in no way a best practice.

kumo.on(“smtp_server_message_received”, function(msg)
local rcpt_domain = msg:get(“recipient_domain”) or “”
rcpt_domain = rcpt_domain:lower()

kumo.log.info("Processing domain: " .. rcpt_domain)

local tenant
if rcpt_domain:match(“gmail%.com$”) or rcpt_domain:match(“googlemail%.com$”) then
tenant = “google”
elseif rcpt_domain:match(“outlook%.com$”) or rcpt_domain:match(“hotmail%.com$”) or rcpt_domain:match(“live%.com$”) then
tenant = “outlook”
elseif rcpt_domain:match(“yahoo%.com$”) or rcpt_domain:match(“ymail%.com$”) then
tenant = “yahoo”
else
tenant = “fallback”
end

msg:set_meta(“tenant”, tenant)
end)

i am using this function now

but it is not working now

this function giving me an error

Yeah I don’t know what’s at line 118 in your init.lua and you don’t follow the instructions for showing your files in the initial bot reply.

Aah look at that code.

I’m sorry, it is not a good use of my time to review code that was hallucinated by an AI.

It’s one thing when someone writes code, uses real functions, but has some kind of error.

Your code had so little connection to reality that the only solution would be to rewrite it for you, which I have no desire to do outside of a PS engagement, especially to help you do something that I already told you is not a good idea.

The only people I’ve ever seen pick an IP address based on destination provider are spammers.

actually i am not a good programmer but have the desire to use kumomta for better use and doing this destination based experiment for the case . sometimes any IP get temporary graylisted by the ESP so we can temporary switch the pool based on destination

TSA can suspend an IP that gets gray listed and the rest of the IPs in the pool will still work. You don’t need to switch pools.

but what if i want to use the same IP with other ESP , suppose yahoo are deferring the emails with any IP but the same IP can deliver to gmail so we can use that IP for gmail

TSA suspensions are only ever applied to the combination of egress_source and destination. If an IP suspends to gmail it still sends to Yahoo.

i have trying to split the pool based on recipient MX Details, is it possible

it is possible to split pool based on receiver MX ?

I do not understand your use case.

I’m also a PowerMTA guy, but I’ve got to say—KumoMTA’s structure is quite different, and honestly, a lot more flexible.

If you’re looking to route emails based on IPs or target specific providers like Gmail, check out /opt/kumomta/etc/policy/queues.toml.

In PowerMTA, you’d typically define an MTA or VMTA to control which IP or pool gets used. In KumoMTA, that concept is handled through tenants. Each tenant can be linked to an egress_pool, which can contain one or multiple IPs.

You can even define pools that are tuned for specific providers (like Gmail) and assign tenants accordingly.

Hope I explained that clearly—if I got anything wrong, I’m sure someone here will jump in and correct me!

Also don’t forget about :
/opt/kumomta/etc/sources.toml

where you can define your ips and pools