"egress_pool":"unspecified","egress_source":"unspecified"

im sending this via my api

{
“content”: {
“from”: {
“email”: “main@xyz.com”,
“name”: “xyz”
},
“headers”: {
“X-Tenant”: “mytenant”,
“egress_pool”: “pool-3”
},
“html_body”: “

This is the HTML part

”,
“reply_to”: {
“email”: “main@xyz.com”,
“name”: “xyz”
},
“subject”: “This is the subject”,
“text_body”: “This is the plain text part”
},
“envelope_sender”: “main@mrsumi.com”,
“recipients”: [
{
“email”: “xyz@gmail.com”,
“name”: “”
}
],
“trace_headers”: {}
}

but im unable to send mail via diffrent ip

{“type":“Reception”,“id”:“c2f8a331bbd511ef9f67fa163e827be3”,“sender”:"main@xyz.com,“recipient”:"xyz@gmail.com",“queue”:“gmail.com”,“site”:“”,“size”:1346,“response”:{“code”:250,“enhanced_code”:null,“content”:“”,“command”:null},“peer_address”:{“name”:“”,“addr”:“x.x.x.x”},“timestamp”:1734371224,“created”:1734371224,“num_attempts”:0,“bounce_classification”:“Uncategorized”,“egress_pool”:null,“egress_source”:null,“source_address”:null,“feedback_report”:null,“meta”:{},“headers”:{},“delivery_protocol”:null,“reception_protocol”:“HTTP”,“nodeid”:“82b1acb5-699f-45a9-9dc8-58b206b364cd”}
{“type":“Delivery”,“id”:“c2f8a331bbd511ef9f67fa163e827be3”,“sender”:"main@xyz.com,“recipient”:"xyz@gmail.com",“queue”:“gmail.com”,“site”:“unspecified->(alt1|alt2|alt3|alt4)?.gmail-smtp-in.l.google.com@smtp_client”,“size”:1346,“response”:{“code”:250,“enhanced_code”:{“class”:2,“subject”:0,“detail”:0},“content”:“OK DMARC:Quarantine 1734371226 d9443c01a7336-218a1da3f4csi61725785ad.130 - gsmtp”,“command”:“.\r\n”},“peer_address”:{“name”:“gmail-smtp-in.l.google.com.”,“addr”:“x.x.x.x”},“timestamp”:1734371226,“created”:1734371224,“num_attempts”:0,“bounce_classification”:“Uncategorized”,“egress_pool”:“unspecified”,“egress_source”:“unspecified”,“source_address”:{“address”:“x.x.x.x:44348”},“feedback_report”:null,“meta”:{},“headers”:{},“delivery_protocol”:“ESMTP”,“reception_protocol”:“HTTP”,“nodeid”:“82b1acb5-699f-45a9-9dc8-58b20xxx364cd”,“tls_cipher”:“TLS13_AES_256_GCM_SHA384”,“tls_protocol_version”:“TLSv1_3”,“tls_peer_subject_name”:[“CN=mx.google.com”]}

log

Go back and read the first bot response, and the linked pages, then provide the required info.

version : kumod 2024.11.08-d383b033
Linux vps-25e1ab08-vps-ovh-ca 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

im unable to use diffrent ip in pool using queue and api its sending by default ip also the headder seems to be empty in request

the log is

{"type":"Delivery","id":"c2f8a331bbd511ef9f67fa163e827be3","sender":"main@xyz.com","recipient":"xyz@gmail.com","queue":"gmail.com","site":"unspecified->(alt1|alt2|alt3|alt4)?.gmail-smtp-in.l.google.com@smtp_client","size":1346,"response":{"code":250,"enhanced_code":{"class":2,"subject":0,"detail":0},"content":"OK DMARC:Quarantine 1734371226 d9443c01a7336-218a1da3f4csi61725785ad.130 - gsmtp","command":".\r\n"},"peer_address":{"name":"gmail-smtp-in.l.google.com.","addr":"x.x.x.x"},"timestamp":1734371226,"created":1734371224,"num_attempts":0,"bounce_classification":"Uncategorized","egress_pool":"unspecified","egress_source":"unspecified","source_address":{"address":"x.x.x.x:44348"},"feedback_report":null,"meta":{},"headers":{},"delivery_protocol":"ESMTP","reception_protocol":"HTTP","nodeid":"82b1acb5-699f-45a9-9dc8-58b20xxx364cd","tls_cipher":"TLS13_AES_256_GCM_SHA384","tls_protocol_version":"TLSv1_3","tls_peer_subject_name":["CN=mx.google.com"]}```

Oh I saw the logs the first time, I still don’t see your configs.

local kumo = require 'kumo'
--[[ Start of INIT section ]]

kumo.on('init', function()
  kumo.start_esmtp_listener {
    listen = '0.0.0.0:25',
  }

  kumo.start_http_listener {
    listen = '0.0.0.0:8090',
    trusted_hosts = { '0.0.0.0/0', '::1' },
  }

  kumo.define_spool {
    name = 'data',
    path = '/var/spool/kumomta/data',
  }

  kumo.define_spool {
    name = 'meta',
    path = '/var/spool/kumomta/meta',
  }
   kumo.set_diagnostic_log_filter 'kumod=debug'

  kumo.configure_local_logs {
    log_dir = '/var/log/kumomta',
    -- Flush logs every 10 seconds.
    -- You may wish to set a larger value in your production
    -- configuration; this lower value makes it quicker to see
    -- logs while you are first getting set up.
    max_segment_duration = '10s',
  }
end)

local sources = require 'policy-extras.sources'
sources:setup ({ '/opt/kumomta/etc/sources.toml' })

local queue_module = require 'policy-extras.queue'
local queue_helper =   queue_module:setup ({ '/opt/kumomta/etc/policy/queues.toml' })

kumo.on('smtp_server_message_received', function(msg)
queue_helper:apply(msg)
  local domain = msg:from_header().domain
  local signer = kumo.dkim.rsa_sha256_signer {
    domain = domain,
    selector = 'default',
    headers = { 'From', 'To', 'Subject' },
    key = '/opt/kumomta/etc/dkim/' .. domain .. '/default.key', 
  }

  -- Perform DKIM signing
  msg:dkim_sign(signer)
end)

kumo.on('http_message_generated', function(msg)
  local domain = 'xyz.com'  
  local signer = kumo.dkim.rsa_sha256_signer {
    domain = domain,
    selector = 'default',
    headers = { 'From', 'To', 'Subject' },
    key = '/opt/kumomta/etc/dkim/' .. domain .. '/default.key', 
  }

  -- Perform DKIM signing
  msg:dkim_sign(signer)
end)

# Allow optional scheduled sends based on this header
# https://docs.kumomta.com/reference/message/import_scheduling_header
scheduling_header = "X-Schedule"

# Set the tenant from this header and delete the header for added security
tenant_header = "X-Tenant"
remove_tenant_header = true

# Set the campaign from this header and delete the header for added security
campaign_header = "X-Campaign"
remove_campaign_header = true

# The tenant to use if no tenant_header is present
default_tenant = "default-tenant"

[tenant.'default-tenant']
egress_pool = 'pool-3'

[tenant.'mytenant']
# Which pool should be used for this tenant
egress_pool = 'pool-2'
# Override maximum message age based on tenant; this overrides settings at the domain level
max_age = '10 hours'

# Only the authorized identities are allowed to use this tenant via the tenant_header
#require_authz = ["scott"]

# The default set of parameters
[queue.default]
max_age = '24 hours'

# Base settings for a given destination domain.
# These are overridden by more specific settings
# in a tenant or more specific queue
[queue.'gmail.com']
max_age = '22 hours'
retry_interval = '17 mins'

[queue.'gmail.com'.'mytenant']
# options here for domain=gmail.com AND tenant=mytenant for any unmatched campaign

[queue.'gmail.com'.'mytenant'.'welcome-campaign']
# options here for domain=gmail.com, tenant=mytenant, and campaign='welcome-campaign'```

[source."ip-1"]
source_address = "x.x.x.0"
ehlo_domain = 'mail1.xyz.com'

[source."ip-2"]
source_address = "x.x.x.1"
ehlo_domain = 'mail2.xyz.com'

[source."ip-3"]
source_address = "x.x.x.2"
ehlo_domain = 'mail3.xyz.com'

[source."ip-4"]
source_address = "x.x.x.3"
ehlo_domain = 'mail4.xyz.com'

[source."main-ip"]
source_address = "x.x.x.4"
ehlo_domain = 'mail.xyz.com'




[pool."pool-1"]
[pool."pool-1"."ip-1"]
weight = 1

[pool."pool-2"."ip-2"]
weight = 1

[pool."pool-3"."ip-3"]
weight = 1

[pool."pool-4"."ip-4"]
weight = 1

[pool."pool-5"."main-ip"]
weight = 1```

Are those IPs actually plumbed on that server?
Can you do an ip addr?

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether fa:16:3e:82:7b:e3 brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet x.x.x.0/32 scope global ens3
       valid_lft forever preferred_lft forever
    inet x.x.x.1/32 scope global ens3
       valid_lft forever preferred_lft forever
    inet x.x.x.2/32 scope global ens3
       valid_lft forever preferred_lft forever
    inet x.x.x.3/32 scope global ens3
       valid_lft forever preferred_lft forever
    inet x.x.x.4/32 metric 100 scope global dynamic ens3
       valid_lft 43691sec preferred_lft 43691sec
    inet6 2402:1f00:8303:100::ad6/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::f816:3eff:fe82:7be3/64 scope link
       valid_lft forever preferred_lft forever```

And what headers were in the delivered message?

the ip was x.x.x.0 and the rest nothing “headers”:{}

im unable to send via any ip rather than x.x.x.0

That doesn’t look like any headers I’ve ever seen. I asked you to provide the headers for the test message as delivered.

Delivered-To: recipient@gmail.com
Received: by 2002:a05:7022:42afa:b0:92:ad20:25a3 with SMTP id bk42csp2018439dlb;
Mon, 16 Dec 2024 05:51:09 -0800 (PST)
From: Support support@xyz.com
To: Recipient recipient@gmail.com
Subject: Test Email from xyz.com
Message-ID: 5ssaa6ddSdf@xyz.com
Return-Path: support@xyz.com
Received: from mail.xyz.com (mail.xyz.com [x.x.x.0])
by mx.google.com with ESMTPS id abcd1234xyz
for recipient@gmail.com;

So the message had no “X-Tenant”: “mytenant”,
“egress_pool”: “pool-3” headers present?

And KumoMTA added no received header?

yes

But you did nothing to suppress the creation of received headers in KumoMTA?