From: Aki Tuomi Date: Thu, 10 Oct 2024 12:01:21 +0000 (+0300) Subject: imap-hibernate: Drop username and domain %variable variants X-Git-Tag: 2.4.0~317 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c11a109d43ef430e31c3eb2559eee6f1885af45c;p=thirdparty%2Fdovecot%2Fcore.git imap-hibernate: Drop username and domain %variable variants These can be produced with %{user | username} and %{user | domain} --- diff --git a/src/imap-hibernate/imap-client.c b/src/imap-hibernate/imap-client.c index 3dbd25d8d5..bd0cd75a7e 100644 --- a/src/imap-hibernate/imap-client.c +++ b/src/imap-hibernate/imap-client.c @@ -496,23 +496,15 @@ static void imap_client_add_idle_keepalive_timeout(struct imap_client *client) static const struct var_expand_table * imap_client_get_var_expand_table(struct imap_client *client) { - const char *username = t_strcut(client->state.username, '@'); - const char *domain = i_strchr_to_next(client->state.username, '@'); const char *local_ip = client->state.local_ip.family == 0 ? NULL : net_ip2addr(&client->state.local_ip); const char *remote_ip = client->state.remote_ip.family == 0 ? NULL : net_ip2addr(&client->state.remote_ip); - const char *auth_user, *auth_username, *auth_domain; + const char *auth_user; imap_client_parse_userdb_fields(client, &auth_user); - if (auth_user == NULL) { + if (auth_user == NULL) auth_user = client->state.username; - auth_username = username; - auth_domain = domain; - } else { - auth_username = t_strcut(auth_user, '@'); - auth_domain = i_strchr_to_next(auth_user, '@'); - } const char *local_port = ""; @@ -525,8 +517,6 @@ imap_client_get_var_expand_table(struct imap_client *client) const struct var_expand_table stack_tab[] = { { .key = "user", .value = client->state.username }, - { .key = "username", .value = username }, - { .key = "domain", .value = domain }, { .key = "service", .value = "imap-hibernate" }, { .key = "home", .value = NULL /* we shouldn't need this */ }, { .key = "local_ip", .value = local_ip }, @@ -537,8 +527,6 @@ imap_client_get_var_expand_table(struct imap_client *client) { .key = "gid", .value = dec2str(client->state.gid) }, { .key = "session", .value = client->state.session_id }, { .key = "auth_user", .value = auth_user }, - { .key = "auth_username", .value = auth_username }, - { .key = "auth_domain", .value = auth_domain }, /* NOTE: keep this synced with lib-storage's mail_user_var_expand_params() */