Configure Socks5 Proxy in Lua policy extras sources helper?

Thanks, yeah, we’re able to run traffic out through the proxy just fine, for example from within the kumo pod with curl installed: curl -x socks5://kumo-proxy:5000 https://icanhazip.com results in the desired public ip address

I was able to chat with their server over netcat as well, ran the following command: nc -v -xkumo-proxy:5000 -X5 74.125.195.108 25 couldn’t specify the source address as netcat was saying that there was no proxy support for it, and I had to specify the gmail smtp servers’ ip address as the kumo proxy server was complaining Domain not supported

@notable-cougar if you’re having issues can you open your own thread with the relevant troubleshooting information?

I’m working with @bountiful-frog

Aah ok that’s fine then.

We’re taking a stab at configuring the sending ip using lua and bypassing the helper, see if it works happily that way

I don’t see source_address set, which is which IP the KumoMTA node will connect out from to reach the proxy server. Sometimes that is relevant, sometimes it is not.

I don’t think that should be too relevant in our setup, the kumomta pod has its ip assigned dynamically but should be communicating through the k8s service over to the kumoproxy pod which then has its external ip assigned manually, as long as the kumomta pod is in an appropriately labeled namespace it should (and in this case, can) talk to the proxy server

Have you tried this with the IP literal of the proxy server instead of a hostname? Might be something that could be worth checking.

I will give that a try

that was it

Ok, so there’s potentially a hostname resolution issue WRT the proxy server address.

@free-spirited-yorksh ^

To be fair, in all the docs it was an ip address, I just figured I would be able to also use a hostname

Can you share an example of the configuration that didn’t work? I would expect it to reject something that wasn’t an IP address literal

# /opt/kumomta/etc/policy/sources.toml

[source."ip-1"]
socks5_proxy_source_address = '23.192.228.84' #example ip
socks5_proxy_server = 'kumo-proxy:5000' #also kumo-proxy.default.svc.cluster.local
ehlo_domain = 'mta.example.com'

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

The actual error was thrown in a mapping function which we tried looking through but had no luck:
https://discord.com/channels/1072980126737907824/1345173133941932154/1345174247458340885

we were getting that error during the validate command as well as when tailing the logs /opt/kumomta/sbin/tailer --tail /var/log/kumomta

Granted, when Ryan posted, we had configured two different sending ips. We simplified to one just to try and get this figured out.

root@kumomta-statefulset-0:/opt/kumomta/etc/policy# kumod --user kumod --validate
2025-03-03T21:27:16.243281Z DEBUG logging-13 kumod::logging: calling state.logger_thread()
2025-03-03T21:27:16.243322Z DEBUG logging-13 kumod::logging::files: LogFileParams: LogFileParams {
    log_dir: "/var/log/kumomta",
    max_file_size: 1000000000,
    back_pressure: 128000,
    compression_level: 0,
    max_segment_duration: Some(
        1s,
    ),
    meta: [],
    headers: [
        "Date",
        "To",
        "From",
        "Subject",
        "Message-Id",
        "X-*",
    ],
    per_record: {},
    filter_event: None,
    min_free_space: Percent(
        10,
    ),
    min_free_inodes: Percent(
        10,
    ),
}
2025-03-03T21:27:16.243684Z DEBUG logging-13 kumod::logging::files: waiting until deadline=None for a log record
2025-03-03T21:27:16.248018Z DEBUG       main kumod::logging: Terminating a logger
2025-03-03T21:27:16.248037Z DEBUG       main kumod::logging: Joining that logger
2025-03-03T21:27:16.248096Z DEBUG logging-13 kumod::logging::hooks: LogCommand::Terminate received. Stopping writing logs
2025-03-03T21:27:16.248173Z DEBUG       main kumod::logging: Joined -> Some(Ok(()))
2025-03-03T21:27:16.248184Z DEBUG       main kumod::logging: Terminating a logger
2025-03-03T21:27:16.248198Z DEBUG       main kumod::logging: Joining that logger
2025-03-03T21:27:16.248203Z DEBUG logging-13 kumod::logging::hooks: LogCommand::Terminate received. Stopping writing logs
2025-03-03T21:27:16.248230Z DEBUG       main kumod::logging: Joined -> Some(Ok(()))
2025-03-03T21:27:16.248236Z DEBUG       main kumod::logging: Terminating a logger
2025-03-03T21:27:16.248245Z DEBUG       main kumod::logging: Joining that logger
2025-03-03T21:27:16.248253Z DEBUG logging-13 kumod::logging::files: LogCommand::Terminate received. Stopping writing logs
2025-03-03T21:27:16.248261Z DEBUG logging-13 kumod::logging::files: Clearing any buffered files prior to completion