]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp-proxy: set real_ variables in auth_user_info struct
authorMarkus Valentin <markus.valentin@open-xchange.com>
Thu, 13 Jun 2019 18:54:39 +0000 (20:54 +0200)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 18 Jun 2019 10:12:23 +0000 (10:12 +0000)
Set the real_ variables from connection to the client struct and from
there to the auth_user_info. This allows to pass the real_ variables to
lib-auth and thereby to the auth process.

src/lmtp/lmtp-client.c
src/lmtp/lmtp-client.h
src/lmtp/lmtp-proxy.c

index ba6b2acc981e3fbef2ac43c66a8bc3104dd32540..93ba3b3df36aa1cfaaee1604217c98b2930c8902 100644 (file)
@@ -155,6 +155,10 @@ struct client *client_create(int fd_in, int fd_out,
        client->remote_port = conn->remote_port;
        client->local_ip = conn->local_ip;
        client->local_port = conn->local_port;
+       client->real_local_ip = conn->real_local_ip;
+       client->real_local_port = conn->real_local_port;
+       client->real_remote_ip = conn->real_remote_ip;
+       client->real_remote_port = conn->real_remote_port;
        client->state_pool = pool_alloconly_create("client state", 4096);
 
        client->event = event_create(NULL);
index 7b02ae6c228ef45c425040da0983f9961f743a9b..f8a885df1cd452ae89a39b68a51e2813f0d984e2 100644 (file)
@@ -83,8 +83,8 @@ struct client {
        struct smtp_server_connection *conn;
        enum smtp_server_state last_state;
 
-       struct ip_addr remote_ip, local_ip;
-       in_port_t remote_port, local_port;
+       struct ip_addr remote_ip, local_ip, real_local_ip, real_remote_ip;
+       in_port_t remote_port, local_port, real_local_port, real_remote_port;
 
        struct mail_user *raw_mail_user;
        const char *my_domain;
index 84b610758ea216a4245da1672505add3294a0479..f2ac9f01e0f7093d4e3a3bce75eb6b6560ecf353 100644 (file)
@@ -493,9 +493,13 @@ int lmtp_proxy_rcpt(struct client *client,
        i_zero(&info);
        info.service = master_service_get_name(master_service);
        info.local_ip = client->local_ip;
+       info.real_local_ip = client->real_local_ip;
        info.remote_ip = client->remote_ip;
+       info.real_remote_ip = client->real_remote_ip;
        info.local_port = client->local_port;
+       info.real_local_port = client->real_local_port;
        info.remote_port = client->remote_port;
+       info.real_remote_port = client->real_remote_port;
 
        // FIXME: make this async
        auth_pool = pool_alloconly_create("auth lookup", 1024);