]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 10 Sep 2019 07:01:41 +0000 (10:01 +0300)
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 3f13ff00d71d069ac8ae4dec006c25953975f3fd..f0e25b7c263c8152280e173eef1a05a0518d487f 100644 (file)
@@ -152,6 +152,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 60abf93483b542bc69edd8dc1bb880b02ed84b4d..ffb8cbf631f5f1aef48d71c0e50ce25430e38ac2 100644 (file)
@@ -82,8 +82,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 460cf5c8309907bfe9d57d0d6423ba3963020d74..5a2aa284ccd91e51de910a8d96ecdddae99f0ded 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);