]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Support XCLIENT DESTADDR and DESTPORT
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 4 Feb 2026 10:46:20 +0000 (12:46 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 6 Feb 2026 07:58:43 +0000 (07:58 +0000)
src/lmtp/lmtp-client.c
src/lmtp/lmtp-proxy.c

index 1aae4b81e0c2d5dbd0cbcd310fe1de733559cf05..200b71607c7257f3714140d085c78ca5f4d33805 100644 (file)
@@ -383,6 +383,10 @@ client_connection_proxy_data_updated(void *context,
 {
        struct client *client = context;
 
+       if (data->dest_ip.family != 0)
+               client->local_ip = data->dest_ip;
+       if (data->dest_port != 0)
+               client->local_port = data->dest_port;
        client->remote_ip = data->source_ip;
        client->remote_port = data->source_port;
        client->local_name = data->local_name;
index 04c66af963bb589542eb9b683aa702367e9335d5..24e249c77490a2d3ba5ac69151f12ce9576fbd73 100644 (file)
@@ -122,6 +122,8 @@ lmtp_proxy_init(struct client *client,
 
        smtp_server_connection_get_proxy_data(client->conn,
                                              &lmtp_set.proxy_data);
+       lmtp_set.proxy_data.dest_ip = client->local_ip;
+       lmtp_set.proxy_data.dest_port = client->local_port;
        lmtp_set.proxy_data.source_ip = client->remote_ip;
        lmtp_set.proxy_data.source_port = client->remote_port;
        lmtp_set.proxy_data.local_name = client->local_name;