diff --git a/src/lib-sieve/plugins/vacation/cmd-vacation.c b/src/lib-sieve/plugins/vacation/cmd-vacation.c
index 15c2fb9c35261d755b5eff6b53743b2f3f1b4b03..9aa77de60b885e7388e132c3c204a873a2fb5d3a 100644
--- a/src/lib-sieve/plugins/vacation/cmd-vacation.c
+++ b/src/lib-sieve/plugins/vacation/cmd-vacation.c
@@ -1053,8 +1053,8 @@ act_vacation_get_default_subject(const struct sieve_action_exec_env *aenv,
 
 	str = t_str_new(256);
 	tab = _get_var_expand_table(aenv, header);
-	if (var_expand(str, config->default_subject_template,
-		       tab, &error) <= 0) {
+	if (var_expand_with_table(str, config->default_subject_template,
+				  tab, &error) <= 0) {
 		e_error(aenv->event,
 			"Failed to expand deliver_log_format=%s: %s",
 			config->default_subject_template, error);
diff --git a/src/plugins/lda-sieve/lda-sieve-plugin.c b/src/plugins/lda-sieve/lda-sieve-plugin.c
index ea9f2dfab6088b79aaa5dd0cf278cb06a405a707..bc688ba2d6490c3b84dd1977b376ac9ac3014bcd 100644
--- a/src/plugins/lda-sieve/lda-sieve-plugin.c
+++ b/src/plugins/lda-sieve/lda-sieve-plugin.c
@@ -214,8 +214,8 @@ lda_sieve_result_amend_log_message(const struct sieve_script_env *senv,
 	table = mail_deliver_ctx_get_log_var_expand_table(mdctx, message);
 
 	str = t_str_new(256);
-	if (var_expand(str, mdctx->set->deliver_log_format,
-		       table, &error) <= 0) {
+	if (var_expand_with_table(str, mdctx->set->deliver_log_format,
+				  table, &error) <= 0) {
 		e_error(mdctx->event,
 			"Failed to expand deliver_log_format=%s: %s",
 			mdctx->set->deliver_log_format, error);