How to relay message to other MTA

Hello,
How to relay message to other MTA(like postfix or another KumoMTA) .
In PowerMTA or Momentum is like

bingding_group xxx {
   Domain "/live\.*/"{
     Gateway = 'smtp_domain'
  }
}

domain "smtp_domain" {
  Routes = {"smtp://ip?/port=25"}
  Outbound_SMTP_AUTH_TYPE= "xxxx"
  other conf...
 }

In KumoMTA use routing_domain?

Yes.

I read the document and there were also some misunderstandings. If I only use the helper, I added the following code to queues.toml, but it didn’t take effect in my test.

[queue.'gmail.com']
max_age = '22 hours'
retry_interval = '17 mins'

[queue.'gmail.com'.'haproxypool']
# options here for domain=gmail.com AND tenant=haproxypool for any unmatched campaign
routing_domain = '[10.10.10.10]'
max_age = '22 hours'
retry_interval = '17 mins'

[queue.'gmail.com'.'haproxypool'.'welcome-campaign']
# options here for domain=gmail.com, tenant=mytenant, and campaign='welcome-campaign'
routing_domain = '[10.10.10.10]'
max_age = '22 hours'
retry_interval = '17 mins'

Excuse me, can the routing_domain be set under the tenant? For example:

[tenant.'routing_domain_tenant']
routing_domain = '[10.10.2.1]'
max_age = '10 hours'

Do I still need to add the following in listener_domains.toml?

["send.example.com"]
# allow relaying mail from anyone, so long as it is
# addressed to webpowerx.com
relay_to = true

But my question is that this domain is used by all users, and I don’t want to provide a domain name to certain customers separately. Am I misunderstanding this domain name? Do I understand that this domain name corresponds to the --server in the following swaks command?

swaks --to youremail@xxx.com --from xxx@yoursendadress \
      --header "X-Tenant : routing_domain_tenant" \
      --header "Subject: subject" \
      --server send.example.com  \
      --port 587 \
      --tls \
      --auth PLAIN --auth-user 'xxxx' --auth-password 'xxxx' \
      --body "email body" 

routing_domain can support username password?

[queue.'my.own.hostname']
routing_domain = '[10.0.0.1]'
port = 25
use_auth = true
auth_username = "user"
auth_password = "pass"

I try add some config in shapping.toml , add


[smtp-relay.xxx.com]
mx_rollup = false
smtp_port = 587
smtp_auth_plain_username = "username"
smtp_auth_plain_password = "password"

Also, I want to use domain , not ip address. it will be error : failed to resolve queue default-tenant@xxx.com![smtp-relay.xxxx.com]: invalid address: smtp-relay.xxxx.com: invalid IP address syntax

The routing_domain can absolutely be a domain and not an ip address. Do not use brackets.
Ie: routing_domain = “mysmtp-smarthost.com

Then I the shaping file set the auth params under that domain

Thanks.
How can I make all mail of this tenant relay. At present, I have tested it and only specified that the tenant cannot take effect (it will be automatically sent by unspecified)

[tenant.'mytenant']

[queue.'mytenant']
routing_domain = 'mysmtp-smarthost.com'

If I specified gmail.com, he worked fine.

[tenant.'mytenant']

[queue.'gmail.com'.'mytenant']
routing_domain = 'mysmtp-smarthost.com'

it support [queue.‘*’.‘mytenant’] for all ?

  1. if all messages are all relay . I will use
msg:set_meta('routing_domain', 'mysmtp-smarthost.com')
  1. If part messages will relay like gmail.com , I will use
[queue.'gmail.com'.'mytenant']
routing_domain = 'mysmtp-smarthost.com'

Em. If kumomta can config in queue.toml can support Regular Expressions will be fine.

You have not specified a pool in the queue config.

I recommend reading through the helper docs

Particularly this one

egress_pool = 'pool-2'
# Override maximum message age based on tenant; this overrides settings at the domain level
max_age = '10 hours' ```

yes, I know the pool . To simplify, I intentionally removed it. This does not affect my final test.

Well the absence of the pool will send it to undetermined. Sharing your actual configs would be helpful

[queue.‘/live.*/’.‘my.own.hostname’] can kumo support?

Wildcards are not supported. (Assuming nothing has changed since the last time I looked)