From 99b7d55b9fc4972eadaaf6ac0dcdc31c2e44adf1 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@open-xchange.com>
Date: Mon, 11 Nov 2024 23:08:27 +0100
Subject: [PATCH] lib-sieve: vacation extension: Rename settings to better
 match Dovecot conventions

---
 src/lib-sieve/plugins/vacation/cmd-vacation.c          | 2 +-
 src/lib-sieve/plugins/vacation/ext-vacation-settings.c | 4 ++--
 src/lib-sieve/plugins/vacation/ext-vacation-settings.h | 2 +-
 tests/extensions/vacation/reply.svtest                 | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lib-sieve/plugins/vacation/cmd-vacation.c b/src/lib-sieve/plugins/vacation/cmd-vacation.c
index 0c81af841..4fa0784cc 100644
--- a/src/lib-sieve/plugins/vacation/cmd-vacation.c
+++ b/src/lib-sieve/plugins/vacation/cmd-vacation.c
@@ -1504,7 +1504,7 @@ act_vacation_commit(const struct sieve_action_exec_env *aenv,
 
 	/* My address not found in the headers; we got an implicit delivery */
 	if (*hdsp == NULL) {
-		if (extctx->set->dont_check_recipient) {
+		if (!extctx->set->check_recipient) {
 			/* Send reply from envelope recipient address */
 			smtp_from = (orig_recipient == NULL ?
 				     recipient : orig_recipient);
diff --git a/src/lib-sieve/plugins/vacation/ext-vacation-settings.c b/src/lib-sieve/plugins/vacation/ext-vacation-settings.c
index a023e3b29..98c29e349 100644
--- a/src/lib-sieve/plugins/vacation/ext-vacation-settings.c
+++ b/src/lib-sieve/plugins/vacation/ext-vacation-settings.c
@@ -26,7 +26,7 @@ static const struct setting_define ext_vacation_setting_defines[] = {
 	DEF(STR, default_subject_template),
 
 	DEF(BOOL, use_original_recipient),
-	DEF(BOOL, dont_check_recipient),
+	DEF(BOOL, check_recipient),
 	DEF(BOOL, send_from_recipient),
 	DEF(BOOL, to_header_ignore_envelope),
 
@@ -40,7 +40,7 @@ static const struct ext_vacation_settings ext_vacation_default_settings = {
 	.default_subject = "",
 	.default_subject_template = "",
 	.use_original_recipient = FALSE,
-	.dont_check_recipient = FALSE,
+	.check_recipient = TRUE,
 	.send_from_recipient = FALSE,
 	.to_header_ignore_envelope = FALSE,
 };
diff --git a/src/lib-sieve/plugins/vacation/ext-vacation-settings.h b/src/lib-sieve/plugins/vacation/ext-vacation-settings.h
index 00f399029..8430101a4 100644
--- a/src/lib-sieve/plugins/vacation/ext-vacation-settings.h
+++ b/src/lib-sieve/plugins/vacation/ext-vacation-settings.h
@@ -12,7 +12,7 @@ struct ext_vacation_settings {
 	const char *default_subject_template;
 
 	bool use_original_recipient;
-	bool dont_check_recipient;
+	bool check_recipient;
 	bool send_from_recipient;
 	bool to_header_ignore_envelope;
 };
diff --git a/tests/extensions/vacation/reply.svtest b/tests/extensions/vacation/reply.svtest
index 55cc58d4f..b7c72a1fe 100644
--- a/tests/extensions/vacation/reply.svtest
+++ b/tests/extensions/vacation/reply.svtest
@@ -516,7 +516,7 @@ Frop!
 test_set "envelope.from" "timo@example.com";
 test_set "envelope.to" "stephan@example.com";
 
-test_config_set "sieve_vacation_dont_check_recipient" "yes";
+test_config_set "sieve_vacation_check_recipient" "no";
 test_config_reload :extension "vacation";
 
 test "Reply for any recipient" {
-- 
GitLab