ip rotation

i need help on ip rotation where i can select the ip which i want to send mail

The practice of “ip rotation” is typically not a good idea. However, there is documentation in a few places that describe how to assign an ip (pool) specific to a message. The easiest way is with the queues helper

how can we configure the ip rotation like on random basis or on a specific basis

is there is any way to send mail from specific ip from ip sources

how expose ip like im unable to acess the api from outside of vps (its giving timeout error but working from vps )

local sources = {
[‘ip-1’] = {
source_address = ‘198.183.251.71’,
ehlo_domain = ‘mail1.xyz.com
},
[‘ip-2’] = {
source_address = ‘178.183.252.72’,
ehlo_domain = ‘mail2.xyz.com
},
[‘ip-3’] = {
source_address = ‘168.153.257.73’,
ehlo_domain = ‘mail3.xyz.com
},
[‘ip-4’] = {
source_address = ‘190.173.259.75’,
ehlo_domain = ‘mail4.xyz.com
},
[‘main-ip’] = {
source_address = ‘188.193.453.155’,
ehlo_domain = ‘mail.xyz.com
}
}

kumo.on(‘init’, function()
local pool = kumo.make_pool {
name = ‘rotating_pool’,
source_affinity = ‘random’
}

for name, config in pairs(sources) do
pool:add_source {
name = name,
source_address = config.source_address,
ehlo_domain = config.ehlo_domain
}
end
end)

kumo.on(‘route_message’, function(msg)

return msg:set_routing_domain(msg:from_domain())

:set_pool('rotating_pool')

end)

If you configure an MTA on a VPS you will likely have a bad time.

Also is that code produced by GPT? It has so many errors.

some help from there

I’d suggest you don’t. That code is so wrong I can’t even start to correct it. Follow the documentation.

pls share me the related resources it will be very helpful to me

Docs.KumoMTA.com start with the tutorial.

thanks

Assuming this is working and will close