]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add mail_user_var_expand()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 27 Feb 2022 19:21:30 +0000 (20:21 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 23 Nov 2022 10:15:37 +0000 (10:15 +0000)
src/lib-storage/mail-user.c
src/lib-storage/mail-user.h

index bcd397bfe7b8f5bc2e83abdbcc71fdad8167ec50..b7eae3e3c81345d8f1f699e093d831b4374aa06b 100644 (file)
@@ -146,6 +146,15 @@ mail_user_expand_plugins_envs(struct mail_user *user)
        }
 }
 
+int mail_user_var_expand(struct mail_user *user,
+                        const struct setting_parser_info *info, void *set,
+                        const char **error_r)
+{
+       return settings_var_expand_with_funcs(info, set,
+                       user->pool, mail_user_var_expand_table(user),
+                       mail_user_var_expand_func_table, user, error_r);
+}
+
 int mail_user_init(struct mail_user *user, const char **error_r)
 {
        const struct mail_storage_settings *mail_set;
index d695781aa142e667d4c093d022f7ec0c18424a92..cc9efbeff9104545eff10d9a4afd075e7586f1a9 100644 (file)
@@ -156,6 +156,11 @@ void mail_user_set_vars(struct mail_user *user, const char *service,
 /* Return %variable expansion table for the user. */
 const struct var_expand_table *
 mail_user_var_expand_table(struct mail_user *user);
+/* Expand %variables for the user. The settings values may be allocated from
+   user->pool. Returns the same as settings_var_expand_with_funcs(). */
+int mail_user_var_expand(struct mail_user *user,
+                        const struct setting_parser_info *info, void *set,
+                        const char **error_r);
 
 /* Specify the user's home directory. This should be called also when it's
    known that the user doesn't have a home directory to avoid the internal