]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Expand settings to fix rawlog_dir
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 6 Oct 2017 11:39:00 +0000 (14:39 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Fri, 6 Oct 2017 12:41:25 +0000 (15:41 +0300)
Even if %variables weren't used in rawlog_dir, the path was always prefixed
with "0".

src/pop3/main.c

index 051d5df8d2a2c62e9fc69fa4dc34f0c159c21638..f9de457bc23f838be05e35dc0ea4b59896f37353 100644 (file)
@@ -10,6 +10,7 @@
 #include "str.h"
 #include "process-title.h"
 #include "restrict-access.h"
+#include "settings-parser.h"
 #include "master-service.h"
 #include "master-login.h"
 #include "master-interface.h"
@@ -102,7 +103,8 @@ client_create_from_input(const struct mail_storage_service_input *input,
                "-ERR [SYS/TEMP] "MAIL_ERRSTR_CRITICAL_MSG"\r\n";
        struct mail_storage_service_user *user;
        struct mail_user *mail_user;
-       const struct pop3_settings *set;
+       struct pop3_settings *set;
+       const char *errstr;
 
        if (mail_storage_service_lookup_next(storage_service, input,
                                             &user, &mail_user, error_r) <= 0) {
@@ -117,6 +119,15 @@ client_create_from_input(const struct mail_storage_service_input *input,
        if (set->verbose_proctitle)
                verbose_proctitle = TRUE;
 
+       if (settings_var_expand(&pop3_setting_parser_info, set,
+                               mail_user->pool, mail_user_var_expand_table(mail_user),
+                               &errstr) <= 0) {
+               *error_r = t_strdup_printf("Failed to expand settings: %s", errstr);
+               mail_user_unref(&mail_user);
+               mail_storage_service_user_unref(&user);
+               return -1;
+       }
+
        *client_r = client_create(fd_in, fd_out, input->session_id,
                                  mail_user, user, set);