]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Rename mail_user_check_namespace_settings() to mail_user_settings_update...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 15 Aug 2024 07:54:45 +0000 (10:54 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:13 +0000 (12:34 +0200)
Also add a comment to clarify why this is done here.

src/lib-storage/mail-storage-settings.c
src/lib-storage/mail-storage-settings.h
src/lib-storage/mail-user.c

index 9ec45f84765bbdcf04cf02ee3f584452942970b1..897ca8798709cd99523d41bb714c9fc444401ca7 100644 (file)
@@ -438,9 +438,9 @@ static bool mail_cache_fields_parse(const char *key,
 }
 /* </settings checks> */
 
-bool mail_user_check_namespace_settings(struct mail_user *user,
-                                       const struct mail_storage_settings *set,
-                                       const char **error_r)
+bool mail_user_settings_update_special_use(struct mail_user *user,
+                                          const struct mail_storage_settings *set,
+                                          const char **error_r)
 {
        const struct mail_namespace_settings *ns;
        const char *ns_name, *error;
index f5bb81169e55af4cb3d4b898c4c731c980e95b90..c4dd5b79a0709a73691c3c980abe5699abe0b371 100644 (file)
@@ -209,8 +209,8 @@ bool mail_user_set_get_postmaster_smtp(const struct mail_user_settings *set,
 void mail_storage_2nd_settings_reset(struct settings_instance *instance,
                                     const char *key_prefix);
 
-bool mail_user_check_namespace_settings(struct mail_user *user,
-                                       const struct mail_storage_settings *set,
-                                       const char **error_r);
+bool mail_user_settings_update_special_use(struct mail_user *user,
+                                          const struct mail_storage_settings *set,
+                                          const char **error_r);
 
 #endif
index e46c80b1307b032d58e47cb7d1d26e8eac78c9b7..75fc7cf3bb56f040bf68b5325747167b3882e35f 100644 (file)
@@ -143,9 +143,12 @@ int mail_user_init(struct mail_user *user, const char **error_r)
 
        i_assert(!user->initialized);
 
+       /* We need to figure out early if we should advertise SPECIAL-USE IMAP
+          capability. The CAPABILITY reply is sent to client before
+          mail_namespaces_init() is called, so it needs to be done here. */
        if (settings_get(user->event, &mail_storage_setting_parser_info, 0,
                         &user->_mail_set, &error) < 0 ||
-           !mail_user_check_namespace_settings(user, user->_mail_set, &error))
+           !mail_user_settings_update_special_use(user, user->_mail_set, &error))
                user->error = p_strdup(user->pool, error);
        else
                mail_user_expand_plugins_envs(user, user->_mail_set);