From: Timo Sirainen Date: Thu, 12 Jan 2023 13:59:22 +0000 (+0200) Subject: pop3: Use better ways of accessing mail_storage_settings X-Git-Tag: 2.4.0~2305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611d50bb625e49386449c153c9db10300ebe6e09;p=thirdparty%2Fdovecot%2Fcore.git pop3: Use better ways of accessing mail_storage_settings --- diff --git a/src/pop3/pop3-client.c b/src/pop3/pop3-client.c index cae9373310..614de25e83 100644 --- a/src/pop3/pop3-client.c +++ b/src/pop3/pop3-client.c @@ -340,8 +340,6 @@ static void pop3_lock_session_refresh(struct client *client) int pop3_lock_session(struct client *client) { - const struct mail_storage_settings *mail_set = - mail_storage_service_user_get_mail_set(client->user->service_user); struct dotlock_settings dotlock_set; enum mailbox_list_path_type type; const char *dir, *path; @@ -368,8 +366,8 @@ int pop3_lock_session(struct client *client) path = t_strdup_printf("%s/"POP3_LOCK_FNAME, dir); dotlock_set = session_dotlock_set; - dotlock_set.use_excl_lock = mail_set->dotlock_use_excl; - dotlock_set.nfs_flush = mail_set->mail_nfs_storage; + dotlock_set.use_excl_lock = client->inbox_ns->mail_set->dotlock_use_excl; + dotlock_set.nfs_flush = client->inbox_ns->mail_set->mail_nfs_storage; ret = file_dotlock_create(&dotlock_set, path, 0, &client->session_dotlock); @@ -418,9 +416,10 @@ struct client *client_create(int fd_in, int fd_out, client->user = user; - client->mail_set = mail_user_set_get_storage_set(user); + const struct mail_storage_settings *mail_set = + mail_user_set_get_storage_set(client->user); client->uidl_keymask = - parse_uidl_keymask(client->mail_set->pop3_uidl_format); + parse_uidl_keymask(mail_set->pop3_uidl_format); if (client->uidl_keymask == 0) i_fatal("Invalid pop3_uidl_format"); diff --git a/src/pop3/pop3-client.h b/src/pop3/pop3-client.h index fee0d99d4e..58ea762356 100644 --- a/src/pop3/pop3-client.h +++ b/src/pop3/pop3-client.h @@ -90,7 +90,6 @@ struct client { /* settings: */ const struct pop3_settings *set; - const struct mail_storage_settings *mail_set; pool_t uidl_pool; enum uidl_keys uidl_keymask; diff --git a/src/pop3/pop3-commands.c b/src/pop3/pop3-commands.c index a85048344b..016268ad83 100644 --- a/src/pop3/pop3-commands.c +++ b/src/pop3/pop3-commands.c @@ -678,11 +678,11 @@ pop3_get_uid(struct client *client, struct mail *mail, string_t *str, }; const char *error; - if (var_expand(str, client->mail_set->pop3_uidl_format, + if (var_expand(str, client->inbox_ns->mail_set->pop3_uidl_format, tab, &error) <= 0) { e_error(client->event, "UIDL: Failed to expand pop3_uidl_format=%s: %s", - client->mail_set->pop3_uidl_format, error); + client->inbox_ns->mail_set->pop3_uidl_format, error); return -1; } return 0;