Send 100 email and then route to ses

Can you, please help me to set how to set only 100 mails needs to be delivered from kumo and other to be route to SES

Hey there @youthful-zorse, thanks for posting. Please read the “Troubleshooting” and “How to Ask for Help” buttons below. If you would like a 1:1 support session from the KumoMTA team, details are at the “Book a Support Session” button below.

like I want that only 100 email per day other to be routed to ses

Set up an egress source for SES, depending on your overall volume you could use weighting in the egress pool to send a small percentage over your IP and the rest to SES.

can you please share me some examples?

I have assigned the egress source to ses and all the rest but how can I can assign how much percentage to be send from that egress source??

basically I want to limit the egress source to delivery only 100 e-mail per day

Weighting is a ratio, so if you want to represent it as percentage, make the numbers add up to 100. Set the SES to weight=99 and the local IP to 1 and 1% will go through the local IP. To do 100 a day set the appropriate ratio based on the daily sound amount.

Doing it by count you would need to store a counter somewhere and add to it when the mail goes through.

ok so in the source.toml I just need to assign the weight with respect to ips

what if I don’t want to use the egress source how can that will implement

You would need to write Lua that writes to something like Redis to maintain a count and then change egress_source assigned once the daily limit is reached.

What Mike said.
It sounds like you need a cadence function which does not exist out-of-box. I would not be hard to write with Lua and Redis. In your smtp_message_received function, you can add a counter that increments in Redis ( or some other store) and then you can check it to make a decision.

EG: (not tested)
msgcount = conn:query(“GET”, “my-key”)
if msgcount <=100 then
msg:set_meta(“queue”,“MySES-SmartHost”)
end

or something like that