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.
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
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
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
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!