Hello KumoMTA team, can you please suggest or point to the right documentation (if any). I want to add some custom header or parameter to the HTTP API, so users can choose which IP pool or specific IP from the pool will be used for email sends.
Is that possible? Thanks!
I might be wrong, but I don’t think you can do that using a header or HTTP API param - the egress pool is specified in make_queue_config which should be called from the get_queue_config event handler, and you don’t have access to the message in that context.
One approach people have used is to name their tenants with an embedded value, and then extract that in get_queue_config to use as the egress_pool name.
So a tenant named foo that wanted to use the bar egress pool could have their tenant name be foo-bar, and in get_queue_config you would break off the egress_pool name and use it.
Sorry @yearning-hyena can you give me some example please? Not sure if I’m following…Thanks
Use the queues helper, specify the header used for tenant name. Pass a header that concats tenant and egress_pool name around a delimiter. In your code for the handler of get_queue_config split the delimiter, put the egress_pool_name into the egress_pool setting for make_queue_config.
Wow, this is interesting! Let me try, many thanks!
And you split it based on the “tenant” passed to the get_queue_config event.
yeah, that’s what we decided to do. It’s clumsy, but it works
@nourishing-urial thanks! Any chance you can post your configs?
Hey @yearning-hyena To confirm, you can only specify the pool name int the header, or would you also be able to specify a particluar IP wihtin a POOL.
Example:
Pool Name = ABC_TEST << lets say this POOL has 10 IPs
Are we able to use a header specification to outline Pool = ABC_TEST and then further specify IP number within that pool?
Only pools get specified. IPs are round-robin within the pool with an option for weighted round-robin. If you want to specify an IP, make a pool that only has that IP.
got it!
Thanks @yearning-hyena