From: Timo Sirainen Date: Fri, 6 Oct 2017 11:39:00 +0000 (+0300) Subject: pop3: Expand settings to fix rawlog_dir X-Git-Tag: 2.3.0.rc1~874 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c13ec2148cc43cb36f61e781f2514705f563cf47;p=thirdparty%2Fdovecot%2Fcore.git pop3: Expand settings to fix rawlog_dir Even if %variables weren't used in rawlog_dir, the path was always prefixed with "0". --- diff --git a/src/pop3/main.c b/src/pop3/main.c index 051d5df8d2..f9de457bc2 100644 --- a/src/pop3/main.c +++ b/src/pop3/main.c @@ -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);