How to make bind of sender id and sender ip

Please help with the code for binding that only one sender is allowed to use that ip1 another sender2 cannot send from ip1

You are in complete control over IP assignments. If you read through the documentation, you will find that you can create a pool of 1 IP, and assign that one-pool IP to a single tenant that can be defined as the sender domain.

The TENANT_TO_POOL example here is exacxtly that scenario:

in this case do I need to use policy extra?

That is up to you.

You can do it in Lua or you can do it with helpers.

In sources.toml you can do :
[source.“ip-1”]
source_address = “10.0.0.1”
ehlo_domain = ‘mta1.examplecorp.com

[pool.“pool-1”]
[pool.“pool-1”.“ip-1”]

and in queues.toml: ()
tenant_header = “X-Tenant”

[tenant.‘mycustomersendingdomain.com’]
egress_pool = ‘pool-1’

It sounds like you need some deeper help with this, you may want to consider paying for some PS hours so we can properly help you get functional.

No, thank you for your help I am able to do this using lua, just one query how can create a counter for the number of emails relay per day. As, I want to stop if the number of emails per day is increased as per defined

Easiest is set a throttle that limits the hourly rate to a number that is the daily limit / 24.

ok got already done thanks

just one clarification needed

kumo.on(‘smtp_server_mail_from’, function(sender)
– Limit reception rate to 50/minute per unique sender
local throttle = kumo.make_throttle(
string.format(‘reception-rate-for-%s’, sender),
‘50/minute’
)
local result = throttle:throttle()
if result.throttled then
kumo.reject(451, ‘4.4.5 try again later’)
— I want to print the sender domain, which i tried but I am unable to print that any suggestion?
end
end)

I guess max_message_size is not working in the build : kcli 2024.11.08-d383b033

When I set the max_message_size to 0 bytes it’s showing an error, but when I set it 2 bytes then try to send e-mail it’s not through any error. However, in the log I can see the size:859bytes

Where did you set max_message_size?

As per the initial post reply ( and I know you know the drill) we can’t really help effectively unless you share your configs.

yeah I know the drill, I am using this at smtp listener

give me sometime to share the config

  kumo.start_esmtp_listener {
    listen = '0.0.0.0:587',
    tls_certificate = '/opt/kumomta/etc/tls/sa.crt',
    tls_private_key = '/opt/kumomta/etc/tls/ss.key',
    hostname = 'uat.kumo.mta',
    invalid_line_endings = 'Fix',
    relay_hosts = { '127.0.0.1', '10.4.0.0/16', '10.1.0.0/16' },
    **max_message_size = 1,**
    data_buffer_size = 3000,
    max_recipients_per_message = 1024,
    trace_headers = {
    -- this is the default: add the Received: header
    received_header = false,
    -- this is the default: add the supplemental header true if you want to add header_name "X-KumoRef" else false
    supplemental_header = false,
    -- this is the default: the name of the supplemental header
    header_name = 'X-KumoRef',
    -- names of additional meta data fields
    -- The default is not to add any meta data fields, but you might consider setting something like:
    -- include_meta_names = { 'tenant', 'campaign' },
    include_meta_names = {},
  },

build : kcli 2024.11.08-d383b033
OS : AML2

Apparently you are correct. Having now tested this to to the ludicrously low value of 3 bytes (which I believe is impossible just due to overhead) I can confirm that max_message_size is not valid under 3 bytes. In other words, if you set max_message_size = 10 it will reject any message larger than 10 bytes, but if you set it to 3 or smaller, it will behave as if the setting was not there at all.

I am ok with that because the smallest possible actual message is closer to 73 bytes and looks like this:

rcpt to:t@u.ca
data
From:t@u.ca
To:t@u.ca
Subject:x

A
.```

I won’t event suggest a fix because it is non-sensical to set that to 3 bytes, but I might just update the documentation to indicate that the lowest logical value is 10.