Commit 68b7dc9d 68b7dc9dacacaf0111de9d636c36ec05e1061172 by Sergey Poznyakoff

Rewrite Sieve testssuite in Autotest.

* mailbox/cfg_parser.y (mu_cfg_create_subtree): Optional prefix
character may be used to alter the separator or to suppress
value splitting.
1 parent 8c76d675
Showing 102 changed files with 1490 additions and 1738 deletions
...@@ -1209,6 +1209,10 @@ AC_ARG_WITH([mh-bindir], ...@@ -1209,6 +1209,10 @@ AC_ARG_WITH([mh-bindir],
1209 [MH_BIN_DIR='${exec_prefix}/bin/mu-mh']) 1209 [MH_BIN_DIR='${exec_prefix}/bin/mu-mh'])
1210 1210
1211 1211
1212 # Initialize the (autotest) test suite.
1213 AC_CONFIG_TESTDIR(tests)
1214 AC_CONFIG_FILES([sieve/tests/Makefile sieve/tests/atlocal])
1215 AM_MISSING_PROG([AUTOM4TE], [autom4te])
1212 1216
1213 dnl Make sysconfdir available to the application 1217 dnl Make sysconfdir available to the application
1214 dnl This must be done LAST, since CPPFLAGS is passed by configure 1218 dnl This must be done LAST, since CPPFLAGS is passed by configure
...@@ -1371,7 +1375,6 @@ AC_CONFIG_FILES([ ...@@ -1371,7 +1375,6 @@ AC_CONFIG_FILES([
1371 mu-aux/Makefile 1375 mu-aux/Makefile
1372 mu-aux/mailutils.spec 1376 mu-aux/mailutils.spec
1373 sieve/Makefile 1377 sieve/Makefile
1374 sieve/testsuite/Makefile
1375 testsuite/Makefile 1378 testsuite/Makefile
1376 ]) 1379 ])
1377 AC_OUTPUT 1380 AC_OUTPUT
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
36 #include <mailutils/iterator.h> 36 #include <mailutils/iterator.h>
37 #include <mailutils/debug.h> 37 #include <mailutils/debug.h>
38 #include <mailutils/mutil.h> 38 #include <mailutils/mutil.h>
39 #include <mailutils/cctype.h>
39 40
40 int mu_cfg_parser_verbose; 41 int mu_cfg_parser_verbose;
41 static mu_list_t /* of mu_cfg_node_t */ parse_node_list; 42 static mu_list_t /* of mu_cfg_node_t */ parse_node_list;
...@@ -1741,25 +1742,53 @@ mu_cfg_create_subtree (const char *path, mu_cfg_node_t **pnode) ...@@ -1741,25 +1742,53 @@ mu_cfg_create_subtree (const char *path, mu_cfg_node_t **pnode)
1741 { 1742 {
1742 int rc; 1743 int rc;
1743 int argc, i; 1744 int argc, i;
1745 char *p;
1744 char **argv; 1746 char **argv;
1745 mu_cfg_locus_t locus; 1747 mu_cfg_locus_t locus;
1746 enum mu_cfg_node_type type; 1748 enum mu_cfg_node_type type;
1747 mu_cfg_node_t *node = NULL; 1749 mu_cfg_node_t *node = NULL;
1750 char *delim = MU_CFG_PATH_DELIM_STR;
1751 char static_delim[2] = { 0, 0 };
1748 1752
1749 locus.file = "<int>"; 1753 locus.file = "<int>";
1750 locus.line = 0; 1754 locus.line = 0;
1751 1755
1752 rc = mu_argcv_get_np (path, strlen (path), MU_CFG_PATH_DELIM_STR, NULL, 0, 1756 if (path[0] == '\\')
1757 {
1758 argv = calloc (2, sizeof (*argv));
1759 if (!argv)
1760 return ENOMEM;
1761 argv[0] = strdup (path + 1);
1762 if (!argv[0])
1763 {
1764 free (argv);
1765 return ENOMEM;
1766 }
1767 argv[1] = NULL;
1768 argc = 1;
1769 rc = 0;
1770 }
1771 else
1772 {
1773 if (mu_ispunct (path[0]))
1774 {
1775 delim = static_delim;
1776 delim[0] = path[0];
1777 path++;
1778 }
1779 rc = mu_argcv_get_np (path, strlen (path), delim, NULL, 0,
1753 &argc, &argv, NULL); 1780 &argc, &argv, NULL);
1781 }
1782
1754 if (rc) 1783 if (rc)
1755 return rc; 1784 return rc;
1756 1785
1757 for (i = argc - 1; i >= 0; i--) 1786 for (i = argc - 1; i >= 0; i--)
1758 { 1787 {
1759 mu_list_t nodelist = NULL; 1788 mu_list_t nodelist = NULL;
1760 char *p = strrchr (argv[i], '=');
1761 mu_config_value_t *label = NULL; 1789 mu_config_value_t *label = NULL;
1762 1790
1791 p = strrchr (argv[i], '=');
1763 type = mu_cfg_node_statement; 1792 type = mu_cfg_node_statement;
1764 if (p) 1793 if (p)
1765 { 1794 {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 ## 02110-1301 USA 18 ## 02110-1301 USA
19 19
20 INCLUDES = @MU_APP_COMMON_INCLUDES@ 20 INCLUDES = @MU_APP_COMMON_INCLUDES@
21 SUBDIRS = testsuite 21 SUBDIRS = tests
22 22
23 bin_PROGRAMS = sieve 23 bin_PROGRAMS = sieve
24 sieve_SOURCES = sieve.c 24 sieve_SOURCES = sieve.c
......
1 atconfig
2 atlocal
3 package.m4
4 status.mf
5 testsuite
6 testsuite.dir
7 testsuite.log
1 # This file is part of GNU Mailutils.
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16
17 EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4
18 DISTCLEANFILES = atconfig $(check_SCRIPTS)
19 MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
20 #SUBDIRS = etc
21
22 ## ------------ ##
23 ## package.m4. ##
24 ## ------------ ##
25
26 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
27 { \
28 echo '# Signature of the current package.'; \
29 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
30 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
31 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
32 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
33 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
34 } >$(srcdir)/package.m4
35
36 #
37
38 ## ------------ ##
39 ## Test suite. ##
40 ## ------------ ##
41
42 TESTSUITE_AT = \
43 action.at\
44 address.at\
45 allof.at\
46 anyof.at\
47 compile.at\
48 envelope.at\
49 exists.at\
50 ext.at\
51 false.at\
52 header.at\
53 i-casemap.at\
54 i-numeric.at\
55 i-octet.at\
56 mul-addr.at\
57 not.at\
58 redirect.at\
59 reject.at\
60 relational.at\
61 size.at\
62 true.at\
63 testsuite.at\
64 version.at
65
66 TESTSUITE = $(srcdir)/testsuite
67 M4=m4
68
69 AUTOTEST = $(AUTOM4TE) --language=autotest
70 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
71 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
72 $(AM_V_at)mv $@.tmp $@
73
74 atconfig: $(top_builddir)/config.status
75 cd $(top_builddir) && ./config.status tests/$@
76
77 clean-local:
78 @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
79
80 check-local: atconfig atlocal $(TESTSUITE)
81 @$(SHELL) $(TESTSUITE)
82
83 # Run the test suite on the *installed* tree.
84 #installcheck-local:
85 # $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
86
87
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([action stop], [], [stop;],[],[0],[],
19 [STOP on msg uid 1
20 STOP on msg uid 2
21 STOP on msg uid 3
22 ])
23
24 MUT_TESTCASE([action null],[],[],[],[0],[],
25 [IMPLICIT KEEP on msg uid 1
26 IMPLICIT KEEP on msg uid 2
27 IMPLICIT KEEP on msg uid 3
28 ])
29
30 MUT_TESTCASE([action keep],[],[keep;],[],[0],[],
31 [KEEP on msg uid 1
32 KEEP on msg uid 2
33 KEEP on msg uid 3
34 ])
35
36 MUT_TESTCASE([action discard],[],[discard;],[],[0],[],
37 [DISCARD on msg uid 1: marking as deleted
38 DISCARD on msg uid 2: marking as deleted
39 DISCARD on msg uid 3: marking as deleted
40 ])
41
42 m4_pushdef([MUT_SIEVE_OPTIONS],[--set ":mailbox:folder=`pwd`"])
43
44 MUT_TESTCASE([action fileinto],[],
45 [require "fileinto";
46 fileinto "+file";
47 ],
48 [cat file
49 ],
50 [0],
51 [From coyote@desert.example.org Sun May 6 22:16:47 2001
52 From: coyote@desert.example.org
53 To: roadrunner@acme.example.com
54 Subject: I have a present for you
55 X-Caffeine: C8H10N4O2
56
57 Look, I'm sorry about the whole anvil thing, and I really
58 didn't mean to try and drop it on you from the top of the
59 cliff. I want to try to make it up to you. I've got some
60 great birdseed over here at my place--top of the line
61 stuff--and if you come by, I'll have it all wrapped up
62 for you. I'm really sorry for all the problems I've caused
63 for you over the years, but I know we can work this out.
64
65 --
66 Wile E. Coyote "Super Genius" coyote@desert.example.org
67
68 From b1ff@de.res.example.com Sun May 6 22:17:15 2001
69 From: youcouldberich!@reply-by-postal-mail.invalid
70 To: rube@landru.example.edu
71 Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
72 Date: TBD
73 X-Number: 0015
74
75 YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
76 IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
77 GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
78 MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
79 $20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
80 !!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
81 SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
82
83 From bar@dontmailme.org Fri Dec 28 23:28:09 2001
84 Received: (from bar@dontmailme.org)
85 by dontmailme.org id fERKR9N16790
86 for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
87 Date: Fri, 28 Dec 2001 23:28:08 +0200
88 From: Bar <bar@dontmailme.org>
89 To: Foo Bar <foobar@nonexistent.net>
90 Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
91 Subject: Coffee
92
93 How about some coffee?
94
95 ],
96 [FILEINTO on msg uid 1: delivering into +file
97 FILEINTO on msg uid 2: delivering into +file
98 FILEINTO on msg uid 3: delivering into +file
99 ])
100
101 m4_popdef([MUT_SIEVE_OPTIONS])
102
103
104
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([address :all],[test address all address-all],
19 [
20 if address :is :all "From" "coyote@desert.example.org" {
21 discard;
22 }
23 ],[],[0],[],
24 [DISCARD on msg uid 1: marking as deleted
25 IMPLICIT KEEP on msg uid 2
26 IMPLICIT KEEP on msg uid 3
27 ])
28
29 MUT_TESTCASE([address :domain],[test address domain address-domain],
30 [
31 if address :is :domain "From" "desert.example.org" {
32 discard;
33 }
34 ],[],[0],[],
35 [DISCARD on msg uid 1: marking as deleted
36 IMPLICIT KEEP on msg uid 2
37 IMPLICIT KEEP on msg uid 3
38 ])
39
40 MUT_TESTCASE([address :localpart],[test address localpart address-localpart],
41 [
42 if address :is :localpart "From" "youcouldberich!" {
43 discard;
44 }
45 ],[],[0],[],
46 [IMPLICIT KEEP on msg uid 1
47 DISCARD on msg uid 2: marking as deleted
48 IMPLICIT KEEP on msg uid 3
49 ])
50
51 MUT_TESTCASE([address :matches],[test address matches address-matches],
52 [
53 if address :matches :all "From" "*invalid" {
54 discard;
55 }
56 ],[],[0],[],
57 [IMPLICIT KEEP on msg uid 1
58 DISCARD on msg uid 2: marking as deleted
59 IMPLICIT KEEP on msg uid 3
60 ])
61
62
63
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([allof 00],[test allof allof00],
19 [
20 if allof(false,false) {
21 discard;
22 }
23 ],[],[0],[],
24 [IMPLICIT KEEP on msg uid 1
25 IMPLICIT KEEP on msg uid 2
26 IMPLICIT KEEP on msg uid 3
27 ])
28
29 MUT_TESTCASE([allof 01],[test allof allof01],
30 [
31 if allof(false,true) {
32 discard;
33 }
34 ],[],[0],[],
35 [IMPLICIT KEEP on msg uid 1
36 IMPLICIT KEEP on msg uid 2
37 IMPLICIT KEEP on msg uid 3
38 ])
39
40 MUT_TESTCASE([allof 11],[test allof allof11],
41 [
42 if allof(true,true) {
43 discard;
44 }
45 ],[],[0],[],
46 [DISCARD on msg uid 1: marking as deleted
47 DISCARD on msg uid 2: marking as deleted
48 DISCARD on msg uid 3: marking as deleted
49 ])
50
51
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([anyof 00],[test anyof anyof00],
19 [
20 if anyof(false,false) {
21 discard;
22 }
23 ],[],[0],[],
24 [IMPLICIT KEEP on msg uid 1
25 IMPLICIT KEEP on msg uid 2
26 IMPLICIT KEEP on msg uid 3
27 ])
28
29 MUT_TESTCASE([anyof 01],[test anyof anyof01],
30 [
31 if anyof(false,true) {
32 discard;
33 }
34 ],[],[0],[],
35 [DISCARD on msg uid 1: marking as deleted
36 DISCARD on msg uid 2: marking as deleted
37 DISCARD on msg uid 3: marking as deleted
38 ])
39
40 MUT_TESTCASE([anyof 11],[test anyof anyof11],
41 [
42 if anyof(true,true) {
43 discard;
44 }
45 ],[],[0],[],
46 [DISCARD on msg uid 1: marking as deleted
47 DISCARD on msg uid 2: marking as deleted
48 DISCARD on msg uid 3: marking as deleted
49 ])
50
51
1 # @configure_input@ -*- shell-script -*-
2 # Configurable variable values for Mailutils test suite.
3 # Copyright (C) 2004, 2010 Free Software Foundation, Inc.
4
5 PATH=@abs_builddir@:@abs_top_builddir@/sieve:$top_srcdir:$srcdir:$PATH
6 top_srcdir=@abs_top_srcdir@
7 top_builddir=@abs_top_builddir@
8
9 initspool() {
10 test -d data || mkdir data
11 test -d data/spool || mkdir data/spool
12 cp $top_srcdir/testsuite/spool/* data/spool
13 }
14
...\ No newline at end of file ...\ No newline at end of file
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 testcompile([ex-null.sv])
19 testcompile([box.sv])
20 testcompile([ex-1.10.2.sv])
21 testcompile([ex-2.3a.sv])
22 testcompile([ex-2.5.1.sv])
23 testcompile([ex-2.7.3.sv])
24 testcompile([ex-3.1a.sv])
25 testcompile([ex-3.1b.sv])
26 testcompile([ex-4.2.sv])
27 testcompile([ex-4.4a.sv])
28 testcompile([ex-4.4b.sv])
29 testcompile([ex-4.5.sv])
30 testcompile([ex-5.1.sv])
31 testcompile([ex-5.7.sv])
32 testcompile([ex-save-all.sv])
33 testcompile([example.sv])
34 testcompile([exn-2.3b.sv])
35
36 dnl t-complex.sv
37 dnl t-exists.sv
38 dnl t-fileinto.sv
39 dnl t-mailutils.sv
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([envelope],[test envelope],
19 [
20 if envelope "from" "coyote@desert.example.org" {
21 discard;
22 }
23 ],[],[0],[],
24 [DISCARD on msg uid 1: marking as deleted
25 IMPLICIT KEEP on msg uid 2
26 IMPLICIT KEEP on msg uid 3
27 ])
28
29
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([exists: single header],[test exists exists01],
19 [
20 if exists "X-Caffeine" {
21 discard;
22 }
23 ],[],[0],[],
24 [DISCARD on msg uid 1: marking as deleted
25 IMPLICIT KEEP on msg uid 2
26 IMPLICIT KEEP on msg uid 3
27 ])
28
29 MUT_TESTCASE([exists: array],[test exists exists02],
30 [
31 if exists [["X-Caffeine", "From"]] {
32 discard;
33 }
34 ],[],[0],[],
35 [DISCARD on msg uid 1: marking as deleted
36 IMPLICIT KEEP on msg uid 2
37 IMPLICIT KEEP on msg uid 3
38 ])
39
40 MUT_TESTCASE([exists: array 2],[test exists exists03],
41 [
42 if exists [["X-Caffeine", "X-Status"]] {
43 discard;
44 }
45 ],[],[0],[],
46 [IMPLICIT KEEP on msg uid 1
47 IMPLICIT KEEP on msg uid 2
48 IMPLICIT KEEP on msg uid 3
49 ])
50
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 AT_SETUP([loadable extensions: numaddr])
19 AT_KEYWORDS([ext])
20
21 AT_CHECK([
22 MUT_PREREQ_CAPA([HAVE_LIBLTDL])
23
24 AT_DATA([prog],[
25 require "test-numaddr";
26
27 if numaddr [[ "to", "cc" ]] :over 5
28 {
29 discard;
30 }
31 ])
32
33 cp $top_srcdir/testsuite/spool/bigto.mbox .
34
35 sieve MUT_SIEVE_CMDLINE dnl
36 --clearpath -L "${top_builddir}/examples" -f ./bigto.mbox prog
37 ],
38 [0],
39 [],
40 [DISCARD on msg uid 1: marking as deleted
41 ])
42
43 AT_CLEANUP
44
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([false],[test constant false],
19 [
20 if false {
21 discard;
22 }
23 ],[],[0],[],
24 [IMPLICIT KEEP on msg uid 1
25 IMPLICIT KEEP on msg uid 2
26 IMPLICIT KEEP on msg uid 3
27 ])
28
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([header :is],[test header header-is],
19 [
20 if header :is "X-Caffeine" "C8H10N4O2" {
21 discard;
22 }
23 ],[],[0],[],
24 [DISCARD on msg uid 1: marking as deleted
25 IMPLICIT KEEP on msg uid 2
26 IMPLICIT KEEP on msg uid 3
27 ])
28
29 MUT_TESTCASE([header arrays],[test header header-arrays],
30 [
31 if header [["X-Caffeine","Subject"] ["C8H10N4O2","Coffee"]] {
32 discard;
33 }
34 ],[],[0],[],
35 [DISCARD on msg uid 1: marking as deleted
36 IMPLICIT KEEP on msg uid 2
37 DISCARD on msg uid 3: marking as deleted
38 ])
39
40 MUT_TESTCASE([header :matches],[test header matches header-matches],
41 [
42 if header :matches "Subject" "*$$$*" {
43 discard;
44 }
45 ],[],[0],[],
46 [IMPLICIT KEEP on msg uid 1
47 DISCARD on msg uid 2: marking as deleted
48 IMPLICIT KEEP on msg uid 3
49 ])
50
51 m4_pushdef([MUT_SIEVE_MAILBOX],[mbox1])
52 MUT_TESTCASE([header :mime],[test header header-mime],
53 [
54 if header :mime :is "Content-Description" "How doth" {
55 discard;
56 }
57 ],[],[0],[],
58 [IMPLICIT KEEP on msg uid 1
59 IMPLICIT KEEP on msg uid 2
60 DISCARD on msg uid 3: marking as deleted
61 IMPLICIT KEEP on msg uid 4
62 IMPLICIT KEEP on msg uid 5
63 ])
64 m4_popdef([MUT_SIEVE_MAILBOX])
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([i-casemap :is],[comparator i-casemap i-casemap-is],
19 [
20 require "comparator-i;ascii-casemap";
21
22 if header :comparator "i;ascii-casemap" :is "to" "roadrunner@ACME.EXAMPLE.COM"
23 {
24 discard;
25 }
26 ],[],[0],[],
27 [DISCARD on msg uid 1: marking as deleted
28 IMPLICIT KEEP on msg uid 2
29 IMPLICIT KEEP on msg uid 3
30 ])
31
32 MUT_TESTCASE([i-casemap :matches],[comparator i-casemap i-casemap-matches],
33 [
34 require "comparator-i;ascii-casemap";
35
36 if header :comparator "i;ascii-casemap" :matches "subject" "*you, too,*"
37 {
38 discard;
39 }
40 ],[],[0],[],
41 [IMPLICIT KEEP on msg uid 1
42 DISCARD on msg uid 2: marking as deleted
43 IMPLICIT KEEP on msg uid 3
44 ])
45
46 MUT_TESTCASE([i-casemap :contains],[comparator i-casemap i-casemap-contains],
47 [
48 require "comparator-i;ascii-casemap";
49
50 if header :comparator "i;ascii-casemap" :contains [["from", "to"]] "ExAmPLe"
51 {
52 discard;
53 }
54 ],[],[0],[],
55 [DISCARD on msg uid 1: marking as deleted
56 DISCARD on msg uid 2: marking as deleted
57 IMPLICIT KEEP on msg uid 3
58 ])
59
60 MUT_TESTCASE([i-casemap :regex],[comparator i-casemap i-casemap-regex],
61 [
62 require "comparator-i;ascii-casemap";
63
64 if header :comparator "i;ascii-casemap" :regex "subject" ".*you.*"
65 {
66 discard;
67 }
68 ],[],[0],[],
69 [DISCARD on msg uid 1: marking as deleted
70 DISCARD on msg uid 2: marking as deleted
71 IMPLICIT KEEP on msg uid 3
72 ])
73
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([i-numeric :is], [comparator i-numeric is i-numeric-is],
19 [
20 require "comparator-i;ascii-numeric";
21
22 if header :comparator "i;ascii-numeric" :is "X-Number" "15"
23 {
24 discard;
25 }
26 ],[],[0],[],
27 [IMPLICIT KEEP on msg uid 1
28 DISCARD on msg uid 2: marking as deleted
29 IMPLICIT KEEP on msg uid 3
30 ])
31
32 AT_SETUP([i-numeric with contains])
33 AT_KEYWORDS([comparator i-numeric is i-numeric-contains])
34 MUT_SIEVE_COMPILE([
35 require "comparator-i;ascii-numeric";
36
37 if header :comparator "i;ascii-numeric" :contains "X-Number" "15"
38 {
39 discard;
40 }
41 ],[78],[],
42 [sieve: prog:5: comparator `i;ascii-numeric' is incompatible with match type `contains' in call to `header'
43 ])
44 AT_CLEANUP
45
46
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([i-octet :is],[comparator i-octet is i-octet-is],
19 [
20 require "comparator-i;octet";
21
22 if header :comparator "i;octet" :is "to" "roadrunner@acme.example.com"
23 {
24 discard;
25 }
26 ],[],[0],[],
27 [DISCARD on msg uid 1: marking as deleted
28 IMPLICIT KEEP on msg uid 2
29 IMPLICIT KEEP on msg uid 3
30 ])
31
32 MUT_TESTCASE([i-octet :matches],[comparator i-octet matches i-octet-matches],
33 [
34 require "comparator-i;octet";
35
36 if header :comparator "i;octet" :matches "subject" "$$$*$$$"
37 {
38 discard;
39 }
40 ],[],[0],[],
41 [IMPLICIT KEEP on msg uid 1
42 DISCARD on msg uid 2: marking as deleted
43 IMPLICIT KEEP on msg uid 3
44 ])
45
46 MUT_TESTCASE([i-octet :contains],[comparator i-octet contains i-octet-contains],
47 [
48 require "comparator-i;octet";
49
50 if header :comparator "i;octet" :contains [["from", "to"]] "example"
51 {
52 discard;
53 }
54 ],[],[0],[],
55 [DISCARD on msg uid 1: marking as deleted
56 DISCARD on msg uid 2: marking as deleted
57 IMPLICIT KEEP on msg uid 3
58 ])
59
60 MUT_TESTCASE([i-octet :regex],[comparator i-octet regex i-octet-regex],
61 [
62 require "comparator-i;octet";
63
64 if header :comparator "i;octet" :regex "subject" ".*you.*"
65 {
66 discard;
67 }
68 ],[],[0],[],
69 [DISCARD on msg uid 1: marking as deleted
70 IMPLICIT KEEP on msg uid 2
71 IMPLICIT KEEP on msg uid 3
72 ])
73
74
75
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 m4_pushdef([MUT_SIEVE_MAILBOX],[relational.mbox])
19 MUT_TESTCASE([multiple addresses],[test address mul-addr],
20 [
21 require "fileinto";
22
23 if address :localpart :is [["To", "Cc"]] [[ "foo", "oof" ]]
24 {
25 discard;
26 }
27 ],[],[0],[],
28 [DISCARD on msg uid 1: marking as deleted
29 DISCARD on msg uid 2: marking as deleted
30 DISCARD on msg uid 3: marking as deleted
31 DISCARD on msg uid 4: marking as deleted
32 DISCARD on msg uid 5: marking as deleted
33 DISCARD on msg uid 6: marking as deleted
34 DISCARD on msg uid 7: marking as deleted
35 IMPLICIT KEEP on msg uid 8
36 DISCARD on msg uid 9: marking as deleted
37 ])
38 m4_popdef([MUT_SIEVE_MAILBOX])
39
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([not], [test not boolean],
19 [
20 if not false {
21 discard;
22 }
23 ],[],[0],[],
24 [DISCARD on msg uid 1: marking as deleted
25 DISCARD on msg uid 2: marking as deleted
26 DISCARD on msg uid 3: marking as deleted
27 ])
28
29
1 # This file is part of Mailutils testsuite. 1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc. 2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 # 3 #
4 # This program is free software; you can redistribute it and/or modify 4 # GNU Mailutils is free software; you can redistribute it and/or
5 # it under the terms of the GNU General Public License as published by 5 # modify it under the terms of the GNU General Public License as
6 # the Free Software Foundation; either version 3 of the License, or 6 # published by the Free Software Foundation; either version 3, or (at
7 # (at your option) any later version. 7 # your option) any later version.
8 # 8 #
9 # This program is distributed in the hope that it will be useful, 9 # This program is distributed in the hope that it will be useful, but
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # GNU General Public License for more details. 12 # General Public License for more details.
13 # 13 #
14 # You should have received a copy of the GNU General Public License 14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation, 15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 # This file is part of Mailfromd testsuite.
17 #
18 17
19 TEST redirect.sv 18 AT_SETUP([redirect])
20 PATTERN BEGIN 19 AT_KEYWORDS([action])
21 REDIRECT on msg uid 1: to gray@gnu.org 20
22 REDIRECT on msg uid 2: to gray@gnu.org 21 AT_CHECK([
23 REDIRECT on msg uid 3: to gray@gnu.org 22 MUT_PREREQ_CAPA([ENABLE_SENDMAIL])
24 PATTERN END 23 MTA_DIAG=`pwd`/mta.diag
24 MTA_APPEND=1
25 export MTA_DIAG MTA_APPEND
25 26
26 FILE BEGIN 27 AT_DATA([prog],[
27 ENVELOPE FROM: coyote@desert.example.org 28 require "redirect";
29
30 redirect "gray@gnu.org";
31 ])
32 cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
33
34 sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
35 sed 's/ $//' ./mta.diag
36 ],
37 [0],
38 [ENVELOPE FROM: coyote@desert.example.org
28 ENVELOPE TO: <gray@gnu.org> 39 ENVELOPE TO: <gray@gnu.org>
29 0: X-Loop-Prevention: foobar@nonexistent.net 40 0: X-Loop-Prevention: foobar@nonexistent.net
30 1: From: coyote@desert.example.org 41 1: From: coyote@desert.example.org
...@@ -77,7 +88,10 @@ ENVELOPE TO: <gray@gnu.org> ...@@ -77,7 +88,10 @@ ENVELOPE TO: <gray@gnu.org>
77 10: How about some coffee? 88 10: How about some coffee?
78 11: 89 11:
79 END OF MESSAGE 90 END OF MESSAGE
80 FILE END 91 ],
81 TEST END 92 [REDIRECT on msg uid 1: to gray@gnu.org
93 REDIRECT on msg uid 2: to gray@gnu.org
94 REDIRECT on msg uid 3: to gray@gnu.org
95 ])
82 96
83 # End of Redirect 97 AT_CLEANUP
......
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 AT_SETUP([reject])
19 AT_KEYWORDS([action])
20
21 AT_CHECK([
22 MUT_PREREQ_CAPA([ENABLE_SENDMAIL])
23 MTA_DIAG=`pwd`/mta.diag
24 MTA_APPEND=1
25 export MTA_DIAG MTA_APPEND
26
27 AT_DATA([prog],[
28 require "reject";
29
30 reject text:
31 I don't want to read these messages.
32
33 Regards.
34 .
35 ;
36 ])
37
38 AT_DATA([filter.sed],[
39 # mta log contains trailing spaces
40 s/ $//
41 # MIME boundaries are unpredictable, so we replace them with a constant string.
42 s/^\( *[[0-9]][[0-9]]*: Content-Type: .*boundary=\).*/\1(boundary)/
43 s/^\( *[[0-9]][[0-9]]*:\) --[[0-9]].*/\1 --(boundary)/
44 # Same goes for dates.
45 s/^\( *[[0-9]][[0-9]]*: The original message was received at *\).*\( from .*\)/\1(date)\2/
46 s/^\( *[[0-9]][[0-9]]*: Last-Attempt-Date:\).*/\1 (date)/
47 ])
48
49 cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
50
51 sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
52 sed -f filter.sed ./mta.diag
53 ],
54 [0],
55 [ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
56 ENVELOPE TO: <coyote@desert.example.org>
57 0: To: coyote@desert.example.org
58 1: Content-Type: multipart/mixed; boundary=(boundary)
59 2: MIME-Version: 1.0
60 3:
61 4: --(boundary)
62 5: Content-Type: text/plain;charset=UTF-8
63 6: Content-Transfer-Encoding: 8bit
64 7:
65 8: The original message was received at (date) from coyote@desert.example.org.
66 9: Message was refused by recipient's mail filtering program.
67 10: Reason given was as follows:
68 11:
69 12: I don't want to read these messages.
70 13:
71 14: Regards.
72 15:
73 16: --(boundary)
74 17: Content-Type: message/delivery-status
75 18:
76 19: Reporting-UA: sieve; GNU Mailutils 2.2.90
77 20: Arrival-Date: Mon, May 07 01:16:47 2001 EEST
78 21: Final-Recipient: RFC822; foobar@nonexistent.net
79 22: Action: deleted
80 23: Disposition: automatic-action/MDN-sent-automatically;deleted
81 24: Last-Attempt-Date: (date)
82 25:
83 26: --(boundary)
84 27: Content-Type: message/rfc822
85 28:
86 29: From: coyote@desert.example.org
87 30: To: roadrunner@acme.example.com
88 31: Subject: I have a present for you
89 32: X-Caffeine: C8H10N4O2
90 33:
91 34: Look, I'm sorry about the whole anvil thing, and I really
92 35: didn't mean to try and drop it on you from the top of the
93 36: cliff. I want to try to make it up to you. I've got some
94 37: great birdseed over here at my place--top of the line
95 38: stuff--and if you come by, I'll have it all wrapped up
96 39: for you. I'm really sorry for all the problems I've caused
97 40: for you over the years, but I know we can work this out.
98 41:
99 42: --
100 43: Wile E. Coyote "Super Genius" coyote@desert.example.org
101 44:
102 45: --(boundary)
103 46:
104 END OF MESSAGE
105 ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
106 ENVELOPE TO: <b1ff@de.res.example.com>
107 0: To: b1ff@de.res.example.com
108 1: Content-Type: multipart/mixed; boundary=(boundary)
109 2: MIME-Version: 1.0
110 3:
111 4: --(boundary)
112 5: Content-Type: text/plain;charset=UTF-8
113 6: Content-Transfer-Encoding: 8bit
114 7:
115 8: The original message was received at (date) from b1ff@de.res.example.com.
116 9: Message was refused by recipient's mail filtering program.
117 10: Reason given was as follows:
118 11:
119 12: I don't want to read these messages.
120 13:
121 14: Regards.
122 15:
123 16: --(boundary)
124 17: Content-Type: message/delivery-status
125 18:
126 19: Reporting-UA: sieve; GNU Mailutils 2.2.90
127 20: Arrival-Date: Mon, May 07 01:17:15 2001 EEST
128 21: Final-Recipient: RFC822; foobar@nonexistent.net
129 22: Action: deleted
130 23: Disposition: automatic-action/MDN-sent-automatically;deleted
131 24: Last-Attempt-Date: (date)
132 25:
133 26: --(boundary)
134 27: Content-Type: message/rfc822
135 28:
136 29: From: youcouldberich!@reply-by-postal-mail.invalid
137 30: To: rube@landru.example.edu
138 31: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
139 32: Date: TBD
140 33: X-Number: 0015
141 34:
142 35: YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
143 36: IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
144 37: GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
145 38: MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
146 39: $20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
147 40: !!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
148 41: SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
149 42:
150 43: --(boundary)
151 44:
152 END OF MESSAGE
153 ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
154 ENVELOPE TO: <bar@dontmailme.org>
155 0: To: bar@dontmailme.org
156 1: Content-Type: multipart/mixed; boundary=(boundary)
157 2: MIME-Version: 1.0
158 3:
159 4: --(boundary)
160 5: Content-Type: text/plain;charset=UTF-8
161 6: Content-Transfer-Encoding: 8bit
162 7:
163 8: The original message was received at (date) from bar@dontmailme.org.
164 9: Message was refused by recipient's mail filtering program.
165 10: Reason given was as follows:
166 11:
167 12: I don't want to read these messages.
168 13:
169 14: Regards.
170 15:
171 16: --(boundary)
172 17: Content-Type: message/delivery-status
173 18:
174 19: Reporting-UA: sieve; GNU Mailutils 2.2.90
175 20: Arrival-Date: Sat, Dec 29 01:28:09 2001 EET
176 21: Final-Recipient: RFC822; foobar@nonexistent.net
177 22: Action: deleted
178 23: Disposition: automatic-action/MDN-sent-automatically;deleted
179 24: Last-Attempt-Date: (date)
180 25:
181 26: --(boundary)
182 27: Content-Type: message/rfc822
183 28:
184 29: Received: (from bar@dontmailme.org)
185 30: by dontmailme.org id fERKR9N16790
186 31: for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
187 32: Date: Fri, 28 Dec 2001 23:28:08 +0200
188 33: From: Bar <bar@dontmailme.org>
189 34: To: Foo Bar <foobar@nonexistent.net>
190 35: Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
191 36: Subject: Coffee
192 37:
193 38: How about some coffee?
194 39:
195 40: --(boundary)
196 41:
197 END OF MESSAGE
198 ],
199 [REJECT on msg uid 1
200 REJECT on msg uid 2
201 REJECT on msg uid 3
202 ])
203
204 AT_CLEANUP
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 m4_pushdef([MUT_SIEVE_MAILBOX],[relational.mbox])
19 m4_pushdef([MUT_SIEVE_OPTIONS],[--set ":mailbox:folder=`pwd`"])
20
21 MUT_TESTCASE([relational address],[test relational address comparator i-ascii-numeric],
22 [
23 require [["relational", "comparator-i;ascii-numeric"]];
24
25 if address :count "ge" :comparator "i;ascii-numeric" [["to", "cc"] ["3"]]
26 {
27 discard;
28 }
29 ],[],[0],[],
30 [DISCARD on msg uid 1: marking as deleted
31 IMPLICIT KEEP on msg uid 2
32 IMPLICIT KEEP on msg uid 3
33 IMPLICIT KEEP on msg uid 4
34 IMPLICIT KEEP on msg uid 5
35 IMPLICIT KEEP on msg uid 6
36 IMPLICIT KEEP on msg uid 7
37 IMPLICIT KEEP on msg uid 8
38 DISCARD on msg uid 9: marking as deleted
39 ])
40
41 MUT_TESTCASE([relational header],[test relational header comparator i-ascii-numeric],
42 [
43 require [["relational", "comparator-i;ascii-numeric"]];
44
45 if header :count "gt" [["received"]] [["2"]]
46 {
47 discard;
48 }
49 ],[],[0],[],
50 [IMPLICIT KEEP on msg uid 1
51 IMPLICIT KEEP on msg uid 2
52 IMPLICIT KEEP on msg uid 3
53 IMPLICIT KEEP on msg uid 4
54 IMPLICIT KEEP on msg uid 5
55 IMPLICIT KEEP on msg uid 6
56 IMPLICIT KEEP on msg uid 7
57 IMPLICIT KEEP on msg uid 8
58 DISCARD on msg uid 9: marking as deleted
59 ])
60
61 MUT_TESTCASE([relational big test],[test relational relational-hairy],
62 [
63 require [["relational", "comparator-i;ascii-numeric", "fileinto"]];
64
65 if header :value "lt" :comparator "i;ascii-numeric" [["x-priority"]] [["3"]]
66 {
67 fileinto "%Priority";
68 }
69 elsif address :count "gt" :comparator "i;ascii-numeric" [["to"]] [["5"]]
70 {
71 # everything with more than 5 recipients in the "to" field
72 # is considered SPAM
73 fileinto "%SPAM";
74 }
75 elsif address :value "gt" :all :comparator "i;ascii-casemap" [["from"]] [["M"]]
76 {
77 fileinto "%From_N-Z";
78 }
79 else
80 {
81 fileinto "%From_A-M";
82 }
83
84 if allof (address :count "eq" :comparator "i;ascii-numeric"
85 [["to", "cc"]] [["1"]] ,
86 address :all :comparator "i;ascii-casemap"
87 [["to", "cc"]] [["me@foo.example.com.invalid"]])
88 {
89 fileinto "%Only_me";
90 }
91 ],[],[0],[],
92 [FILEINTO on msg uid 1: delivering into %From_A-M
93 FILEINTO on msg uid 2: delivering into %From_N-Z
94 FILEINTO on msg uid 3: delivering into %Priority
95 FILEINTO on msg uid 4: delivering into %Priority
96 FILEINTO on msg uid 5: delivering into %Priority
97 FILEINTO on msg uid 6: delivering into %From_A-M
98 FILEINTO on msg uid 7: delivering into %From_A-M
99 FILEINTO on msg uid 8: delivering into %From_A-M
100 FILEINTO on msg uid 8: delivering into %Only_me
101 FILEINTO on msg uid 9: delivering into %SPAM
102 ])
103
104 m4_popdef([MUT_SIEVE_MAILBOX])
105 m4_popdef([MUT_SIEVE_OPTIONS])
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([size :under],[test size under size-under],
19 [
20 if size :under 400 {
21 discard;
22 }
23 ],[],[0],[],
24 [IMPLICIT KEEP on msg uid 1
25 IMPLICIT KEEP on msg uid 2
26 DISCARD on msg uid 3: marking as deleted
27 ])
28
29 MUT_TESTCASE([size :over],[test size over size-over],
30 [
31 if size :over 500 {
32 discard;
33 }
34 ],[],[0],[],
35 [DISCARD on msg uid 1: marking as deleted
36 DISCARD on msg uid 2: marking as deleted
37 IMPLICIT KEEP on msg uid 3
38 ])
39
40
41
42
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 # Require a reasonably recent autotest.
19 m4_version_prereq([2.52g])
20
21 m4_define([AT_SKIP_TEST],[exit 77])
22
23 dnl ------------------------------------------------------------
24 dnl testcompile(SCRIPT) -- test compilation of the Sieve SCRIPT
25 dnl
26 m4_define([testcompile],[
27 AT_SETUP([compile $1])
28 AT_CHECK([sieve -c $top_srcdir/sieve/examples/$1],
29 [0])
30 AT_CLEANUP
31 ])
32
33 dnl ------------------------------------------------------------
34 dnl MUT_SIEVE_OPTIONS -- additional command line options for Sieve
35 m4_define([MUT_SIEVE_OPTIONS])
36
37 dnl ------------------------------------------------------------
38 dnl MUT_SIEVE_MAILBOX -- mailbox used for testing
39 m4_define([MUT_SIEVE_MAILBOX],[sieve.mbox])
40
41 dnl ------------------------------------------------------------
42 m4_define([MUT_SIEVE_CMDLINE],[dnl
43 --verbose dnl
44 --line-info=no dnl
45 --no-program-name dnl
46 --no-site-config dnl
47 --no-user-config dnl
48 -M sendmail:$top_builddir/examples/mta dnl
49 --email foobar@nonexistent.net])
50
51 dnl ------------------------------------------------------------
52 dnl MUT_SIEVE_COMPILE(SCRIPT, [ADD-TEST = `'],
53 dnl [STATUS = `0'], [STDOUT = `'], [STDERR = `'],
54 dnl [RUN-IF-FAIL], [RUN-IF-PASS])
55 dnl
56 m4_define([MUT_SIEVE_COMPILE],[
57 AT_DATA([prog],[$1
58 ])
59 AT_CHECK([sieve MUT_SIEVE_OPTIONS -c prog],m4_shift($@))])
60
61 dnl ------------------------------------------------------------
62 dnl MUT_SIEVE_RUN(SCRIPT, MBOX, [ADD-TEST = `'],
63 dnl [STATUS = `0'], [STDOUT = `'], [STDERR = `'],
64 dnl [RUN-IF-FAIL], [RUN-IF-PASS])
65 dnl
66 m4_define([MUT_SIEVE_RUN],[
67 AT_DATA([prog],[$1
68 ])
69 AT_CHECK([sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f $2 prog
70 $3],
71 m4_shift(m4_shift(m4_shift($@))))])
72
73 m4_define([MUT_TESTCASE],[
74 AT_SETUP([$1])
75 AT_KEYWORDS([$2])
76 cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
77 MUT_SIEVE_RUN([$3], ./MUT_SIEVE_MAILBOX, m4_shift(m4_shift(m4_shift($@))))
78 AT_CLEANUP])
79
80 m4_define([MUT_PREREQ_CAPA],[
81 sieve --show-config-options | grep '^$1' > /dev/null 2>&1 || AT_SKIP_TEST
82 ])
83
84 AT_INIT
85
86 AT_TESTED([sieve])
87
88 m4_include([version.at])
89 m4_include([compile.at])
90 m4_include([false.at])
91 m4_include([true.at])
92 m4_include([not.at])
93 m4_include([action.at])
94 m4_include([address.at])
95 m4_include([allof.at])
96 m4_include([anyof.at])
97 m4_include([envelope.at])
98 m4_include([exists.at])
99 m4_include([header.at])
100 m4_include([i-casemap.at])
101 m4_include([i-numeric.at])
102 m4_include([i-octet.at])
103 m4_include([mul-addr.at])
104 m4_include([relational.at])
105 m4_include([size.at])
106 m4_include([redirect.at])
107 m4_include([reject.at])
108 m4_include([ext.at])
109
110
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 MUT_TESTCASE([true],[test constant true],
19 [
20 if true {
21 discard;
22 }
23 ],[],[0],[],
24 [DISCARD on msg uid 1: marking as deleted
25 DISCARD on msg uid 2: marking as deleted
26 DISCARD on msg uid 3: marking as deleted
27 ])
28
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite.
17
18 AT_SETUP([sieve version])
19
20 AT_CHECK([sieve --version | sed '1{s/ *[\[.*\]]//;q}' ],
21 [0],
22 [sieve (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
23 ],
24 [],
25 [cat >$[]XFAILFILE <<'_EOT'
26
27 ==============================================================
28 WARNING: Not using the proper version, *all* checks dubious...
29 ==============================================================
30 _EOT
31 ],
32 [rm -f $[]XFAILFILE])
33
34 AT_CLEANUP
1 Makefile
2 Makefile.in
3 *.log
4 *.sum
5 site.exp
6 remote.exp
7 data
1 ## Process this file with GNU Automake to create Makefile.in
2
3 ## Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 ##
5 ## GNU Mailutils is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU General Public License as
7 ## published by the Free Software Foundation; either version 3, or (at
8 ## your option) any later version.
9 ##
10 ## This program is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
18 ## 02110-1301 USA
19
20 AUTOMAKE_OPTIONS = dejagnu
21 DEJATOOL = sieve
22 RUNTESTFLAGS =
23 CLEANFILES = *.log
24 test_dirs = lib sieve scripts
25 EXTRA_DIST = Reject Redirect
26
27 dist-hook:
28 here=`cd $(top_builddir)/$(subdir) && pwd`; \
29 srcdir=`cd $(srcdir) && pwd`; \
30 distdir=`cd $(distdir) && pwd`; \
31 for dir in $(test_dirs); \
32 do \
33 cd $$srcdir;\
34 mkdir $$distdir/$$dir;\
35 cd $$dir;\
36 for file in DISTFILES `cat DISTFILES`; do \
37 d=$$srcdir/$$dir; \
38 if test -d $$d/$$file; then \
39 cp -pr $$d/$$file $$distdir/$$dir/$$file; \
40 else \
41 test -f $$distdir/$$dir/$$file \
42 || cp -p $$d/$$file $$distdir/$$dir/$$file || exit; \
43 fi; \
44 done;\
45 done;\
46 cd $$here
47
48 site.exp: Makefile remote.exp
49 @echo 'Making a new site.exp file...'
50 @test ! -f site.bak || rm -f site.bak
51 @echo '## these variables are automatically generated by make ##' > $@-t
52 @echo '# Do not edit here. If you wish to override these values' >> $@-t
53 @echo '# edit the last section' >> $@-t
54 @echo 'set tool $(DEJATOOL)' >> $@-t
55 @echo "set top_srcdir `cd $(top_srcdir); pwd`" >> $@-t
56 @echo "set top_builddir `cd $(top_builddir); pwd`" >> $@-t
57 @echo "set srcdir `cd $(srcdir); pwd`" >> $@-t
58 @echo 'set objdir' `pwd` >> $@-t
59 @echo 'set host_alias "$(host_alias)"' >> $@-t
60 @echo 'set host_triplet $(host_triplet)' >> $@-t
61 @echo 'set target_alias "$(target_alias)"' >> $@-t
62 @echo 'set target_triplet $(target_triplet)' >> $@-t
63 @echo 'set build_alias "$(build_alias)"' >> $@-t
64 @echo 'set build_triplet $(build_triplet)' >> $@-t
65 @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
66 @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
67 @test ! -f site.exp || mv site.exp site.bak
68 @mv $@-t site.exp
69
70 remote.exp:;
71 @echo 'Making a new remote.exp file...'
72 @test ! -f remote.bak || rm -f remote.bak
73 @echo '## These variables are used to set up for the remote testing.' >> $@-t
74 @echo '## Please, read file README in this directory for instructions' >> $@-t
75 @echo '## on how to use this file' >> $@-t
76 @echo "set host_board `hostname`" >> $@-t
77 @echo 'set board_info($$host_board,connect) rlogin' >> $@-t
78 @echo 'set board_info($$host_board,shell_prompt) "\\$$ "' >> $@-t
79 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
80 @echo "set board_info(\$$host_board,srcdir) `cd $(srcdir); pwd`" >> $@-t
81 @echo "set board_info(\$$host_board,objdir) `pwd`" >> $@-t
82 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
83 @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
84 @test ! -f remote.exp || mv remote.exp remote.bak
85 @mv $@-t remote.exp
86
87
88 DISTCLEANFILES=*.exp *.log *.sum
89
90 distclean-local:
91 -rm -rf data
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18
19 TEST reject.sv
20 PATTERN BEGIN
21 REJECT on msg uid 1
22 REJECT on msg uid 2
23 REJECT on msg uid 3
24 PATTERN END
25
26 FILE BEGIN
27 ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
28 ENVELOPE TO: <coyote@desert.example.org>
29 0: To: coyote@desert.example.org
30 -re
31 1: Content-Type: multipart/mixed; boundary="[0-9:=-]+"
32 2: MIME-Version: 1.0
33 3:
34 -re
35 4: [0-9:=-]+
36 5: Content-Type: text/plain;charset=UTF-8
37 6: Content-Transfer-Encoding: 8bit
38 7:
39 -re
40 8: The original message was received at [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]* from coyote@desert.example.org.
41 9: Message was refused by recipient's mail filtering program.
42 10: Reason given was as follows:
43 11:
44 12: I don't want to read these messages.
45 13:
46 14: Regards.
47 15:
48 -re
49 16: [0-9:=-]+
50 17: Content-Type: message/delivery-status
51 18:
52 -re
53 19: Reporting-UA: sieve; GNU Mailutils [0-9][0-9.]*
54 -re
55 20: Arrival-Date: [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]*
56 21: Final-Recipient: RFC822; foobar@nonexistent.net
57 22: Action: deleted
58 23: Disposition: automatic-action/MDN-sent-automatically;deleted
59 -re
60 24: Last-Attempt-Date: [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]*
61 25:
62 -re
63 26: [0-9:=-]+
64 27: Content-Type: message/rfc822
65 28:
66 29: From: coyote@desert.example.org
67 30: To: roadrunner@acme.example.com
68 31: Subject: I have a present for you
69 32: X-Caffeine: C8H10N4O2
70 33:
71 34: Look, I'm sorry about the whole anvil thing, and I really
72 35: didn't mean to try and drop it on you from the top of the
73 36: cliff. I want to try to make it up to you. I've got some
74 37: great birdseed over here at my place--top of the line
75 38: stuff--and if you come by, I'll have it all wrapped up
76 39: for you. I'm really sorry for all the problems I've caused
77 40: for you over the years, but I know we can work this out.
78 41:
79 42: --
80 43: Wile E. Coyote "Super Genius" coyote@desert.example.org
81 44:
82 -re
83 45: [0-9:=-]+
84 46:
85 END OF MESSAGE
86 ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
87 ENVELOPE TO: <b1ff@de.res.example.com>
88 0: To: b1ff@de.res.example.com
89 -re
90 1: Content-Type: multipart/mixed; boundary="[0-9:=-]+"
91 2: MIME-Version: 1.0
92 3:
93 -re
94 4: [0-9:=-]+
95 5: Content-Type: text/plain;charset=UTF-8
96 6: Content-Transfer-Encoding: 8bit
97 7:
98 -re
99 8: The original message was received at [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]* from b1ff@de.res.example.com.
100 9: Message was refused by recipient's mail filtering program.
101 10: Reason given was as follows:
102 11:
103 12: I don't want to read these messages.
104 13:
105 14: Regards.
106 15:
107 -re
108 16: [0-9:=-]+
109 17: Content-Type: message/delivery-status
110 18:
111 -re
112 19: Reporting-UA: sieve; GNU Mailutils [0-9][0-9.]*
113 -re
114 20: Arrival-Date: [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]*
115 21: Final-Recipient: RFC822; foobar@nonexistent.net
116 22: Action: deleted
117 23: Disposition: automatic-action/MDN-sent-automatically;deleted
118 -re
119 24: Last-Attempt-Date: [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]*
120 25:
121 -re
122 26: [0-9:=-]+
123 27: Content-Type: message/rfc822
124 28:
125 29: From: youcouldberich!@reply-by-postal-mail.invalid
126 30: To: rube@landru.example.edu
127 31: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
128 32: Date: TBD
129 33: X-Number: 0015
130 34:
131 35: YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
132 36: IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
133 37: GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
134 38: MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
135 39: $20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
136 40: !!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
137 41: SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
138 42:
139 -re
140 43: [0-9:=-]+
141 44:
142 END OF MESSAGE
143 ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
144 ENVELOPE TO: <bar@dontmailme.org>
145 0: To: bar@dontmailme.org
146 -re
147 1: Content-Type: multipart/mixed; boundary="[0-9:=-]+"
148 2: MIME-Version: 1.0
149 3:
150 -re
151 4: [0-9:=-]+
152 5: Content-Type: text/plain;charset=UTF-8
153 6: Content-Transfer-Encoding: 8bit
154 7:
155 -re
156 8: The original message was received at [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]* from bar@dontmailme.org.
157 9: Message was refused by recipient's mail filtering program.
158 10: Reason given was as follows:
159 11:
160 12: I don't want to read these messages.
161 13:
162 14: Regards.
163 15:
164 -re
165 16: [0-9:=-]+
166 17: Content-Type: message/delivery-status
167 18:
168 -re
169 19: Reporting-UA: sieve; GNU Mailutils [0-9][0-9.]*
170 -re
171 20: Arrival-Date: [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]*
172 21: Final-Recipient: RFC822; foobar@nonexistent.net
173 22: Action: deleted
174 23: Disposition: automatic-action/MDN-sent-automatically;deleted
175 -re
176 24: Last-Attempt-Date: [A-Z][a-z][a-z], [A-Z][a-z][a-z] [ 0-3][0-9] [ 0-2][0-9]:[0-6][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9] [a-zA-Z0-9]*
177 25:
178 -re
179 26: [0-9:=-]+
180 27: Content-Type: message/rfc822
181 28:
182 29: Received: (from bar@dontmailme.org)
183 30: by dontmailme.org id fERKR9N16790
184 31: for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
185 32: Date: Fri, 28 Dec 2001 23:28:08 +0200
186 33: From: Bar <bar@dontmailme.org>
187 34: To: Foo Bar <foobar@nonexistent.net>
188 35: Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
189 36: Subject: Coffee
190 37:
191 38: How about some coffee?
192 39:
193 -re
194 40: [0-9:=-]+
195 41:
196 END OF MESSAGE
197 FILE END
198 TEST END
199
200 # End of Reject
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 source $top_srcdir/testsuite/lib/mailutils.exp
21 set sieve_source_dir "${srcdir}/scripts"
22
23 mu_init -noflags
24 set env(MAIL) $MU_SPOOL_DIR/sieve.mbox
25 set env(FOLDER) $env(MAIL)
26
27 set SIEVE_ETC_DIR "$MU_DATA_DIR/etc"
28
29 mu_makespool "$MU_RC_DIR" "$SIEVE_ETC_DIR"
30
31 # sieve_test [-retcode N][-message MESSAGE][-default (FAIL|XFAIL)]
32 # [-reuse-spool]
33 # [ARGS...][-pattern PATTERN...]
34 proc sieve_test {args} {
35 global sieve_source_dir
36 global top_builddir
37 global SIEVE_ETC_DIR
38 global MU_SPOOL_DIR
39
40 set default ""
41 set sw [list "--config-file=$SIEVE_ETC_DIR/mailutils.rc" \
42 "--verbose" \
43 "--line-info=no" \
44 "--no-program-name" \
45 "-M sendmail:$top_builddir/examples/mta" \
46 "--email foobar@nonexistent.net"]
47 set reuse_spool 0
48 set retcode 0
49 set mailbox "$MU_SPOOL_DIR/sieve.mbox"
50 for {set i 0} {$i < [llength $args]} {incr i} {
51 set a [lindex $args $i]
52 if {"$a" == "-default"} {
53 incr i
54 set default [lindex $args $i]
55 } elseif {"$a" == "-message"} {
56 incr i
57 set message [lindex $args $i]
58 } elseif {"$a" == "-pattern"} {
59 incr i
60 set pattern [lrange $args $i end]
61 break
62 } elseif {"$a" == "-reuse-spool"} {
63 set reuse_spool 1
64 break
65 } elseif {"$a" == "-retcode"} {
66 incr i
67 set retcode [lindex $args $i]
68 } elseif {"$a" == "-f"} {
69 incr i
70 set mailbox [lindex $args $i]
71 } else {
72 set sw [concat $sw [lindex $args $i]]
73 }
74 }
75
76 switch -- "[lindex $sw end]" {
77 ^/.* { }
78 default {
79 set sw [concat [lrange $sw 0 [expr [llength $sw] - 2]] \
80 [list "${sieve_source_dir}/[lindex $sw end]"]]
81 }
82 }
83
84 set sw [concat "-f$mailbox" $sw]
85
86 if {![info exists message]} {
87 set message "[lindex $sw end]"
88 }
89
90 if {!$reuse_spool} {
91 mu_prepare_spools
92 }
93
94 if [info exists pattern] {
95 mu_exec -default $default -message $message -arg-list $sw \
96 -pattern $pattern -retcode $retcode
97 } else {
98 mu_exec -default $default -message $message -arg-list $sw \
99 -retcode $retcode
100 }
101 #FIXME: examine the output mailbox
102 }
103
104 proc sieve_driver_test {name mailer diag} {
105 global srcdir
106 set chan [open "${srcdir}/$name" r]
107
108 set state 0
109 set command ""
110 for {gets $chan line} {![eof $chan]} {gets $chan line} {
111 verbose "LINE $line" 1
112 switch -regexp -- "$line" {
113 "^#.*" { }
114 "^TEST END" {
115 verbose "ARGS $args" 1
116 verbose "PATTERN $pattern" 1
117 verbose "OUTPUT $output" 1
118 eval sieve_test $args -pattern $pattern
119 eval mu_test_file "$diag" $output
120 set state 0
121 }
122 "^TEST" {
123 regexp "^TEST (.*)" $line dummy args
124 set pattern [list]
125 set output [list]
126 set state 1
127 }
128 "^PATTERN BEGIN" {
129 set state 2
130 }
131 "^PATTERN END" {
132 set state 1
133 }
134 "^FILE BEGIN" {
135 set state 3
136 }
137 "^FILE END" {
138 set state 1
139 }
140 "^STOP" {
141 break
142 }
143 default {
144 if {$state == 2} {
145 lappend pattern $line
146 } elseif {$state == 3} {
147 lappend output $line
148 }
149 }
150 }
151 }
152 close $chan
153 }
1 addr_is_all.sv
2 addr_is_domain.sv
3 addr_is_local.sv
4 addr_matches.sv
5 address.sv
6 allof00.sv
7 allof01.sv
8 allof11.sv
9 anyof00.sv
10 anyof01.sv
11 anyof11.sv
12 discard.sv
13 envelope1.sv
14 exists1.sv
15 exists2.sv
16 exists3.sv
17 false.sv
18 fileinto.sv
19 header1.sv
20 header2.sv
21 header3.sv
22 header-mime.sv
23 i-casemap-contains.sv
24 i-casemap-is.sv
25 i-casemap-matches.sv
26 i-casemap-regex.sv
27 i-numeric-contains.sv
28 i-numeric-is.sv
29 i-octet-contains.sv
30 i-octet-is.sv
31 i-octet-matches.sv
32 i-octet-regex.sv
33 keep.sv
34 mul-addr.sv
35 not.sv
36 null.sv
37 numaddr.sv
38 redirect.sv
39 reject.sv
40 rel-address.sv
41 rel-hairy.sv
42 rel-header.sv
43 size1.sv
44 size2.sv
45 stop.sv
46 true.sv
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if address :is :all "From" "coyote@desert.example.org" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if address :is :domain "From" "desert.example.org" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if address :is :localpart "From" "youcouldberich!" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if address :matches :all "From" "*invalid" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if address :is :all "From" "coyote@desert.example.org" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if allof(false,false) {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if allof(false,true) {
7 discard;
8 }
9
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if allof(true,true) {
7 discard;
8 }
9
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if anyof(false,false) {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if anyof(false,true) {
7 discard;
8 }
9
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if anyof(true,true) {
7 discard;
8 }
9
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 discard;
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if envelope "from" "coyote@desert.example.org" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if exists "X-Caffeine" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if exists ["X-Caffeine", "From"] {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if exists ["X-Caffeine", "X-Status"] {
7 discard;
8 }
9
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if false {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "fileinto";
7
8 fileinto "+file";
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if header :mime :is "Content-Description" "How doth" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if header :is "X-Caffeine" "C8H10N4O2" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if header ["X-Caffeine","Subject"] ["C8H10N4O2","Coffee"] {
7 discard;
8 }
9
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if header :matches "Subject" "*$$$*" {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;ascii-casemap";
7
8 if header :comparator "i;ascii-casemap" :contains ["from", "to"] "ExAmPLe"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;ascii-casemap";
7
8 if header :comparator "i;ascii-casemap" :is "to" "roadrunner@ACME.EXAMPLE.COM"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;ascii-casemap";
7
8 if header :comparator "i;ascii-casemap" :matches "subject" "*you, too,*"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;ascii-casemap";
7
8 if header :comparator "i;ascii-casemap" :regex "subject" ".*you.*"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;ascii-numeric";
7
8 if header :comparator "i;ascii-numeric" :contains "X-Number" "15"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;ascii-numeric";
7
8 if header :comparator "i;ascii-numeric" :is "X-Number" "15"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;octet";
7
8 if header :comparator "i;octet" :contains ["from", "to"] "example"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;octet";
7
8 if header :comparator "i;octet" :is "to" "roadrunner@acme.example.com"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;octet";
7
8 if header :comparator "i;octet" :matches "subject" "$$$*$$$"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "comparator-i;octet";
7
8 if header :comparator "i;octet" :regex "subject" ".*you.*"
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 keep;
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "fileinto";
7
8 if address :localpart :is ["To", "Cc"] [ "foo", "oof" ]
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if not false {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 # Empty script to test implicit keep.
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "test-numaddr";
7
8 if numaddr [ "to", "cc" ] :over 5
9 {
10 discard;
11 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "redirect";
7
8 redirect "gray@gnu.org";
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require "reject";
7
8 reject text:
9 I don't want to read these messages.
10
11 Regards.
12 .
13 ;
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2003, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require ["relational", "comparator-i;ascii-numeric"];
7
8 if address :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"]
9 {
10 discard;
11 }
12
13 # End of rel-address.sv
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2003, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require ["relational", "comparator-i;ascii-numeric", "fileinto"];
7
8 if header :value "lt" :comparator "i;ascii-numeric" ["x-priority"] ["3"]
9 {
10 fileinto "%Priority";
11 }
12 elsif address :count "gt" :comparator "i;ascii-numeric" ["to"] ["5"]
13 {
14 # everything with more than 5 recipients in the "to" field
15 # is considered SPAM
16 fileinto "%SPAM";
17 }
18 elsif address :value "gt" :all :comparator "i;ascii-casemap" ["from"] ["M"]
19 {
20 fileinto "%From_N-Z";
21 }
22 else
23 {
24 fileinto "%From_A-M";
25 }
26
27 if allof (address :count "eq" :comparator "i;ascii-numeric"
28 ["to", "cc"] ["1"] ,
29 address :all :comparator "i;ascii-casemap"
30 ["to", "cc"] ["me@foo.example.com.invalid"])
31 {
32 fileinto "%Only_me";
33 }
34
35 # End of rel-hairy.sv
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2003, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 require ["relational", "comparator-i;ascii-numeric"];
7
8 if header :count "gt" ["received"] ["2"]
9 {
10 discard;
11 }
12
13 # End of rel-address.sv
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if size :under 400 {
7 discard;
8 }
9
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if size :over 500 {
7 discard;
8 }
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 stop;
1 # -*- sieve -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
4 # See file COPYING for distribution conditions.
5
6 if true {
7 discard;
8 }
1 action.exp
2 address.exp
3 allof.exp
4 anyof.exp
5 envelope.exp
6 exists.exp
7 ext.exp
8 false.exp
9 header.exp
10 i-casemap.exp
11 i-numeric.exp
12 i-octet.exp
13 mul-addr.exp
14 not.exp
15 redirect.exp
16 reject.exp
17 relational.exp
18 size.exp
19 true.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test stop.sv -pattern\
21 "STOP on msg uid 1"\
22 "STOP on msg uid 2"\
23 "STOP on msg uid 3"
24
25 sieve_test null.sv -pattern\
26 "IMPLICIT KEEP on msg uid 1"\
27 "IMPLICIT KEEP on msg uid 2"\
28 "IMPLICIT KEEP on msg uid 3"
29
30 sieve_test keep.sv -pattern\
31 "KEEP on msg uid 1"\
32 "KEEP on msg uid 2"\
33 "KEEP on msg uid 3"
34
35 sieve_test discard.sv -pattern\
36 "DISCARD on msg uid 1: marking as deleted"\
37 "DISCARD on msg uid 2: marking as deleted"\
38 "DISCARD on msg uid 3: marking as deleted"
39
40 sieve_test --set "mailbox.folder=\"'$MU_SPOOL_DIR'\"" fileinto.sv -pattern\
41 "FILEINTO on msg uid 1: delivering into +file"\
42 "FILEINTO on msg uid 2: delivering into +file"\
43 "FILEINTO on msg uid 3: delivering into +file"
44
45 mu_test_file "$MU_SPOOL_DIR/file" \
46 "From coyote@desert.example.org Sun May 6 22:16:47 2001"\
47 "From: coyote@desert.example.org"\
48 "To: roadrunner@acme.example.com"\
49 "Subject: I have a present for you"\
50 "X-Caffeine: C8H10N4O2"\
51 ""\
52 "Look, I'm sorry about the whole anvil thing, and I really"\
53 "didn't mean to try and drop it on you from the top of the"\
54 "cliff. I want to try to make it up to you. I've got some"\
55 "great birdseed over here at my place--top of the line"\
56 "stuff--and if you come by, I'll have it all wrapped up"\
57 "for you. I'm really sorry for all the problems I've caused"\
58 "for you over the years, but I know we can work this out."\
59 ""\
60 -- "--"\
61 "Wile E. Coyote \"Super Genius\" coyote@desert.example.org"\
62 ""\
63 "From b1ff@de.res.example.com Sun May 6 22:17:15 2001"\
64 "From: youcouldberich!@reply-by-postal-mail.invalid"\
65 "To: rube@landru.example.edu"\
66 "Subject: \$\$\$ YOU, TOO, CAN BE A MILLIONAIRE! \$\$\$"\
67 "Date: TBD"\
68 "X-Number: 0015"\
69 ""\
70 "YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT"\
71 "IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL"\
72 "GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!"\
73 "MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER"\
74 "\$20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!"\
75 "!!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST"\
76 "SEND \$5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!"\
77 ""\
78 "From bar@dontmailme.org Fri Dec 28 23:28:09 2001"\
79 "Received: (from bar@dontmailme.org)"\
80 "\tby dontmailme.org id fERKR9N16790"\
81 "\tfor foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200"\
82 "Date: Fri, 28 Dec 2001 23:28:08 +0200"\
83 "From: Bar <bar@dontmailme.org>"\
84 "To: Foo Bar <foobar@nonexistent.net>"\
85 "Message-Id: <200112232808.fERKR9N16790@dontmailme.org>"\
86 "Subject: Coffee"\
87 ""\
88 "How about some coffee?"
89
90 # end of action.exp
91
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test addr_is_all.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test addr_is_domain.sv -pattern \
26 "DISCARD on msg uid 1: marking as deleted"\
27 "IMPLICIT KEEP on msg uid 2"\
28 "IMPLICIT KEEP on msg uid 3"
29
30 sieve_test addr_is_local.sv -pattern \
31 "IMPLICIT KEEP on msg uid 1"\
32 "DISCARD on msg uid 2: marking as deleted"\
33 "IMPLICIT KEEP on msg uid 3"
34
35 sieve_test addr_matches.sv -pattern \
36 "IMPLICIT KEEP on msg uid 1"\
37 "DISCARD on msg uid 2: marking as deleted"\
38 "IMPLICIT KEEP on msg uid 3"
39
40 # end of address.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test allof00.sv -pattern \
21 "IMPLICIT KEEP on msg uid 1"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test allof01.sv -pattern \
26 "IMPLICIT KEEP on msg uid 1"\
27 "IMPLICIT KEEP on msg uid 2"\
28 "IMPLICIT KEEP on msg uid 3"
29
30 sieve_test allof11.sv -pattern \
31 "DISCARD on msg uid 1: marking as deleted"\
32 "DISCARD on msg uid 2: marking as deleted"\
33 "DISCARD on msg uid 3: marking as deleted"
34
35 # end of allof.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test anyof00.sv -pattern \
21 "IMPLICIT KEEP on msg uid 1"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test anyof01.sv -pattern \
26 "DISCARD on msg uid 1: marking as deleted"\
27 "DISCARD on msg uid 2: marking as deleted"\
28 "DISCARD on msg uid 3: marking as deleted"
29
30 sieve_test anyof11.sv -pattern \
31 "DISCARD on msg uid 1: marking as deleted"\
32 "DISCARD on msg uid 2: marking as deleted"\
33 "DISCARD on msg uid 3: marking as deleted"
34
35 # end of anyof.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 set exdir "${srcdir}/../examples"
20
21 set scripts [list\
22 ex-null.sv\
23 box.sv\
24 ex-1.10.2.sv\
25 ex-2.3a.sv\
26 ex-2.5.1.sv\
27 ex-2.7.3.sv\
28 ex-3.1a.sv\
29 ex-3.1b.sv\
30 ex-4.2.sv\
31 ex-4.4a.sv\
32 ex-4.4b.sv\
33 ex-4.5.sv\
34 ex-5.1.sv\
35 ex-5.7.sv\
36 ex-save-all.sv\
37 example.sv\
38 exn-2.3b.sv]
39
40 # t-complex.sv
41 # t-exists.sv
42 # t-fileinto.sv
43 # t-mailutils.sv
44
45
46 for {set s $scripts} {[llength $s] != 0} {set s [lrange $s 1 end]} {
47 set source_name [lindex $s 0]
48 mu_exec -message "sieve -c $source_name" \
49 -arg -c -arg ${exdir}/$source_name
50 }
51
52 # end of compile.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test envelope1.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 # end of envelope.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test exists1.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test exists2.sv -pattern \
26 "DISCARD on msg uid 1: marking as deleted"\
27 "IMPLICIT KEEP on msg uid 2"\
28 "IMPLICIT KEEP on msg uid 3"
29
30 sieve_test exists3.sv -pattern \
31 "IMPLICIT KEEP on msg uid 1"\
32 "IMPLICIT KEEP on msg uid 2"\
33 "IMPLICIT KEEP on msg uid 3"
34
35 # end of exists.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mu_version
21 if ![mu_check_capability HAVE_LIBLTDL] {
22 unsupported "This test requires libltdl"
23 } else {
24 sieve_test --clearpath -L "${top_builddir}/examples" -f ${MU_SPOOL_DIR}/bigto.mbox numaddr.sv -pattern \
25 "DISCARD on msg uid 1: marking as deleted"
26 }
27 # End of ext.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test false.sv -pattern \
21 "IMPLICIT KEEP on msg uid 1"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 # end of false.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test header1.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test header2.sv -pattern \
26 "DISCARD on msg uid 1: marking as deleted"\
27 "IMPLICIT KEEP on msg uid 2"\
28 "DISCARD on msg uid 3: marking as deleted"
29
30 sieve_test header3.sv -pattern \
31 "IMPLICIT KEEP on msg uid 1"\
32 "DISCARD on msg uid 2: marking as deleted"\
33 "IMPLICIT KEEP on msg uid 3"
34
35 sieve_test -f "$MU_SPOOL_DIR/mbox1" header-mime.sv -pattern \
36 "IMPLICIT KEEP on msg uid 1"\
37 "IMPLICIT KEEP on msg uid 2"\
38 "DISCARD on msg uid 3: marking as deleted"\
39 "IMPLICIT KEEP on msg uid 4"\
40 "IMPLICIT KEEP on msg uid 5"
41
42 # end of header.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test i-casemap-is.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test i-casemap-matches.sv -pattern \
26 "IMPLICIT KEEP on msg uid 1"\
27 "DISCARD on msg uid 2: marking as deleted"\
28 "IMPLICIT KEEP on msg uid 3"
29
30 sieve_test i-casemap-contains.sv -pattern \
31 "DISCARD on msg uid 1: marking as deleted"\
32 "DISCARD on msg uid 2: marking as deleted"\
33 "IMPLICIT KEEP on msg uid 3"
34
35 sieve_test i-casemap-regex.sv -pattern \
36 "DISCARD on msg uid 1: marking as deleted"\
37 "DISCARD on msg uid 2: marking as deleted"\
38 "IMPLICIT KEEP on msg uid 3"
39
40 # end of i-casemap.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test i-numeric-is.sv -pattern \
21 "IMPLICIT KEEP on msg uid 1"\
22 "DISCARD on msg uid 2: marking as deleted"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test i-numeric-contains.sv -retcode 78 -pattern \
26 -re ".*i-numeric-contains.sv:9: comparator `i;ascii-numeric' is incompatible with match type `contains' in call to `header'"
27
28 # end of i-numeric.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test i-octet-is.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"
24
25 sieve_test i-octet-matches.sv -pattern \
26 "IMPLICIT KEEP on msg uid 1"\
27 "DISCARD on msg uid 2: marking as deleted"\
28 "IMPLICIT KEEP on msg uid 3"
29
30 sieve_test i-octet-contains.sv -pattern \
31 "DISCARD on msg uid 1: marking as deleted"\
32 "DISCARD on msg uid 2: marking as deleted"\
33 "IMPLICIT KEEP on msg uid 3"
34
35 sieve_test i-octet-regex.sv -pattern \
36 "DISCARD on msg uid 1: marking as deleted"\
37 "IMPLICIT KEEP on msg uid 2"\
38 "IMPLICIT KEEP on msg uid 3"
39
40 # end of i-octet.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test -f $MU_SPOOL_DIR/relational.mbox mul-addr.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "DISCARD on msg uid 2: marking as deleted"\
23 "DISCARD on msg uid 3: marking as deleted"\
24 "DISCARD on msg uid 4: marking as deleted"\
25 "DISCARD on msg uid 5: marking as deleted"\
26 "DISCARD on msg uid 6: marking as deleted"\
27 "DISCARD on msg uid 7: marking as deleted"\
28 "IMPLICIT KEEP on msg uid 8"\
29 "DISCARD on msg uid 9: marking as deleted"
30
31 # End of mul-addr.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test not.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "DISCARD on msg uid 2: marking as deleted"\
23 "DISCARD on msg uid 3: marking as deleted"
24
25 # end of not.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mu_version
21 if ![mu_check_capability ENABLE_SENDMAIL] {
22 unsupported "Support for sendmail not compiled in"
23 } else {
24 set mtafile "$MU_FOLDER_DIR/mta.diag"
25 set env(MTA_DIAG) "$mtafile"
26 set env(MTA_APPEND) 1
27
28 set mailer "sendmail:$top_builddir/examples/mta"
29
30 sieve_driver_test "Redirect" "$mailer" "$mtafile"
31 }
32 # End of redirect.exp
33
34
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mu_version
21 if ![mu_check_capability ENABLE_SENDMAIL] {
22 unsupported "Support for sendmail not compiled in"
23 } else {
24 set mtafile "$MU_FOLDER_DIR/mta.diag"
25 set env(MTA_DIAG) "$mtafile"
26 set env(MTA_APPEND) 1
27
28 set mailer "sendmail:$top_builddir/examples/mta"
29
30 sieve_driver_test "Reject" "$mailer" "$mtafile"
31 }
32 # End of reject.exp
33
34
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test -f $MU_SPOOL_DIR/relational.mbox rel-address.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "IMPLICIT KEEP on msg uid 3"\
24 "IMPLICIT KEEP on msg uid 4"\
25 "IMPLICIT KEEP on msg uid 5"\
26 "IMPLICIT KEEP on msg uid 6"\
27 "IMPLICIT KEEP on msg uid 7"\
28 "IMPLICIT KEEP on msg uid 8"\
29 "DISCARD on msg uid 9: marking as deleted"
30
31 sieve_test -f $MU_SPOOL_DIR/relational.mbox rel-header.sv -pattern \
32 "IMPLICIT KEEP on msg uid 1"\
33 "IMPLICIT KEEP on msg uid 2"\
34 "IMPLICIT KEEP on msg uid 3"\
35 "IMPLICIT KEEP on msg uid 4"\
36 "IMPLICIT KEEP on msg uid 5"\
37 "IMPLICIT KEEP on msg uid 6"\
38 "IMPLICIT KEEP on msg uid 7"\
39 "IMPLICIT KEEP on msg uid 8"\
40 "DISCARD on msg uid 9: marking as deleted"
41
42 sieve_test -f $MU_SPOOL_DIR/relational.mbox rel-hairy.sv -pattern \
43 "FILEINTO on msg uid 1: delivering into %From_A-M"\
44 "FILEINTO on msg uid 2: delivering into %From_N-Z"\
45 "FILEINTO on msg uid 3: delivering into %Priority"\
46 "FILEINTO on msg uid 4: delivering into %Priority"\
47 "FILEINTO on msg uid 5: delivering into %Priority"\
48 "FILEINTO on msg uid 6: delivering into %From_A-M"\
49 "FILEINTO on msg uid 7: delivering into %From_A-M"\
50 "FILEINTO on msg uid 8: delivering into %From_A-M"\
51 "FILEINTO on msg uid 8: delivering into %Only_me"\
52 "FILEINTO on msg uid 9: delivering into %SPAM"
53
54 # End of relational.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test size1.sv -pattern \
21 "IMPLICIT KEEP on msg uid 1"\
22 "IMPLICIT KEEP on msg uid 2"\
23 "DISCARD on msg uid 3: marking as deleted"
24
25 sieve_test size2.sv -pattern \
26 "DISCARD on msg uid 1: marking as deleted"\
27 "DISCARD on msg uid 2: marking as deleted"\
28 "IMPLICIT KEEP on msg uid 3"
29
30 # end of size.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 sieve_test true.sv -pattern \
21 "DISCARD on msg uid 1: marking as deleted"\
22 "DISCARD on msg uid 2: marking as deleted"\
23 "DISCARD on msg uid 3: marking as deleted"
24
25 # end of true.exp