From: Timo Sirainen Date: Wed, 16 Nov 2022 23:13:25 +0000 (+0200) Subject: lib-storage: Remove mail_user.set_info X-Git-Tag: 2.4.0~3327 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b33d67225175b264007346a2cecc4348e17e7b77;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Remove mail_user.set_info --- diff --git a/src/lda/main.c b/src/lda/main.c index 0dc90587cb..ffaf2a2461 100644 --- a/src/lda/main.c +++ b/src/lda/main.c @@ -153,8 +153,7 @@ lda_raw_mail_open(struct mail_deliver_input *dinput, const char *path) time_t mtime; int ret; - raw_mail_user = raw_storage_create_from_set(dinput->rcpt_user->unexpanded_set_parser, - dinput->rcpt_user->set_info); + raw_mail_user = raw_storage_create_from_set(dinput->rcpt_user->unexpanded_set_parser); mail_from = (dinput->mail_from != NULL ? dinput->mail_from : &default_envelope_sender); diff --git a/src/lib-storage/index/raw/raw-storage.c b/src/lib-storage/index/raw/raw-storage.c index 6f80209d56..d88a3bde9e 100644 --- a/src/lib-storage/index/raw/raw-storage.c +++ b/src/lib-storage/index/raw/raw-storage.c @@ -13,8 +13,7 @@ extern struct mail_storage raw_storage; extern struct mailbox raw_mailbox; struct mail_user * -raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser, - const struct setting_parser_info *set_info) +raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser) { struct mail_user *user; struct mail_namespace *ns; @@ -27,7 +26,7 @@ raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_ /* Don't include raw user's events in statistics or anything else. They would just cause confusion. */ event_disable_callbacks(event); - user = mail_user_alloc(event, "raw mail user", unexpanded_set_parser, set_info); + user = mail_user_alloc(event, "raw mail user", unexpanded_set_parser); event_unref(&event); user->autocreated = TRUE; diff --git a/src/lib-storage/index/raw/raw-storage.h b/src/lib-storage/index/raw/raw-storage.h index 90f3c59284..cfc7127a8b 100644 --- a/src/lib-storage/index/raw/raw-storage.h +++ b/src/lib-storage/index/raw/raw-storage.h @@ -30,8 +30,7 @@ struct raw_mailbox { extern struct mail_vfuncs raw_mail_vfuncs; struct mail_user * -raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser, - const struct setting_parser_info *set_info); +raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser); int raw_mailbox_alloc_stream(struct mail_user *user, struct istream *input, time_t received_time, const char *envelope_sender, diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index e7153fa2d4..06cb779c4e 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -249,7 +249,7 @@ int shared_storage_get_namespace(struct mail_namespace **_ns, } owner = mail_user_alloc(event_get_parent(user->event), userdomain, - user->unexpanded_set_parser, user->set_info); + user->unexpanded_set_parser); owner->_service_user = user->_service_user; mail_storage_service_user_ref(owner->_service_user); owner->creator = user; diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 9e0e3b151d..d72744709d 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -685,7 +685,7 @@ mail_storage_service_init_post(struct mail_storage_service_ctx *ctx, /* NOTE: if more user initialization is added, add it also to mail_user_dup() */ mail_user = mail_user_alloc_nodup_set(user->event, user->input.username, - user->set_parser, user->user_info); + user->set_parser); mail_user->_service_user = user; mail_storage_service_user_ref(user); mail_user_set_home(mail_user, *home == '\0' ? NULL : home); diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index fa32da4492..9e02346923 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -52,7 +52,6 @@ static struct mail_user * mail_user_alloc_int(struct event *parent_event, const char *username, const struct setting_parser_context *unexpanded_set_parser, - const struct setting_parser_info *set_info, pool_t pool) { struct mail_user *user; @@ -66,7 +65,6 @@ mail_user_alloc_int(struct event *parent_event, user->username = p_strdup(pool, username); user->unexpanded_set_parser = unexpanded_set_parser; user->set_parser = settings_parser_dup(unexpanded_set_parser, pool); - user->set_info = set_info; user->unexpanded_set = settings_parser_get_root_set(unexpanded_set_parser, &mail_user_setting_parser_info); @@ -88,27 +86,25 @@ mail_user_alloc_int(struct event *parent_event, struct mail_user * mail_user_alloc_nodup_set(struct event *parent_event, const char *username, - const struct setting_parser_context *unexpanded_set_parser, - const struct setting_parser_info *set_info) + const struct setting_parser_context *unexpanded_set_parser) { pool_t pool; pool = pool_alloconly_create(MEMPOOL_GROWING"mail user", 16*1024); return mail_user_alloc_int(parent_event, username, - unexpanded_set_parser, set_info, pool); + unexpanded_set_parser, pool); } struct mail_user *mail_user_alloc(struct event *parent_event, const char *username, - const struct setting_parser_context *unexpanded_set_parser, - const struct setting_parser_info *set_info) + const struct setting_parser_context *unexpanded_set_parser) { pool_t pool; pool = pool_alloconly_create(MEMPOOL_GROWING"mail user", 16*1024); return mail_user_alloc_int(parent_event, username, settings_parser_dup(unexpanded_set_parser, pool), - set_info, pool); + pool); } static void @@ -769,7 +765,7 @@ struct mail_user *mail_user_dup(struct mail_user *user) struct mail_user *user2; user2 = mail_user_alloc(event_get_parent(user->event), user->username, - user->unexpanded_set_parser, user->set_info); + user->unexpanded_set_parser); if (user2->_service_user != NULL) { user2->_service_user = user->_service_user; mail_storage_service_user_ref(user2->_service_user); diff --git a/src/lib-storage/mail-user.h b/src/lib-storage/mail-user.h index 36d6157932..2f4cff9343 100644 --- a/src/lib-storage/mail-user.h +++ b/src/lib-storage/mail-user.h @@ -60,7 +60,6 @@ struct mail_user { const struct setting_parser_context *unexpanded_set_parser; const struct setting_parser_context *set_parser; - const struct setting_parser_info *set_info; const struct mail_user_settings *unexpanded_set; struct mail_user_settings *set; struct mail_namespace *namespaces; @@ -130,13 +129,11 @@ extern const struct var_expand_func_table *mail_user_var_expand_func_table; struct mail_user *mail_user_alloc(struct event *parent_event, const char *username, - const struct setting_parser_context *unexpanded_set_parser, - const struct setting_parser_info *set_info); + const struct setting_parser_context *unexpanded_set_parser); struct mail_user * mail_user_alloc_nodup_set(struct event *parent_event, const char *username, - const struct setting_parser_context *set_parser, - const struct setting_parser_info *set_info); + const struct setting_parser_context *set_parser); /* Returns -1 if settings were invalid. */ int mail_user_init(struct mail_user *user, const char **error_r); diff --git a/src/lmtp/lmtp-client.c b/src/lmtp/lmtp-client.c index 3255b8d553..0f02517a5c 100644 --- a/src/lmtp/lmtp-client.c +++ b/src/lmtp/lmtp-client.c @@ -97,15 +97,6 @@ static void client_load_modules(struct client *client) module_dir_init(mail_storage_service_modules); } -static void -client_raw_user_create(struct client *client, - const struct setting_parser_context *set_parser) -{ - client->raw_mail_user = - raw_storage_create_from_set(set_parser, - client->user_set_info); -} - static void client_read_settings(struct client *client, bool ssl) { struct mail_storage_service_input input; @@ -129,7 +120,7 @@ static void client_read_settings(struct client *client, bool ssl) i_fatal("%s", error); /* create raw user before duplicating the settings parser */ - client_raw_user_create(client, set_parser); + client->raw_mail_user = raw_storage_create_from_set(set_parser); set_parser = settings_parser_dup(set_parser, client->pool); lmtp_settings_get(set_parser, client->pool, &lmtp_set, &lda_set);