SOCKS5 not bind with my server IP

Hello, We have followed your configuration to setup kumomta, like configure queues.toml, source.toml, etc. Also, trying to set up socks5 proxy but occuring some error checked in webhook logs

"KumoMTA internal: failed to connect to any candidate hosts: connect to ResolvedAddress { name: "gmail-smtp-in.l.google.com.", addr: 64.233.177.26 } port 25 and read initial banner: failed to bind <SERVER_IP_1> via Socks5 { server: <SOCKS5_SERVER_IP>:5000, source: <SERVER_IP_1>, destination: 64.233.177.26:25, username_and_password: None }: SocksV5Response { status: ServerFailure, host: Ipv4([0, 0, 0, 0]), port: 0 }, connect to ResolvedAddress { name: "gmail-smtp-in.l.google.com.", addr: 2607:f8b0:4002:c00::1a } port 25 and read initial banner: Skipping ip-2 because socks5_proxy_source_address address family does not match the destination address family
"

Here are the files,
queues.toml >>>

scheduling_header = “X-Schedule”
tenant_header = “X-Tenant”
remove_tenant_header = true

campaign_header = “X-Campaign”
remove_campaign_header = true

default_tenant = “person-1”

[tenant.‘person-1’]
egress_pool = ‘pool-1’
max_age = ‘10 hours’

[tenant.‘person-2’]
egress_pool = ‘pool-2’

[queue.‘mydomain.com’]
max_age = ‘22 hours’
retry_interval = ‘17 mins’

[queue.‘mydomain.com’.‘person-1’]

sources.toml >>>

[source.“ip-1”]
source_address = ‘<SERVER_IP_1>’
ehlo_domain = ‘mail.mydomain.com
socks5_proxy_source_address = ‘<SERVER_IP_1>’
socks5_proxy_server = ‘<SOCKS5_SERVER_IP>:5000’

Pool containing just ip-1, which has weight=1
[pool]
[pool.“pool-1”]
[pool.“pool-1”.“ip-1”]

[source.“ip-2”]
source_address = ‘<SERVER_IP_2>’
ehlo_domain = ‘mail2.mydomain.com
socks5_proxy_source_address = ‘<SERVER_IP_2>’
socks5_proxy_server = ‘<SOCKS5_SERVER_IP>:5000’

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

Could you help me to get this solve?

Hey there @yippee-grasshopper, 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.

What Socks5 proxy are you using?

FYI, if you need to be using KumoSocks Proxy

Also please provide at least a pattern of what your actual address setting are.

We followed your documentation above and set up kumo socks5 proxy server.

last lines of our init file

local sources = require ‘policy-extras.sources’
local queue_module = require ‘policy-extras.queue’

sources:setup { ‘/opt/kumomta/etc/sources.toml’ }
– Configure Queue Helper
local queue_helper =
queue_module:setup { ‘/opt/kumomta/etc/policy/queues.toml’ }


kumo.on(‘smtp_server_message_received’, function(msg)
queue_helper:apply(msg)
– SIGNING MUST COME LAST OR YOU COULD BREAK YOUR DKIM SIGNATURES
dkim_signer(msg)

end)

kumo.on(‘http_message_generated’, function(msg)
queue_helper:apply(msg)
– SIGNING MUST COME LAST OR YOU COULD BREAK YOUR DKIM SIGNATURES
dkim_signer(msg)
end)

Please check and let us know if you want anything.

When we test our smtp server using telnet command we are getting the issue with kumo-proxy(socks5) : -

“KumoMTA internal: failed to connect to any candidate hosts: connect to ResolvedAddress { name: “gmail-smtp-in.l.google.com.”, addr: 64.233.177.26 } port 25 and read initial banner: failed to bind <SERVER_IP_1> via Socks5 { server: <SOCKS5_SERVER_IP>:5000, source: <SERVER_IP_1>, destination: 64.233.177.26:25, username_and_password: None }: SocksV5Response { status: ServerFailure, host: Ipv4([0, 0, 0, 0]), port: 0 }, connect to ResolvedAddress { name: “gmail-smtp-in.l.google.com.”, addr: 2607:f8b0:4002:c00::1a } port 25 and read initial banner: Skipping ip-2 because socks5_proxy_source_address address family does not match the destination address family
"
" { name: “gmail-smtp-in.l.google.com.”, addr: 64.233.177.26 } port 25 and read initial banner: failed to bind <SERVER_IP_1> via Socks5 { server: <SOCKS5_SERVER_IP>:5000, source: <SERVER_IP_1>, destination: 64.233.177.26:25, username_and_password: None }”

Thank You!

I am fairly certain your problem is described in the last line of that error message.

What are your actual <SERVER_IP_ 1> and <SOCKS5_SERVER_IP> numbers? Or is that literally in your configuration?

SERVER_IP_1: 155.138.10.1
Socks5_proxy_serevr: 155.138.10.2

Is that literally how it is written in your config? Can you put the full config in a gist and share here?

If you look at the example here,

You can see that the ip has to be in the addressable space as the proxy server. Kumo proxy will use any addressable ip, but it must be addressable.

https://gist.github.com/Raj1208/5b8711b0cd1de0e01d0f75221b57d1e2

And yea, please follow the get_help instructions and provide the full config

Ah, thanks

If you log into um that proxy server at 155.138.10.2, are you able to connect to anything from 155.138.10.1 ?

Looks like that’s different. That’s KumoProxy on 10.0.0.6?

You don’t typically need to be using multiple ports is why I ask.

Pls show the output of your /opt/kumomta/sbin/proxy-server --listen

ps aux | grep 5000
root 1212 0.0 0.1 74064 1508 pts/1 Sl 13:28 0:00 /opt/kumomta/sbin/proxy-server --listen 10.0.0.6:5000

string"KumoMTA internal: failed to connect to any candidate hosts: connect to ResolvedAddress { name: “gmail-smtp-in.l.google.com.”, addr: 74.125.136.26 } port 25 and read initial banner: failed to bind 155.138.227.27 via Socks5 { server: 10.0.0.6:5000, source: 155.138.227.27, destination: 74.125.136.26:25, username_and_password: None }: SocksV5Response { status: ServerFailure, host: Ipv4([0, 0, 0, 0]), port: 0 }, connect to ResolvedAddress { name: “gmail-smtp-in.l.google.com.”, addr: 2607:f8b0:4002:c05::1a } port 25 and read initial banner: Skipping ip-1 because socks5_proxy_source_address address family does not match the destination address family…

I cannot understand why I got this error in webhook logs.