How to relay message to other MTA

At present, I have tested it and only specified that the tenant cannot take effect

[tenant.'mytenant']
egress_pool = 'sockspool'

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

i use awaks test, but not use mysmtp-smarthost.com

If I specified gmail.com, he worked fine.

[tenant.'mytenant']
egress_pool = 'sockspool'

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

So I think wildcards are useful for this

It would be best if you stated your desired outcome and showed your full config.

config : https://gist.github.com/smsvip/dc7a82015316c31437f29b3e2f14852d

desired outcome : I can perform a relay based on Wildcards(regular expressions) As mentioned at the beginning

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

can be in kumo queue.toml config like
[queue.'/live.*/'.'my.own.hostname']

I know for all message relay can use msg:set_meta('routing_domain', 'mysmtp-smarthost.com')

You’ll want to look up providers, I’m on a plane and can’t do a full example.

And a use case is why not what.

Investigate the possibility of kumomta in order to sort out migration here.

usecase1: sent by kumomta ; it is works.
usecase2: sent by kumomta but relay to smtp.xxxx.com(other supplier) use msg:set_meta('routing_domain', 'mysmtp-smarthost.com')
usecase3: sent by kumomta but for one tenant, we have some ISPs that send it through the kumomta and some (such as gmail.com) that send it through another provider.

Domain "mopen.163.com" {
Message_Expiration = 864000
Outbound_Throttle_Messages = "12/3600"
}
Domain "163.com" {
Gateway = "mopen.163.com"
}

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

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

Our expectation is that this demand can also be realized through kumomta. As far as I know, routing_domain can work, if the support Wildcards

Try using DeepWiki to find answer .
The Correct Approach
There are two correct approaches to solve your problem:

  1. Domain-specific tenant configuration (what worked for you)
    This is what you found working:
[queue.'gmail.com'.'mytenant']  
routing_domain = 'mysmtp-smarthost.com'

This works because it correctly follows the domain → tenant → campaign hierarchy.

  1. Using the default queue configuration
    If you want all messages from a specific tenant to be routed through a smarthost regardless of domain, you should use:
[queue.default.'mytenant']  
routing_domain = 'mysmtp-smarthost.com'

This sets the routing_domain for all domains when the tenant is ‘mytenant’.

But it also does not work. maybe not the keyword: default

I am unclear if this is a question or an answer.

I think kumomta queue helper do not support . I should be use lua to complete my task. you can close this topic! thank you!