From 38fb3da0331f3a7645b83141cc40d361a5450fc2 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Sun, 20 Feb 2011 16:42:17 +0100
Subject: [PATCH] Vacation extension: added test for proper From: address when
 replying for Cc'd e-mail.

---
 tests/extensions/vacation/smtp.svtest | 35 +++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/tests/extensions/vacation/smtp.svtest b/tests/extensions/vacation/smtp.svtest
index a1e7ac54c..745192a10 100644
--- a/tests/extensions/vacation/smtp.svtest
+++ b/tests/extensions/vacation/smtp.svtest
@@ -1,6 +1,7 @@
 require "vnd.dovecot.testsuite";
 require "envelope";
 require "vacation";
+require "variables";
 
 test_set "message" text:
 From: stephan@example.org
@@ -120,3 +121,37 @@ test "Envelope.to != To" {
 		test_fail "envelope sender not null";
 	}
 }
+
+test_result_reset;
+
+test_set "message" text:
+From: stephan@example.org
+To: tss@example.net
+Cc: colleague@example.net
+Subject: Frop!
+
+Frop!
+.
+;
+
+test_set "envelope.from" "sirius@example.org";
+test_set "envelope.to" "colleague@example.net";
+
+test "Cc" {
+	vacation "I am gone";
+
+	if not test_result_execute {
+		test_fail "failed to execute vacation";
+	}
+
+	test_message :smtp 0;
+
+	if not address :is "from" "colleague@example.net" {
+		if address :matches "from" "*" { }
+		test_fail "from address incorrect: ${1}";
+	}
+
+	if not envelope :is "from" "" {
+		test_fail "envelope sender not null";
+	}
+}
-- 
GitLab