dovecot-2.0-pigeonhole: Vacation extension: added tests for repl...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Wed Feb 9 20:32:36 EET 2011
details: http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/f74b3b46eb1a
changeset: 1472:f74b3b46eb1a
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Feb 09 19:32:28 2011 +0100
description:
Vacation extension: added tests for reply filtering test suite.
diffstat:
Makefile.am | 1 +
tests/extensions/vacation/reply.svtest | 273 +++++++++++++++++++++++++++++++++++++++
2 files changed, 274 insertions(+), 0 deletions(-)
diffs (288 lines):
diff -r 0b7100d990b2 -r f74b3b46eb1a Makefile.am
--- a/Makefile.am Wed Feb 09 19:31:36 2011 +0100
+++ b/Makefile.am Wed Feb 09 19:32:28 2011 +0100
@@ -105,6 +105,7 @@
tests/extensions/vacation/message.svtest \
tests/extensions/vacation/smtp.svtest \
tests/extensions/vacation/utf-8.svtest \
+ tests/extensions/vacation/reply.svtest \
tests/extensions/enotify/basic.svtest \
tests/extensions/enotify/encodeurl.svtest \
tests/extensions/enotify/valid_notify_method.svtest \
diff -r 0b7100d990b2 -r f74b3b46eb1a tests/extensions/vacation/reply.svtest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/extensions/vacation/reply.svtest Wed Feb 09 19:32:28 2011 +0100
@@ -0,0 +1,273 @@
+require "vnd.dovecot.testsuite";
+require "envelope";
+require "vacation";
+
+test_set "message" text:
+From: sirius at example.com
+To: sirius at example.com
+Cc: stephan at example.com
+Subject: Frop!
+
+Frop!
+.
+;
+
+/*
+ * No reply to own address
+ */
+
+test_set "envelope.from" "stephan at example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "No reply to own address" {
+ vacation "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if test_message :smtp 0 {
+ test_fail "vacation not supposed to send message";
+ }
+}
+
+/*
+ * No reply to alternative address
+ */
+
+test_result_reset;
+
+test_set "envelope.from" "sirius at example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "No reply to alternative address" {
+ vacation :addresses "sirius at example.com" "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if test_message :smtp 0 {
+ test_fail "vacation not supposed to send message";
+ }
+}
+
+/*
+ * No reply to mailing list
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: timo at example.com
+To: dovecot at lists.example.com
+List-ID: <dovecot.lists.example.com>
+Subject: Frop!
+
+Frop!
+.
+;
+
+test_set "envelope.from" "<dovecot-bounces+timo=example.com at lists.example.com>";
+test_set "envelope.to" "dovecot at lists.example.com";
+
+test "No reply to mailing list" {
+ vacation "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if test_message :smtp 0 {
+ test_fail "vacation not supposed to send message";
+ }
+}
+
+
+/*
+ * No reply to bulk mail
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: spam at example.com
+To: stephan at example.com
+Precedence: bulk
+Subject: Frop!
+
+Frop!
+.
+;
+
+test_set "envelope.from" "spam at example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "No reply to bulk mail" {
+ vacation "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if test_message :smtp 0 {
+ test_fail "vacation not supposed to send message";
+ }
+}
+
+/*
+ * No reply to auto-submitted mail
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: spam at example.com
+To: stephan at example.com
+Auto-submitted: yes
+Subject: Frop!
+
+Frop!
+.
+;
+
+test_set "envelope.from" "spam at example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "No reply to auto-submitted mail" {
+ vacation "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if test_message :smtp 0 {
+ test_fail "vacation not supposed to send message";
+ }
+}
+
+/*
+ * No reply to system address
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: dovecot at lists.example.com
+To: stephan at example.com
+Subject: Frop!
+
+Frop!
+.
+;
+
+test_set "envelope.from" "dovecot-request at lists.example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "No reply to system address" {
+ vacation "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if test_message :smtp 0 {
+ test_fail "vacation not supposed to send message";
+ }
+}
+
+/*
+ * No reply to implicitly delivered message
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: timo at example.com
+To: all at example.com
+Subject: Frop!
+
+Frop!
+.
+;
+
+test_set "envelope.from" "timo at example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "No reply for implicitly delivered message" {
+ vacation "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if test_message :smtp 0 {
+ test_fail "vacation not supposed to send message";
+ }
+}
+
+/*
+ * Reply for normal mail
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: timo at example.com
+To: stephan at example.com
+Subject: Frop!
+Auto-submitted: no
+Precedence: normal
+
+Frop!
+.
+;
+
+test_set "envelope.from" "timo at example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "Reply for normal mail" {
+ vacation "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if not test_message :smtp 0 {
+ test_fail "vacation did not reply";
+ }
+}
+
+/*
+ * Reply for :addresses
+ */
+
+test_result_reset;
+
+test_set "message" text:
+From: timo at example.com
+To: all at example.com
+Subject: Frop!
+
+Frop!
+.
+;
+
+test_set "envelope.from" "timo at example.com";
+test_set "envelope.to" "stephan at example.com";
+
+test "Reply for :addresses" {
+ vacation :addresses "all at example.com" "I am gone";
+
+ if not test_result_execute {
+ test_fail "failed to execute vacation";
+ }
+
+ if not test_message :smtp 0 {
+ test_fail "vacation did not reply";
+ }
+}
+
+
+
+
More information about the dovecot-cvs
mailing list