]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Add haproxied hostname to event as local_name in alloc
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 3 May 2024 12:15:37 +0000 (15:15 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:01 +0000 (10:40 +0200)
This makes settings filters work consistently.

src/login-common/client-common.c

index d4c27622cbfee45d5348d06512dfbacbd6221331..0320f619021ba2099ff963086ca76637027514b3 100644 (file)
@@ -262,6 +262,9 @@ int client_alloc(int fd, const struct master_service_connection *conn,
                      client_var_expand_callback);
        event_set_ptr(client->event, SETTINGS_EVENT_VAR_EXPAND_CALLBACK_CONTEXT,
                      client);
+       /* Need to set local name here already so that settings filters work */
+       if (conn->haproxied)
+               event_add_str(client->event, "local_name", conn->haproxy.hostname);
        if (client_settings_get(client, &error) < 0) {
                e_error(client->event, "%s", error);
                event_unref(&client->event);