commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-70-g68b7dc9


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-70-g68b7dc9
Date: Mon, 13 Sep 2010 23:36:55 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=68b7dc9dacacaf0111de9d636c36ec05e1061172

The branch, master has been updated
       via  68b7dc9dacacaf0111de9d636c36ec05e1061172 (commit)
       via  8c76d675333b70a0887de506073d64cd2c14643a (commit)
      from  fd032c6f6cf30af76f67baff997367cafdacb428 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 68b7dc9dacacaf0111de9d636c36ec05e1061172
Author: Sergey Poznyakoff <address@hidden>
Date:   Tue Sep 14 02:33:49 2010 +0300

    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.

commit 8c76d675333b70a0887de506073d64cd2c14643a
Author: Sergey Poznyakoff <address@hidden>
Date:   Mon Sep 13 21:16:34 2010 +0300

    Optimize stream seeks and I/O.  Expand stream event handlers.  Rewrite 
xscript stream.
    
    * include/mailutils/sys/stream.h (_MU_STR_EVENT_SET): Rename
    to _MU_STR_EVENT_SET.
    (_MU_STR_EVENT_CLR): Rename to _MU_STR_EVENT_CLRFLAG.
    (_MU_STR_EVENT_FILLBUF, _MU_STR_EVENT_FLUSHBUF): New event codes.
    (_MU_STR_EVMASK): New macro.
    (_mu_stream) <cur>: Replace with pos, indicating current position
    in the buffer.
    (event_cb): Change signature.
    (mu_stream_read_unbuffered): Remove.
    (mu_stream_write_unbuffered): Remove.
    
    * mailbox/iostream.c (mu_iostream_create): Provide the readdelim method
    only if the underlying input transpor stream provides it.
    * mailbox/streamref.c (mu_streamref_create_abridged): Likewise.
    
    * mailbox/stream.c (_stream_event): New macro.
    (mu_stream_read_unbuffered): Rename to static _stream_read_unbuffered.
    (mu_stream_write_unbuffered): Rename to static _stream_write_unbuffered.
    (_stream_advance_buffer, _stream_buffer_offset)
    (_stream_orig_level): Remove macros.
    (_stream_buffer_freespace): Rewrite.
    (_stream_curp): New macro.
    (_stream_fill_buffer): Make sure the `offset' indicates the offset
    int the transport, corresponding to the beginning of the current
    buffer.
    (_stream_flush_buffer): Essentially rewritten.
    (mu_stream_seek): Reflect changes to the _mu_stream structure. Optimize
    calls to the seek method.
    (_stream_skip_input_bytes): Likewise.
    (mu_stream_read, _stream_scandelim, mu_stream_write): Rewrite using
    new _mu_stream structure.
    
    * mailbox/xscript-stream.c: Rewrite using stream events.
    
    * mailbox/base64.c (_base64_encoder): Bugfix.
    
    * libproto/pop/pop3_stream.c (_pop3_event_cb): Update signature to
    match the changes above.
    * examples/mimetest.c (main): Add more error checking.
    * mail/testsuite/mail/write.exp: Minor fix.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                                    |    5 +-
 examples/mimetest.c                             |    2 +-
 include/mailutils/sys/stream.h                  |   17 +-
 libproto/pop/pop3_stream.c                      |    8 +-
 mail/testsuite/mail/write.exp                   |    2 +-
 mailbox/base64.c                                |    3 +
 mailbox/cfg_parser.y                            |   37 +++-
 mailbox/iostream.c                              |    3 +-
 mailbox/stream.c                                |  280 +++++++++++++----------
 mailbox/streamref.c                             |    3 +-
 mailbox/xscript-stream.c                        |   51 ++---
 sieve/Makefile.am                               |    2 +-
 sieve/tests/.gitignore                          |    7 +
 sieve/tests/Makefile.am                         |   87 +++++++
 sieve/tests/action.at                           |  104 +++++++++
 sieve/tests/address.at                          |   63 +++++
 sieve/tests/allof.at                            |   51 ++++
 sieve/tests/anyof.at                            |   51 ++++
 sieve/tests/atlocal.in                          |   14 ++
 sieve/tests/compile.at                          |   39 +++
 mu-aux/texify.sed => sieve/tests/envelope.at    |   25 ++-
 sieve/tests/exists.at                           |   50 ++++
 sieve/tests/ext.at                              |   44 ++++
 mu-aux/texify.sed => sieve/tests/false.at       |   24 ++-
 sieve/tests/header.at                           |   64 +++++
 sieve/tests/i-casemap.at                        |   73 ++++++
 sieve/tests/i-numeric.at                        |   46 ++++
 sieve/tests/i-octet.at                          |   75 ++++++
 sieve/tests/mul-addr.at                         |   39 +++
 mu-aux/texify.sed => sieve/tests/not.at         |   25 ++-
 sieve/{testsuite/Redirect => tests/redirect.at} |   68 ++++---
 sieve/{testsuite/Reject => tests/reject.at}     |  202 +++++++++--------
 sieve/tests/relational.at                       |  105 +++++++++
 sieve/tests/size.at                             |   42 ++++
 sieve/tests/testsuite.at                        |  110 +++++++++
 mu-aux/texify.sed => sieve/tests/true.at        |   24 ++-
 sieve/tests/version.at                          |   34 +++
 sieve/testsuite/.gitignore                      |    7 -
 sieve/testsuite/Makefile.am                     |   91 --------
 sieve/testsuite/lib/DISTFILES                   |    1 -
 sieve/testsuite/lib/sieve.exp                   |  153 ------------
 sieve/testsuite/scripts/DISTFILES               |   46 ----
 sieve/testsuite/scripts/addr_is_all.sv          |    8 -
 sieve/testsuite/scripts/addr_is_domain.sv       |    8 -
 sieve/testsuite/scripts/addr_is_local.sv        |    8 -
 sieve/testsuite/scripts/addr_matches.sv         |    8 -
 sieve/testsuite/scripts/address.sv              |    8 -
 sieve/testsuite/scripts/allof00.sv              |    8 -
 sieve/testsuite/scripts/allof01.sv              |    9 -
 sieve/testsuite/scripts/allof11.sv              |    9 -
 sieve/testsuite/scripts/anyof00.sv              |    8 -
 sieve/testsuite/scripts/anyof01.sv              |    9 -
 sieve/testsuite/scripts/anyof11.sv              |    9 -
 sieve/testsuite/scripts/discard.sv              |    6 -
 sieve/testsuite/scripts/envelope1.sv            |    8 -
 sieve/testsuite/scripts/exists1.sv              |    8 -
 sieve/testsuite/scripts/exists2.sv              |    8 -
 sieve/testsuite/scripts/exists3.sv              |    9 -
 sieve/testsuite/scripts/false.sv                |    8 -
 sieve/testsuite/scripts/fileinto.sv             |    8 -
 sieve/testsuite/scripts/header-mime.sv          |    8 -
 sieve/testsuite/scripts/header1.sv              |    8 -
 sieve/testsuite/scripts/header2.sv              |    9 -
 sieve/testsuite/scripts/header3.sv              |    8 -
 sieve/testsuite/scripts/i-casemap-contains.sv   |   11 -
 sieve/testsuite/scripts/i-casemap-is.sv         |   11 -
 sieve/testsuite/scripts/i-casemap-matches.sv    |   11 -
 sieve/testsuite/scripts/i-casemap-regex.sv      |   11 -
 sieve/testsuite/scripts/i-numeric-contains.sv   |   11 -
 sieve/testsuite/scripts/i-numeric-is.sv         |   11 -
 sieve/testsuite/scripts/i-octet-contains.sv     |   11 -
 sieve/testsuite/scripts/i-octet-is.sv           |   11 -
 sieve/testsuite/scripts/i-octet-matches.sv      |   11 -
 sieve/testsuite/scripts/i-octet-regex.sv        |   11 -
 sieve/testsuite/scripts/keep.sv                 |    6 -
 sieve/testsuite/scripts/mul-addr.sv             |   11 -
 sieve/testsuite/scripts/not.sv                  |    8 -
 sieve/testsuite/scripts/null.sv                 |    6 -
 sieve/testsuite/scripts/numaddr.sv              |   11 -
 sieve/testsuite/scripts/redirect.sv             |    8 -
 sieve/testsuite/scripts/reject.sv               |   13 -
 sieve/testsuite/scripts/rel-address.sv          |   13 -
 sieve/testsuite/scripts/rel-hairy.sv            |   35 ---
 sieve/testsuite/scripts/rel-header.sv           |   13 -
 sieve/testsuite/scripts/size1.sv                |    9 -
 sieve/testsuite/scripts/size2.sv                |    8 -
 sieve/testsuite/scripts/stop.sv                 |    6 -
 sieve/testsuite/scripts/true.sv                 |    8 -
 sieve/testsuite/sieve/DISTFILES                 |   19 --
 sieve/testsuite/sieve/action.exp                |   91 --------
 sieve/testsuite/sieve/address.exp               |   40 ----
 sieve/testsuite/sieve/allof.exp                 |   35 ---
 sieve/testsuite/sieve/anyof.exp                 |   35 ---
 sieve/testsuite/sieve/compile.exp               |   52 -----
 sieve/testsuite/sieve/envelope.exp              |   25 --
 sieve/testsuite/sieve/exists.exp                |   35 ---
 sieve/testsuite/sieve/ext.exp                   |   27 ---
 sieve/testsuite/sieve/false.exp                 |   25 --
 sieve/testsuite/sieve/header.exp                |   42 ----
 sieve/testsuite/sieve/i-casemap.exp             |   40 ----
 sieve/testsuite/sieve/i-numeric.exp             |   28 ---
 sieve/testsuite/sieve/i-octet.exp               |   40 ----
 sieve/testsuite/sieve/mul-addr.exp              |   31 ---
 sieve/testsuite/sieve/not.exp                   |   25 --
 sieve/testsuite/sieve/redirect.exp              |   34 ---
 sieve/testsuite/sieve/reject.exp                |   34 ---
 sieve/testsuite/sieve/relational.exp            |   54 -----
 sieve/testsuite/sieve/size.exp                  |   30 ---
 sieve/testsuite/sieve/true.exp                  |   25 --
 testsuite/spool/sieve.mbox                      |    2 +-
 110 files changed, 1541 insertions(+), 1850 deletions(-)
 create mode 100644 sieve/tests/.gitignore
 create mode 100644 sieve/tests/Makefile.am
 create mode 100644 sieve/tests/action.at
 create mode 100644 sieve/tests/address.at
 create mode 100644 sieve/tests/allof.at
 create mode 100644 sieve/tests/anyof.at
 create mode 100644 sieve/tests/atlocal.in
 create mode 100644 sieve/tests/compile.at
 copy mu-aux/texify.sed => sieve/tests/envelope.at (54%)
 create mode 100644 sieve/tests/exists.at
 create mode 100644 sieve/tests/ext.at
 copy mu-aux/texify.sed => sieve/tests/false.at (57%)
 create mode 100644 sieve/tests/header.at
 create mode 100644 sieve/tests/i-casemap.at
 create mode 100644 sieve/tests/i-numeric.at
 create mode 100644 sieve/tests/i-octet.at
 create mode 100644 sieve/tests/mul-addr.at
 copy mu-aux/texify.sed => sieve/tests/not.at (55%)
 rename sieve/{testsuite/Redirect => tests/redirect.at} (66%)
 rename sieve/{testsuite/Reject => tests/reject.at} (55%)
 create mode 100644 sieve/tests/relational.at
 create mode 100644 sieve/tests/size.at
 create mode 100644 sieve/tests/testsuite.at
 copy mu-aux/texify.sed => sieve/tests/true.at (55%)
 create mode 100644 sieve/tests/version.at
 delete mode 100644 sieve/testsuite/.gitignore
 delete mode 100644 sieve/testsuite/Makefile.am
 delete mode 100644 sieve/testsuite/lib/DISTFILES
 delete mode 100644 sieve/testsuite/lib/sieve.exp
 delete mode 100644 sieve/testsuite/scripts/DISTFILES
 delete mode 100644 sieve/testsuite/scripts/addr_is_all.sv
 delete mode 100644 sieve/testsuite/scripts/addr_is_domain.sv
 delete mode 100644 sieve/testsuite/scripts/addr_is_local.sv
 delete mode 100644 sieve/testsuite/scripts/addr_matches.sv
 delete mode 100644 sieve/testsuite/scripts/address.sv
 delete mode 100644 sieve/testsuite/scripts/allof00.sv
 delete mode 100644 sieve/testsuite/scripts/allof01.sv
 delete mode 100644 sieve/testsuite/scripts/allof11.sv
 delete mode 100644 sieve/testsuite/scripts/anyof00.sv
 delete mode 100644 sieve/testsuite/scripts/anyof01.sv
 delete mode 100644 sieve/testsuite/scripts/anyof11.sv
 delete mode 100644 sieve/testsuite/scripts/discard.sv
 delete mode 100644 sieve/testsuite/scripts/envelope1.sv
 delete mode 100644 sieve/testsuite/scripts/exists1.sv
 delete mode 100644 sieve/testsuite/scripts/exists2.sv
 delete mode 100644 sieve/testsuite/scripts/exists3.sv
 delete mode 100644 sieve/testsuite/scripts/false.sv
 delete mode 100644 sieve/testsuite/scripts/fileinto.sv
 delete mode 100644 sieve/testsuite/scripts/header-mime.sv
 delete mode 100644 sieve/testsuite/scripts/header1.sv
 delete mode 100644 sieve/testsuite/scripts/header2.sv
 delete mode 100644 sieve/testsuite/scripts/header3.sv
 delete mode 100644 sieve/testsuite/scripts/i-casemap-contains.sv
 delete mode 100644 sieve/testsuite/scripts/i-casemap-is.sv
 delete mode 100644 sieve/testsuite/scripts/i-casemap-matches.sv
 delete mode 100644 sieve/testsuite/scripts/i-casemap-regex.sv
 delete mode 100644 sieve/testsuite/scripts/i-numeric-contains.sv
 delete mode 100644 sieve/testsuite/scripts/i-numeric-is.sv
 delete mode 100644 sieve/testsuite/scripts/i-octet-contains.sv
 delete mode 100644 sieve/testsuite/scripts/i-octet-is.sv
 delete mode 100644 sieve/testsuite/scripts/i-octet-matches.sv
 delete mode 100644 sieve/testsuite/scripts/i-octet-regex.sv
 delete mode 100644 sieve/testsuite/scripts/keep.sv
 delete mode 100644 sieve/testsuite/scripts/mul-addr.sv
 delete mode 100644 sieve/testsuite/scripts/not.sv
 delete mode 100644 sieve/testsuite/scripts/null.sv
 delete mode 100644 sieve/testsuite/scripts/numaddr.sv
 delete mode 100644 sieve/testsuite/scripts/redirect.sv
 delete mode 100644 sieve/testsuite/scripts/reject.sv
 delete mode 100644 sieve/testsuite/scripts/rel-address.sv
 delete mode 100644 sieve/testsuite/scripts/rel-hairy.sv
 delete mode 100644 sieve/testsuite/scripts/rel-header.sv
 delete mode 100644 sieve/testsuite/scripts/size1.sv
 delete mode 100644 sieve/testsuite/scripts/size2.sv
 delete mode 100644 sieve/testsuite/scripts/stop.sv
 delete mode 100644 sieve/testsuite/scripts/true.sv
 delete mode 100644 sieve/testsuite/sieve/DISTFILES
 delete mode 100644 sieve/testsuite/sieve/action.exp
 delete mode 100644 sieve/testsuite/sieve/address.exp
 delete mode 100644 sieve/testsuite/sieve/allof.exp
 delete mode 100644 sieve/testsuite/sieve/anyof.exp
 delete mode 100644 sieve/testsuite/sieve/compile.exp
 delete mode 100644 sieve/testsuite/sieve/envelope.exp
 delete mode 100644 sieve/testsuite/sieve/exists.exp
 delete mode 100644 sieve/testsuite/sieve/ext.exp
 delete mode 100644 sieve/testsuite/sieve/false.exp
 delete mode 100644 sieve/testsuite/sieve/header.exp
 delete mode 100644 sieve/testsuite/sieve/i-casemap.exp
 delete mode 100644 sieve/testsuite/sieve/i-numeric.exp
 delete mode 100644 sieve/testsuite/sieve/i-octet.exp
 delete mode 100644 sieve/testsuite/sieve/mul-addr.exp
 delete mode 100644 sieve/testsuite/sieve/not.exp
 delete mode 100644 sieve/testsuite/sieve/redirect.exp
 delete mode 100644 sieve/testsuite/sieve/reject.exp
 delete mode 100644 sieve/testsuite/sieve/relational.exp
 delete mode 100644 sieve/testsuite/sieve/size.exp
 delete mode 100644 sieve/testsuite/sieve/true.exp

diff --git a/configure.ac b/configure.ac
index 45a62cd..8d1919a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1209,6 +1209,10 @@ AC_ARG_WITH([mh-bindir],
                     [MH_BIN_DIR='${exec_prefix}/bin/mu-mh'])
 
 
+# Initialize the (autotest) test suite.
+AC_CONFIG_TESTDIR(tests)
+AC_CONFIG_FILES([sieve/tests/Makefile sieve/tests/atlocal]) 
+AM_MISSING_PROG([AUTOM4TE], [autom4te])
 
 dnl Make sysconfdir available to the application
 dnl This must be done LAST, since CPPFLAGS is passed by configure
@@ -1371,7 +1375,6 @@ AC_CONFIG_FILES([
  mu-aux/Makefile
  mu-aux/mailutils.spec
  sieve/Makefile
- sieve/testsuite/Makefile
  testsuite/Makefile
  ])
 AC_OUTPUT
diff --git a/examples/mimetest.c b/examples/mimetest.c
index 0f4f119..e440b37 100644
--- a/examples/mimetest.c
+++ b/examples/mimetest.c
@@ -116,7 +116,7 @@ main (int argc, char **argv)
   MU_ASSERT (mu_mailbox_open (mbox, MU_STREAM_RDWR));
 
   /* Iterate through the entire message set.  */
-  mu_mailbox_messages_count (mbox, &count);
+  MU_ASSERT (mu_mailbox_messages_count (mbox, &count));
 
   for (i = 1; i <= count; ++i)
     {
diff --git a/include/mailutils/sys/stream.h b/include/mailutils/sys/stream.h
index ac63600..935fa4b 100644
--- a/include/mailutils/sys/stream.h
+++ b/include/mailutils/sys/stream.h
@@ -24,8 +24,12 @@
 
 #define _MU_STR_INTERN_MASK   0xf0000000
 
-#define _MU_STR_EVENT_SET     1
-#define _MU_STR_EVENT_CLR     2
+#define _MU_STR_EVENT_SETFLAG   0
+#define _MU_STR_EVENT_CLRFLAG   1
+#define _MU_STR_EVENT_FILLBUF   2
+#define _MU_STR_EVENT_FLUSHBUF  3
+
+#define _MU_STR_EVMASK(n) (1<<(n))
 
 struct _mu_stream
 {
@@ -35,7 +39,7 @@ struct _mu_stream
   size_t bufsize;
   char *buffer;
   size_t level;
-  char *cur;
+  size_t pos;
 
   int flags;
   mu_off_t offset;
@@ -57,7 +61,7 @@ struct _mu_stream
   int (*truncate) (struct _mu_stream *, mu_off_t);
   int (*shutdown) (struct _mu_stream *, int);
 
-  void (*event_cb) (struct _mu_stream *, int, int);
+  void (*event_cb) (struct _mu_stream *, int code, unsigned long, void *);
   int  event_mask;
   
   const char *(*error_string) (struct _mu_stream *, int);
@@ -65,11 +69,6 @@ struct _mu_stream
 };
 
 mu_stream_t _mu_stream_create (size_t size, int flags);
-int mu_stream_read_unbuffered (mu_stream_t stream, void *buf, size_t size,
-                              int full_read, size_t *pnread);
-int mu_stream_write_unbuffered (mu_stream_t stream,
-                               const void *buf, size_t size,
-                               int full_write, size_t *pnwritten);
 
 void _mu_stream_cleareof (mu_stream_t str);
 void _mu_stream_seteof (mu_stream_t str);
diff --git a/libproto/pop/pop3_stream.c b/libproto/pop/pop3_stream.c
index 47ddcec..c202b56 100644
--- a/libproto/pop/pop3_stream.c
+++ b/libproto/pop/pop3_stream.c
@@ -41,10 +41,12 @@ struct mu_pop3_stream
   struct mu_buffer_query oldbuf;
 };
 
+/* Called on _MU_STR_EVENT_SETFLAG */
 static void
-_pop3_event_cb (mu_stream_t str, int ev, int flags)
+_pop3_event_cb (mu_stream_t str, int ev, unsigned long flags,
+               void *ptr MU_ARG_UNUSED)
 {
-  if (ev == _MU_STR_EVENT_SET)
+  if (flags & _MU_STR_EOF)
     {
       mu_transport_t trans[2];
 
@@ -78,7 +80,7 @@ mu_pop3_filter_create (mu_stream_t *pstream, mu_stream_t 
stream)
       mu_stream_t str = *pstream;
       
       str->event_cb = _pop3_event_cb;
-      str->event_mask = _MU_STR_EOF;
+      str->event_mask = _MU_STR_EVMASK(_MU_STR_EVENT_SETFLAG);
 
       sp->oldbuf.type = MU_TRANSPORT_OUTPUT;
       if (mu_stream_ioctl (sp->pop3->carrier, MU_IOCTL_GET_TRANSPORT_BUFFER,
diff --git a/mail/testsuite/mail/write.exp b/mail/testsuite/mail/write.exp
index d78efd0..4f3ebf4 100644
--- a/mail/testsuite/mail/write.exp
+++ b/mail/testsuite/mail/write.exp
@@ -27,7 +27,7 @@ mail_test -noprompt "quit" \
 # Start again using the same mailbox
 mail_start -reuse-spool "--file=%mbox1"
 # Go to the last message and do delete 4 times
-mail_command "4"
+mail_command "3"
 mail_command "delete"
 mail_command "delete"
 mail_command "delete"
diff --git a/mailbox/base64.c b/mailbox/base64.c
index 8ceba26..7a8c622 100644
--- a/mailbox/base64.c
+++ b/mailbox/base64.c
@@ -244,6 +244,9 @@ _base64_encoder (void *xd MU_ARG_UNUSED,
       pad = 0;
     }
 
+  /* Consumed may grow bigger than isize if cmd is mu_filter_lastbuf */
+  if (consumed > iobuf->isize)
+    consumed = iobuf->isize;
   iobuf->isize = consumed;
   iobuf->osize = nbytes;
   return mu_filter_ok;
diff --git a/mailbox/cfg_parser.y b/mailbox/cfg_parser.y
index 551e6a2..8b13ae1 100644
--- a/mailbox/cfg_parser.y
+++ b/mailbox/cfg_parser.y
@@ -35,7 +35,8 @@
 #include <mailutils/list.h>
 #include <mailutils/iterator.h>
 #include <mailutils/debug.h>
-#include <mailutils/mutil.h>  
+#include <mailutils/mutil.h>
+#include <mailutils/cctype.h>
 
 int mu_cfg_parser_verbose;
 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)
 {
   int rc;
   int argc, i;
+  char *p;
   char **argv;
   mu_cfg_locus_t locus;
   enum mu_cfg_node_type type;
   mu_cfg_node_t *node = NULL;
+  char *delim = MU_CFG_PATH_DELIM_STR;
+  char static_delim[2] = { 0, 0 };
   
   locus.file = "<int>";
   locus.line = 0;
+
+  if (path[0] == '\\')
+    {
+      argv = calloc (2, sizeof (*argv));
+      if (!argv)
+       return ENOMEM;
+      argv[0] = strdup (path + 1);
+      if (!argv[0])
+       {
+         free (argv);
+         return ENOMEM;
+       }
+      argv[1] = NULL;
+      argc = 1;
+      rc = 0;
+    }
+  else
+    {
+      if (mu_ispunct (path[0]))
+       {
+         delim = static_delim;
+         delim[0] = path[0];
+         path++;
+       }
+      rc = mu_argcv_get_np (path, strlen (path), delim, NULL, 0,
+                           &argc, &argv, NULL);
+    }
   
-  rc = mu_argcv_get_np (path, strlen (path), MU_CFG_PATH_DELIM_STR, NULL, 0,
-                       &argc, &argv, NULL);
   if (rc)
     return rc;
 
   for (i = argc - 1; i >= 0; i--)
     {
       mu_list_t nodelist = NULL;
-      char *p = strrchr (argv[i], '=');
       mu_config_value_t *label = NULL;
 
+      p = strrchr (argv[i], '=');
       type = mu_cfg_node_statement;
       if (p)
        {
diff --git a/mailbox/iostream.c b/mailbox/iostream.c
index ca2f36b..1a7da7e 100644
--- a/mailbox/iostream.c
+++ b/mailbox/iostream.c
@@ -236,7 +236,8 @@ mu_iostream_create (mu_stream_t *pref, mu_stream_t in, 
mu_stream_t out)
     return ENOMEM;
 
   sp->stream.read = _iostream_read; 
-  sp->stream.readdelim = _iostream_readdelim; 
+  if (in->readdelim)
+    sp->stream.readdelim = _iostream_readdelim; 
   sp->stream.write = _iostream_write;
   sp->stream.flush = _iostream_flush;
   sp->stream.open = _iostream_open; 
diff --git a/mailbox/stream.c b/mailbox/stream.c
index 7b499d1..978f12a 100644
--- a/mailbox/stream.c
+++ b/mailbox/stream.c
@@ -34,19 +34,32 @@
 
 size_t mu_stream_default_buffer_size = MU_STREAM_DEFBUFSIZ;
 
+#define _stream_event(stream, code, n, p)                      \
+  do                                                           \
+    {                                                          \
+      if ((stream)->event_cb &&                                        \
+          ((stream)->event_mask & _MU_STR_EVMASK(code)))       \
+        (stream)->event_cb (stream, code, n, p);               \
+    }                                                          \
+  while (0)
+
+static int _stream_read_unbuffered (mu_stream_t stream, void *buf, size_t size,
+                                   int full_read, size_t *pnread);
+static int _stream_write_unbuffered (mu_stream_t stream,
+                                    const void *buf, size_t size,
+                                    int full_write, size_t *pnwritten);
+
 static void
 _stream_setflag (struct _mu_stream *stream, int flag)
 {
-  if (stream->event_cb && (stream->event_mask & flag))
-    stream->event_cb (stream, _MU_STR_EVENT_SET, flag);
+  _stream_event (stream, _MU_STR_EVENT_SETFLAG, flag, NULL);
   stream->flags |= flag;
 }
 
 static void
 _stream_clrflag (struct _mu_stream *stream, int flag)
 {
-  if (stream->event_cb && (stream->event_mask & flag))
-    stream->event_cb (stream, _MU_STR_EVENT_CLR, flag);
+  _stream_event (stream, _MU_STR_EVENT_CLRFLAG, flag, NULL);
   stream->flags &= ~flag;
 }
 
@@ -80,13 +93,12 @@ _mu_stream_seteof (mu_stream_t str)
   _stream_setflag (str, _MU_STR_EOF);
 }
 
-#define _stream_advance_buffer(s,n) ((s)->cur += n, (s)->level -= n)
-#define _stream_buffer_offset(s) ((s)->cur - (s)->buffer)
-#define _stream_orig_level(s) ((s)->level + _stream_buffer_offset (s))
 #define _stream_buffer_freespace(s) \
-  ((s)->bufsize - (s)->level - _stream_buffer_offset(s))
+  ((s)->bufsize - (s)->level)
 #define _stream_buffer_is_full(s) (_stream_buffer_freespace(s) == 0)
 
+#define _stream_curp(s) ((s)->buffer + (s)->pos)
+
 static int
 _stream_fill_buffer (struct _mu_stream *stream)
 {
@@ -94,24 +106,25 @@ _stream_fill_buffer (struct _mu_stream *stream)
   size_t rdn;
   int rc = 0;
   char c;
-    
+
+  stream->offset += stream->level;
   switch (stream->buftype)
     {
     case mu_buffer_none:
       return 0;
        
     case mu_buffer_full:
-      rc = mu_stream_read_unbuffered (stream,
-                                     stream->buffer, stream->bufsize,
-                                     0,
-                                     &stream->level);
+      rc = _stream_read_unbuffered (stream,
+                                   stream->buffer, stream->bufsize,
+                                   0,
+                                   &stream->level);
       break;
        
     case mu_buffer_line:
       for (n = 0;
           n < stream->bufsize
-            && (rc = mu_stream_read_unbuffered (stream,
-                                                &c, 1, 0, &rdn)) == 0;)
+            && (rc = _stream_read_unbuffered (stream,
+                                              &c, 1, 0, &rdn)) == 0;)
        {
          if (rdn == 0)
            {
@@ -125,7 +138,13 @@ _stream_fill_buffer (struct _mu_stream *stream)
       stream->level = n;
       break;
     }
-  stream->cur = stream->buffer;
+  if (rc == 0)
+    {
+      stream->offset -= stream->level;
+      stream->pos = 0;
+      _stream_event (stream, _MU_STR_EVENT_FILLBUF,
+                    stream->level, _stream_curp (stream));
+    }
   return rc;
 }
 
@@ -139,7 +158,7 @@ _stream_buffer_full_p (struct _mu_stream *stream)
        
       case mu_buffer_line:
        return _stream_buffer_is_full (stream)
-              || memchr (stream->cur, '\n', stream->level) != NULL;
+              || memchr (stream->buffer, '\n', stream->level) != NULL;
 
       case mu_buffer_full:
        return _stream_buffer_is_full (stream);
@@ -151,8 +170,9 @@ static int
 _stream_flush_buffer (struct _mu_stream *stream, int all)
 {
   int rc;
-  char *end;
-                 
+  char *start, *end;
+  size_t wrsize;
+  
   if (stream->flags & _MU_STR_DIRTY)
     {
       if ((stream->flags & MU_STREAM_SEEK) && stream->seek)
@@ -169,53 +189,55 @@ _stream_flush_buffer (struct _mu_stream *stream, int all)
            abort(); /* should not happen */
            
        case mu_buffer_full:
-         if ((rc = mu_stream_write_unbuffered (stream, stream->cur,
-                                               stream->level, 1, NULL)))
+         if ((rc = _stream_write_unbuffered (stream, stream->buffer,
+                                             stream->level, 1, NULL)))
            return rc;
-         _stream_advance_buffer (stream, stream->level);
+         _stream_event (stream, _MU_STR_EVENT_FLUSHBUF,
+                        stream->level, stream->buffer);
          break;
            
        case mu_buffer_line:
          if (stream->level == 0)
            break;
-         for (end = memchr (stream->cur, '\n', stream->level);
+         wrsize = stream->level;
+         for (start = stream->buffer, end = memchr (start, '\n', wrsize);
               end;
-              end = memchr (stream->cur, '\n', stream->level))
+              end = memchr (start, '\n', wrsize))
            {
-             size_t size = end - stream->cur + 1;
-             rc = mu_stream_write_unbuffered (stream,
-                                              stream->cur,
-                                              size, 1, NULL);
+             size_t size = end - start + 1;
+             rc = _stream_write_unbuffered (stream, start, size, 1, NULL);
              if (rc)
                return rc;
-             _stream_advance_buffer (stream, size);
+             _stream_event (stream, _MU_STR_EVENT_FLUSHBUF,
+                            size, start);
+             start += size;
+             wrsize -= size;
+             if (wrsize == 0)
+               break;
            }
-         if ((all && stream->level) || _stream_buffer_is_full (stream))
+         if ((all && wrsize) || wrsize == stream->level)
            {
-             rc = mu_stream_write_unbuffered (stream,
-                                              stream->cur,
-                                              stream->level,
-                                              1, NULL);
+             rc = _stream_write_unbuffered (stream,
+                                            stream->buffer,
+                                            wrsize,
+                                            1, NULL);
              if (rc)
                return rc;
-             _stream_advance_buffer (stream, stream->level);
+             _stream_event (stream, _MU_STR_EVENT_FLUSHBUF,
+                            wrsize, stream->buffer);
+             wrsize = 0;
            }
+         if (wrsize)
+           memmove (stream->buffer, start, wrsize);
+         else
+           _stream_clrflag (stream, _MU_STR_DIRTY);
+         stream->level = stream->pos = wrsize;
+         return 0;
        }
     }
-  else if (all)
-    _stream_advance_buffer (stream, stream->level);
-  
-  if (stream->level)
-    {
-      if (stream->cur > stream->buffer)
-       memmove (stream->buffer, stream->cur, stream->level);
-    }
-  else
-    {
-      _stream_clrflag (stream, _MU_STR_DIRTY);
-      stream->level = 0;
-    }
-  stream->cur = stream->buffer;
+
+  _stream_clrflag (stream, _MU_STR_DIRTY);
+  stream->pos = stream->level = 0;
   return 0;
 }
 
@@ -336,7 +358,7 @@ mu_stream_seek (mu_stream_t stream, mu_off_t offset, int 
whence,
     case MU_SEEK_CUR:
       if (offset == 0)
        {
-         *pres = stream->offset + _stream_buffer_offset (stream);
+         *pres = stream->offset + stream->pos;
          return 0;
        }
       offset += stream->offset;
@@ -346,7 +368,7 @@ mu_stream_seek (mu_stream_t stream, mu_off_t offset, int 
whence,
       rc = mu_stream_size (stream, &size);
       if (rc)
        return mu_stream_seterr (stream, rc, 1);
-      offset += size;
+      offset += size + stream->pos;
       break;
 
     default:
@@ -354,8 +376,9 @@ mu_stream_seek (mu_stream_t stream, mu_off_t offset, int 
whence,
     }
 
   if ((stream->buftype == mu_buffer_none && offset != stream->offset)
+      || stream->level == 0
       || offset < stream->offset
-      || offset > stream->offset + _stream_buffer_offset (stream))
+      || offset > stream->offset + stream->level)
     {
       if ((rc = _stream_flush_buffer (stream, 1)))
        return rc;
@@ -366,9 +389,11 @@ mu_stream_seek (mu_stream_t stream, mu_off_t offset, int 
whence,
        return mu_stream_seterr (stream, rc, 1);
       _mu_stream_cleareof (stream);
     }
-  
+  else if (stream->buftype != mu_buffer_none)
+    stream->pos = offset - stream->offset;
+                           
   if (pres)
-    *pres = stream->offset + _stream_buffer_offset (stream);
+    *pres = stream->offset + stream->pos;
   return 0;
 }
 
@@ -386,56 +411,56 @@ static int
 _stream_skip_input_bytes (mu_stream_t stream, mu_off_t count, mu_off_t *pres)
 {
   mu_off_t pos;
-  int rc;
+  int rc = 0;
 
   if (!(stream->flags & MU_STREAM_READ))
     return mu_stream_seterr (stream, EACCES, 1);
 
-  if (stream->buftype == mu_buffer_none)
-    {
-      for (pos = 0; pos < count; pos++)
-       {
-         char c;
-         size_t nrd;
-         rc = mu_stream_read (stream, &c, 1, &nrd);
-         if (nrd == 0)
-           rc = ESPIPE;
-         if (rc)
-           break;
-       }
-    }
-  else
+  if (count)
     {
-      for (pos = 0;;)
+      if (stream->buftype == mu_buffer_none)
        {
-         if ((rc = _stream_flush_buffer (stream, 1)))
-           return rc;
-         if (stream->level == 0)
+         for (pos = 0; pos < count; pos++)
            {
-             rc = _stream_fill_buffer (stream);
+             char c;
+             size_t nrd;
+             rc = mu_stream_read (stream, &c, 1, &nrd);
+             if (nrd == 0)
+               rc = ESPIPE;
              if (rc)
                break;
-             if (stream->level == 0)
+           }
+       }
+      else
+       {
+         for (pos = 0;;)
+           {
+             if ((rc = _stream_flush_buffer (stream, 1)))
+               return rc;
+             if (stream->pos == stream->level)
+               {
+                 rc = _stream_fill_buffer (stream);
+                 if (rc)
+                   break;
+                 if (stream->level == 0)
+                   {
+                     rc = ESPIPE;
+                     break;
+                   }
+               }
+             if (pos <= count && count < pos + stream->level)
                {
-                 rc = ESPIPE;
+                 stream->pos = count - pos;
+                 rc = 0;
                  break;
                }
+             pos += stream->level;
            }
-         if (pos <= count && count < pos + stream->level)
-           {
-             size_t delta = count - pos;
-             _stream_advance_buffer (stream, delta);
-             pos = count;
-             rc = 0;
-             break;
-           }
-         pos += stream->level;
        }
     }
   
-  stream->offset += pos;
   if (pres)
-    *pres = stream->offset;
+    *pres = stream->offset + stream->pos;
   return rc;
 }
 
@@ -482,7 +507,7 @@ mu_stream_set_buffer (mu_stream_t stream, enum 
mu_buffer_type type,
       return mu_stream_seterr (stream, ENOMEM, 1);
     }
   stream->bufsize = size;
-  stream->cur = stream->buffer;
+  stream->pos = 0;
   stream->level = 0;
     
   return 0;
@@ -496,10 +521,9 @@ mu_stream_get_buffer (mu_stream_t stream, struct 
mu_buffer_query *qry)
   return 0;
 }
 
-int
-mu_stream_read_unbuffered (mu_stream_t stream, void *buf, size_t size,
-                          int full_read,
-                          size_t *pnread)
+static int
+_stream_read_unbuffered (mu_stream_t stream, void *buf, size_t size,
+                        int full_read, size_t *pnread)
 {
   int rc;
   size_t nread;
@@ -560,11 +584,10 @@ mu_stream_read_unbuffered (mu_stream_t stream, void *buf, 
size_t size,
     return rc;
 }
 
-int
-mu_stream_write_unbuffered (mu_stream_t stream,
-                           const void *buf, size_t size,
-                           int full_write,
-                           size_t *pnwritten)
+static int
+_stream_write_unbuffered (mu_stream_t stream,
+                         const void *buf, size_t size,
+                         int full_write, size_t *pnwritten)
 {
   int rc;
   size_t nwritten;
@@ -624,7 +647,7 @@ int
 mu_stream_read (mu_stream_t stream, void *buf, size_t size, size_t *pread)
 {
   if (stream->buftype == mu_buffer_none)
-    return mu_stream_read_unbuffered (stream, buf, size, !pread, pread);
+    return _stream_read_unbuffered (stream, buf, size, !pread, pread);
   else
     {
       char *bufp = buf;
@@ -634,7 +657,7 @@ mu_stream_read (mu_stream_t stream, void *buf, size_t size, 
size_t *pread)
          size_t n;
          int rc;
          
-         if (stream->level == 0)
+         if (stream->pos == stream->level)
            {
              if ((rc = _stream_fill_buffer (stream)))
                {
@@ -647,10 +670,10 @@ mu_stream_read (mu_stream_t stream, void *buf, size_t 
size, size_t *pread)
            }
          
          n = size;
-         if (n > stream->level)
-           n = stream->level;
-         memcpy (bufp, stream->cur, n);
-         _stream_advance_buffer (stream, n);
+         if (n > stream->level - stream->pos)
+           n = stream->level - stream->pos;
+         memcpy (bufp, _stream_curp (stream), n);
+         stream->pos += n;
          nbytes += n;
          bufp += n;
          size -= n;
@@ -676,21 +699,24 @@ _stream_scandelim (mu_stream_t stream, char *buf, size_t 
size, int delim,
     return MU_ERR_BUFSPACE;
   while (size)
     {
-      char *p;
+      char *p, *q;
       size_t len;
       
-      if (stream->level == 0)
+      if (stream->pos == stream->level)
        {
          if ((rc = _stream_fill_buffer (stream)) || stream->level == 0)
            break;
        }
-      
-      p = memchr (stream->cur, delim, stream->level);
-      len = p ? p - stream->cur + 1 : stream->level;
+
+      q = _stream_curp (stream);
+      len = stream->level - stream->pos;
+      p = memchr (q, delim, len);
+      if (p)
+       len = p - q + 1;
       if (len > size)
        len = size;
-      memcpy (buf, stream->cur, len);
-      _stream_advance_buffer (stream, len);
+      memcpy (buf, _stream_curp (stream), len);
+      stream->pos += len;
       buf += len;
       size -= len;
       nread += len;
@@ -735,19 +761,22 @@ mu_stream_readdelim (mu_stream_t stream, char *buf, 
size_t size,
   
   if (size == 0)
     return EINVAL;
-    
-  if (stream->readdelim)
+
+  if (stream->buftype == mu_buffer_none)
     {
-      size_t nread;
-      rc = stream->readdelim (stream, buf, size, delim, &nread);
-      if (pread)
-       *pread = nread;
-      stream->offset += nread;
+      if (stream->readdelim)
+       {
+         size_t nread;
+         rc = stream->readdelim (stream, buf, size, delim, &nread);
+         if (pread)
+           *pread = nread;
+         stream->offset += nread;
+       }
+      else
+       rc = _stream_readdelim (stream, buf, size, delim, pread);
     }
-  else if (stream->buftype != mu_buffer_none)
-    rc = _stream_scandelim (stream, buf, size, delim, pread);
   else
-    rc = _stream_readdelim (stream, buf, size, delim, pread);
+    rc = _stream_scandelim (stream, buf, size, delim, pread);
   return rc;
 }
 
@@ -847,8 +876,8 @@ mu_stream_write (mu_stream_t stream, const void *buf, 
size_t size,
   int rc = 0;
   
   if (stream->buftype == mu_buffer_none)
-    rc = mu_stream_write_unbuffered (stream, buf, size,
-                                    !pnwritten, pnwritten);
+    rc = _stream_write_unbuffered (stream, buf, size,
+                                  !pnwritten, pnwritten);
   else
     {
       size_t nbytes = 0;
@@ -868,8 +897,11 @@ mu_stream_write (mu_stream_t stream, const void *buf, 
size_t size,
          n = _stream_buffer_freespace (stream);
          if (n > size)
            n = size;
-         memcpy (stream->cur + stream->level, bufp, n);
-         stream->level += n;
+         memcpy (_stream_curp (stream), bufp, n);
+         stream->pos += n;
+         if (stream->pos > stream->level)
+           stream->level = stream->pos;
+
          nbytes += n;
          bufp += n;
          size -= n;
diff --git a/mailbox/streamref.c b/mailbox/streamref.c
index b773983..83f401e 100644
--- a/mailbox/streamref.c
+++ b/mailbox/streamref.c
@@ -279,7 +279,8 @@ mu_streamref_create_abridged (mu_stream_t *pref, 
mu_stream_t str,
   mu_stream_ref (str);
 
   sp->stream.read = _streamref_read; 
-  sp->stream.readdelim = _streamref_readdelim; 
+  if (str->readdelim)
+    sp->stream.readdelim = _streamref_readdelim; 
   sp->stream.write = _streamref_write;
   sp->stream.flush = _streamref_flush;
   sp->stream.open = _streamref_open; 
diff --git a/mailbox/xscript-stream.c b/mailbox/xscript-stream.c
index 332f073..02fafa1 100644
--- a/mailbox/xscript-stream.c
+++ b/mailbox/xscript-stream.c
@@ -167,21 +167,28 @@ print_transcript (struct _mu_xscript_stream *str, int 
flag,
     }
 }
 
-static int
-_xscript_read (struct _mu_stream *str, char *buf, size_t bufsize,
-              size_t *pnread)
+static void
+_xscript_event_cb (mu_stream_t str, int ev, unsigned long size, void *ptr)
 {
   struct _mu_xscript_stream *sp = (struct _mu_xscript_stream *)str;
-  size_t nbytes;
-  int rc = mu_stream_read (sp->transport, buf, bufsize, &nbytes);
 
-  if (rc == 0)
+  switch (ev)
     {
-      print_transcript (sp, TRANS_READ, buf, nbytes);
-      if (pnread)
-       *pnread = nbytes;
+    case _MU_STR_EVENT_FILLBUF:
+      print_transcript (sp, TRANS_READ, ptr, size);
+      break;
+
+    case _MU_STR_EVENT_FLUSHBUF:
+      print_transcript (sp, TRANS_WRITE, ptr, size);
     }
-  return rc;
+}
+
+static int
+_xscript_read (struct _mu_stream *str, char *buf, size_t bufsize,
+              size_t *pnread)
+{
+  struct _mu_xscript_stream *sp = (struct _mu_xscript_stream *)str;
+  return mu_stream_read (sp->transport, buf, bufsize, pnread);
 }
 
 static int
@@ -189,15 +196,7 @@ _xscript_readdelim (struct _mu_stream *str, char *buf, 
size_t bufsize,
                    int delim, size_t *pnread)
 {
   struct _mu_xscript_stream *sp = (struct _mu_xscript_stream *)str;
-  size_t nread;
-  int rc = mu_stream_readdelim (sp->transport, buf, bufsize, delim, &nread);
-  if (rc == 0)
-    {
-      print_transcript (sp, TRANS_READ, buf, nread);
-      if (pnread)
-       *pnread = nread;
-    }
-  return rc;
+  return mu_stream_readdelim (sp->transport, buf, bufsize, delim, pnread);
 }
 
 static int
@@ -205,11 +204,7 @@ _xscript_write (struct _mu_stream *str, const char *buf, 
size_t bufsize,
                  size_t *pnwrite)
 {
   struct _mu_xscript_stream *sp = (struct _mu_xscript_stream *)str;
-  int rc = mu_stream_write (sp->transport, buf, bufsize, pnwrite);
-
-  if (rc == 0)
-    print_transcript (sp, TRANS_WRITE, buf, pnwrite ? *pnwrite : bufsize);
-  return rc;
+  return mu_stream_write (sp->transport, buf, bufsize, pnwrite);
 }
 
 static int
@@ -318,7 +313,6 @@ _xscript_ctl (struct _mu_stream *str, int op, void *arg)
     case MU_IOCTL_GET_TRANSPORT_BUFFER:
     case MU_IOCTL_SET_TRANSPORT_BUFFER:
       {
-        struct mu_transport_buffer_query *qp = arg;
         if (!sp->transport)
           return EINVAL;
         return mu_stream_ioctl (sp->transport, op, arg);
@@ -391,7 +385,8 @@ mu_xscript_stream_create(mu_stream_t *pref, mu_stream_t 
transport,
     return ENOMEM;
 
   sp->stream.read = _xscript_read; 
-  sp->stream.readdelim = _xscript_readdelim; 
+  if (transport->readdelim)
+    sp->stream.readdelim = _xscript_readdelim; 
   sp->stream.write = _xscript_write;
   sp->stream.flush = _xscript_flush;
   sp->stream.open = _xscript_open; 
@@ -404,7 +399,9 @@ mu_xscript_stream_create(mu_stream_t *pref, mu_stream_t 
transport,
   sp->stream.truncate = _xscript_truncate;
   sp->stream.shutdown = _xscript_shutdown;
   sp->stream.error_string = _xscript_error_string;
-
+  sp->stream.event_cb = _xscript_event_cb;
+  sp->stream.event_mask = _MU_STR_EVMASK(_MU_STR_EVENT_FILLBUF) |
+                          _MU_STR_EVMASK(_MU_STR_EVENT_FLUSHBUF);
   if (!(flags & MU_STREAM_AUTOCLOSE))
     {
       mu_stream_ref (transport);
diff --git a/sieve/Makefile.am b/sieve/Makefile.am
index 41eee59..d2354bd 100644
--- a/sieve/Makefile.am
+++ b/sieve/Makefile.am
@@ -18,7 +18,7 @@
 ##   02110-1301 USA
 
 INCLUDES = @MU_APP_COMMON_INCLUDES@ 
-SUBDIRS  = testsuite
+SUBDIRS  = tests
 
 bin_PROGRAMS = sieve
 sieve_SOURCES = sieve.c
diff --git a/sieve/tests/.gitignore b/sieve/tests/.gitignore
new file mode 100644
index 0000000..33e4e9a
--- /dev/null
+++ b/sieve/tests/.gitignore
@@ -0,0 +1,7 @@
+atconfig
+atlocal
+package.m4
+status.mf
+testsuite
+testsuite.dir
+testsuite.log
diff --git a/sieve/tests/Makefile.am b/sieve/tests/Makefile.am
new file mode 100644
index 0000000..191585d
--- /dev/null
+++ b/sieve/tests/Makefile.am
@@ -0,0 +1,87 @@
+# This file is part of GNU Mailutils.
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 
+DISTCLEANFILES       = atconfig $(check_SCRIPTS)
+MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
+#SUBDIRS = etc
+
+## ------------ ##
+## package.m4.  ##
+## ------------ ##
+
+$(srcdir)/package.m4: $(top_srcdir)/configure.ac
+       {                                      \
+         echo '# Signature of the current package.'; \
+         echo 'm4_define([AT_PACKAGE_NAME],      address@hidden@])'; \
+         echo 'm4_define([AT_PACKAGE_TARNAME],   address@hidden@])'; \
+         echo 'm4_define([AT_PACKAGE_VERSION],   address@hidden@])'; \
+         echo 'm4_define([AT_PACKAGE_STRING],    address@hidden@])'; \
+         echo 'm4_define([AT_PACKAGE_BUGREPORT], address@hidden@])'; \
+       } >$(srcdir)/package.m4
+
+#
+
+## ------------ ##
+## Test suite.  ##
+## ------------ ##
+
+TESTSUITE_AT = \
+  action.at\
+  address.at\
+  allof.at\
+  anyof.at\
+  compile.at\
+  envelope.at\
+  exists.at\
+  ext.at\
+  false.at\
+  header.at\
+  i-casemap.at\
+  i-numeric.at\
+  i-octet.at\
+  mul-addr.at\
+  not.at\
+  redirect.at\
+  reject.at\
+  relational.at\
+  size.at\
+  true.at\
+  testsuite.at\
+  version.at
+
+TESTSUITE = $(srcdir)/testsuite
+M4=m4
+
+AUTOTEST = $(AUTOM4TE) --language=autotest
+$(TESTSUITE): package.m4 $(TESTSUITE_AT)
+       $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) testsuite.at -o address@hidden
+       $(AM_V_at)mv address@hidden $@
+
+atconfig: $(top_builddir)/config.status
+       cd $(top_builddir) && ./config.status tests/$@
+
+clean-local:
+       @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
+
+check-local: atconfig atlocal $(TESTSUITE) 
+       @$(SHELL) $(TESTSUITE)
+
+# Run the test suite on the *installed* tree.
+#installcheck-local:
+#      $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
+
+
diff --git a/sieve/tests/action.at b/sieve/tests/action.at
new file mode 100644
index 0000000..d56f566
--- /dev/null
+++ b/sieve/tests/action.at
@@ -0,0 +1,104 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([action stop], [], [stop;],[],[0],[],
+[STOP on msg uid 1
+STOP on msg uid 2
+STOP on msg uid 3
+])
+
+MUT_TESTCASE([action null],[],[],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([action keep],[],[keep;],[],[0],[],
+[KEEP on msg uid 1
+KEEP on msg uid 2
+KEEP on msg uid 3
+])
+
+MUT_TESTCASE([action discard],[],[discard;],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+DISCARD on msg uid 3: marking as deleted
+])
+
+m4_pushdef([MUT_SIEVE_OPTIONS],[--set ":mailbox:folder=`pwd`"])
+
+MUT_TESTCASE([action fileinto],[],
+[require "fileinto";
+fileinto "+file";
+],
+[cat file
+],
+[0],
+[From address@hidden Sun May  6 22:16:47 2001
+From: address@hidden
+To: address@hidden
+Subject: I have a present for you
+X-Caffeine: C8H10N4O2
+
+Look, I'm sorry about the whole anvil thing, and I really
+didn't mean to try and drop it on you from the top of the
+cliff.  I want to try to make it up to you.  I've got some
+great birdseed over here at my place--top of the line
+stuff--and if you come by, I'll have it all wrapped up
+for you.  I'm really sorry for all the problems I've caused
+for you over the years, but I know we can work this out.
+
+--
+Wile E. Coyote   "Super Genius"   address@hidden
+
+From address@hidden Sun May  6 22:17:15 2001
+From: address@hidden
+To: address@hidden
+Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
+Date: TBD
+X-Number: 0015
+
+YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
+IT!  SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS!  IT WILL
+GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
+MONEY! MONEY! COLD HARD CASH!  YOU WILL RECEIVE OVER
+$20,000 IN LESS THAN TWO MONTHS!  AND IT'S LEGAL!!!!!!!!!
+!!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1  JUST
+SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
+
+From address@hidden  Fri Dec 28 23:28:09 2001
+Received: (from address@hidden)
+       by dontmailme.org id fERKR9N16790
+       for address@hidden; Fri, 28 Dec 2001 22:18:08 +0200
+Date: Fri, 28 Dec 2001 23:28:08 +0200
+From: Bar <address@hidden>
+To: Foo Bar <address@hidden>
+Message-Id: <address@hidden>
+Subject: Coffee
+
+How about some coffee?
+
+],
+[FILEINTO on msg uid 1: delivering into +file
+FILEINTO on msg uid 2: delivering into +file
+FILEINTO on msg uid 3: delivering into +file
+])
+
+m4_popdef([MUT_SIEVE_OPTIONS])
+
+
+
diff --git a/sieve/tests/address.at b/sieve/tests/address.at
new file mode 100644
index 0000000..36c5d14
--- /dev/null
+++ b/sieve/tests/address.at
@@ -0,0 +1,63 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([address :all],[test address all address-all],
+[
+if address :is :all "From" "address@hidden" {
+     discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([address :domain],[test address domain address-domain],
+[
+if address :is :domain "From" "desert.example.org" {
+      discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([address :localpart],[test address localpart address-localpart],
+[
+if address :is :localpart "From" "youcouldberich!" {
+     discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([address :matches],[test address matches address-matches],
+[
+if address :matches :all "From" "*invalid" {
+     discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+
+
diff --git a/sieve/tests/allof.at b/sieve/tests/allof.at
new file mode 100644
index 0000000..5f32395
--- /dev/null
+++ b/sieve/tests/allof.at
@@ -0,0 +1,51 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([allof 00],[test allof allof00],
+[
+if allof(false,false) {
+     discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([allof 01],[test allof allof01],
+[
+if allof(false,true) {
+     discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([allof 11],[test allof allof11],
+[
+if allof(true,true) {
+     discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+DISCARD on msg uid 3: marking as deleted
+])
+
+       
diff --git a/sieve/tests/anyof.at b/sieve/tests/anyof.at
new file mode 100644
index 0000000..1f994c1
--- /dev/null
+++ b/sieve/tests/anyof.at
@@ -0,0 +1,51 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([anyof 00],[test anyof anyof00],
+[
+if anyof(false,false) {
+     discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([anyof 01],[test anyof anyof01],
+[
+if anyof(false,true) {
+     discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+DISCARD on msg uid 3: marking as deleted
+])
+
+MUT_TESTCASE([anyof 11],[test anyof anyof11],
+[
+if anyof(true,true) {
+     discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+DISCARD on msg uid 3: marking as deleted
+])
+
+       
diff --git a/sieve/tests/atlocal.in b/sieve/tests/atlocal.in
new file mode 100644
index 0000000..19343df
--- /dev/null
+++ b/sieve/tests/atlocal.in
@@ -0,0 +1,14 @@
+# @configure_input@                                     -*- shell-script -*-
+# Configurable variable values for Mailutils test suite.
+# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
+
address@hidden@:@abs_top_builddir@/sieve:$top_srcdir:$srcdir:$PATH
address@hidden@
address@hidden@
+
+initspool() {
+  test -d data || mkdir data
+  test -d data/spool || mkdir data/spool
+  cp $top_srcdir/testsuite/spool/* data/spool
+}
+  
\ No newline at end of file
diff --git a/sieve/tests/compile.at b/sieve/tests/compile.at
new file mode 100644
index 0000000..221054b
--- /dev/null
+++ b/sieve/tests/compile.at
@@ -0,0 +1,39 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+testcompile([ex-null.sv])
+testcompile([box.sv])
+testcompile([ex-1.10.2.sv])
+testcompile([ex-2.3a.sv])
+testcompile([ex-2.5.1.sv])
+testcompile([ex-2.7.3.sv])
+testcompile([ex-3.1a.sv])
+testcompile([ex-3.1b.sv])
+testcompile([ex-4.2.sv])
+testcompile([ex-4.4a.sv])
+testcompile([ex-4.4b.sv])
+testcompile([ex-4.5.sv])
+testcompile([ex-5.1.sv])
+testcompile([ex-5.7.sv])
+testcompile([ex-save-all.sv])
+testcompile([example.sv])
+testcompile([exn-2.3b.sv])
+
+dnl t-complex.sv
+dnl t-exists.sv
+dnl t-fileinto.sv
+dnl t-mailutils.sv
diff --git a/mu-aux/texify.sed b/sieve/tests/envelope.at
similarity index 54%
copy from mu-aux/texify.sed
copy to sieve/tests/envelope.at
index 468001a..a12f0ae 100644
--- a/mu-aux/texify.sed
+++ b/sieve/tests/envelope.at
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2003, 2007, 2010 Free Software Foundation, Inc.
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # GNU Mailutils is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -11,14 +12,18 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc.
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
 
-1{s/\/\*/@comment  /
-b
+MUT_TESTCASE([envelope],[test envelope],
+[
+if envelope "from" "address@hidden" {
+      discard;
 }
-2,/.*\*\//{s/\*\///;s/^/@comment/
-b
-}
-s/\([{}]\)/@\1/g
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+
diff --git a/sieve/tests/exists.at b/sieve/tests/exists.at
new file mode 100644
index 0000000..1fad0a3
--- /dev/null
+++ b/sieve/tests/exists.at
@@ -0,0 +1,50 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([exists: single header],[test exists exists01],
+[
+if exists "X-Caffeine" {
+      discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([exists: array],[test exists exists02],
+[
+if exists [["X-Caffeine", "From"]] {
+      discard;
+}
+],[],[0],[],   
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([exists: array 2],[test exists exists03],
+[
+if exists [["X-Caffeine", "X-Status"]] {
+      discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
diff --git a/sieve/tests/ext.at b/sieve/tests/ext.at
new file mode 100644
index 0000000..9e16f9d
--- /dev/null
+++ b/sieve/tests/ext.at
@@ -0,0 +1,44 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+AT_SETUP([loadable extensions: numaddr])
+AT_KEYWORDS([ext])
+
+AT_CHECK([
+MUT_PREREQ_CAPA([HAVE_LIBLTDL])
+
+AT_DATA([prog],[
+require "test-numaddr";
+
+if numaddr [[ "to", "cc" ]] :over 5
+  {
+    discard;
+  }
+])
+
+cp $top_srcdir/testsuite/spool/bigto.mbox .
+
+sieve MUT_SIEVE_CMDLINE dnl
+ --clearpath -L "${top_builddir}/examples" -f ./bigto.mbox prog
+],
+[0],
+[],
+[DISCARD on msg uid 1: marking as deleted
+])
+
+AT_CLEANUP
+
diff --git a/mu-aux/texify.sed b/sieve/tests/false.at
similarity index 57%
copy from mu-aux/texify.sed
copy to sieve/tests/false.at
index 468001a..0d0750a 100644
--- a/mu-aux/texify.sed
+++ b/sieve/tests/false.at
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2003, 2007, 2010 Free Software Foundation, Inc.
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # GNU Mailutils is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -11,14 +12,17 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc.
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
 
-1{s/\/\*/@comment  /
-b
+MUT_TESTCASE([false],[test constant false],
+[
+if false {
+     discard;
 }
-2,/.*\*\//{s/\*\///;s/^/@comment/
-b
-}
-s/\([{}]\)/@\1/g
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
diff --git a/sieve/tests/header.at b/sieve/tests/header.at
new file mode 100644
index 0000000..bbf8c68
--- /dev/null
+++ b/sieve/tests/header.at
@@ -0,0 +1,64 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([header :is],[test header header-is],
+[
+if header :is "X-Caffeine" "C8H10N4O2" {
+        discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([header arrays],[test header header-arrays],
+[
+if header [["X-Caffeine","Subject"] ["C8H10N4O2","Coffee"]] {
+        discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+DISCARD on msg uid 3: marking as deleted
+])
+
+MUT_TESTCASE([header :matches],[test header matches header-matches],
+[
+if header :matches "Subject" "*$$$*" {
+        discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+m4_pushdef([MUT_SIEVE_MAILBOX],[mbox1])
+MUT_TESTCASE([header :mime],[test header header-mime],
+[
+if header :mime :is "Content-Description" "How doth" {
+      discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+DISCARD on msg uid 3: marking as deleted
+IMPLICIT KEEP on msg uid 4
+IMPLICIT KEEP on msg uid 5
+])
+m4_popdef([MUT_SIEVE_MAILBOX])
diff --git a/sieve/tests/i-casemap.at b/sieve/tests/i-casemap.at
new file mode 100644
index 0000000..ec1b04a
--- /dev/null
+++ b/sieve/tests/i-casemap.at
@@ -0,0 +1,73 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([i-casemap :is],[comparator i-casemap i-casemap-is],
+[
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :is "to" "address@hidden"
+  {
+     discard;
+  }
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([i-casemap :matches],[comparator i-casemap i-casemap-matches],
+[
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :matches "subject" "*you, too,*"
+  {
+    discard;
+  }
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([i-casemap :contains],[comparator i-casemap i-casemap-contains],
+[
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :contains [["from", "to"]] "ExAmPLe"
+  {
+    discard;
+  }
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([i-casemap :regex],[comparator i-casemap i-casemap-regex],
+[
+require "comparator-i;ascii-casemap";
+
+if header :comparator "i;ascii-casemap" :regex "subject" ".*you.*"
+  {
+    discard;
+  }
+],[],[0],[],   
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
diff --git a/sieve/tests/i-numeric.at b/sieve/tests/i-numeric.at
new file mode 100644
index 0000000..14c72ff
--- /dev/null
+++ b/sieve/tests/i-numeric.at
@@ -0,0 +1,46 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([i-numeric :is], [comparator i-numeric is i-numeric-is],
+[
+require "comparator-i;ascii-numeric";
+
+if header :comparator "i;ascii-numeric" :is "X-Number" "15"
+  {
+    discard;
+  }
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+AT_SETUP([i-numeric with contains])
+AT_KEYWORDS([comparator i-numeric is i-numeric-contains])
+MUT_SIEVE_COMPILE([
+require "comparator-i;ascii-numeric";
+
+if header :comparator "i;ascii-numeric" :contains "X-Number" "15"
+  {
+    discard;
+  }
+],[78],[],
+[sieve: prog:5: comparator `i;ascii-numeric' is incompatible with match type 
`contains' in call to `header'
+])
+AT_CLEANUP
+
+
diff --git a/sieve/tests/i-octet.at b/sieve/tests/i-octet.at
new file mode 100644
index 0000000..8d4b6c2
--- /dev/null
+++ b/sieve/tests/i-octet.at
@@ -0,0 +1,75 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([i-octet :is],[comparator i-octet is i-octet-is],
+[
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :is "to" "address@hidden"
+  {
+    discard;
+  }
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([i-octet :matches],[comparator i-octet matches i-octet-matches],
+[
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :matches "subject" "$$$*$$$"
+  {
+    discard;
+  }
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([i-octet :contains],[comparator i-octet contains 
i-octet-contains],
+[
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :contains [["from", "to"]] "example"
+  {
+    discard;
+  }
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+MUT_TESTCASE([i-octet :regex],[comparator i-octet regex i-octet-regex],
+[
+require "comparator-i;octet";
+
+if header :comparator "i;octet" :regex "subject" ".*you.*"
+  {
+    discard;
+  }
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+])
+
+
+
diff --git a/sieve/tests/mul-addr.at b/sieve/tests/mul-addr.at
new file mode 100644
index 0000000..fd1eee1
--- /dev/null
+++ b/sieve/tests/mul-addr.at
@@ -0,0 +1,39 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+m4_pushdef([MUT_SIEVE_MAILBOX],[relational.mbox])
+MUT_TESTCASE([multiple addresses],[test address mul-addr],
+[
+require "fileinto";
+
+if address :localpart :is [["To", "Cc"]] [[ "foo", "oof" ]]
+  {
+    discard;
+  }
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+DISCARD on msg uid 3: marking as deleted
+DISCARD on msg uid 4: marking as deleted
+DISCARD on msg uid 5: marking as deleted
+DISCARD on msg uid 6: marking as deleted
+DISCARD on msg uid 7: marking as deleted
+IMPLICIT KEEP on msg uid 8
+DISCARD on msg uid 9: marking as deleted
+])
+m4_popdef([MUT_SIEVE_MAILBOX])
+
diff --git a/mu-aux/texify.sed b/sieve/tests/not.at
similarity index 55%
copy from mu-aux/texify.sed
copy to sieve/tests/not.at
index 468001a..26962f4 100644
--- a/mu-aux/texify.sed
+++ b/sieve/tests/not.at
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2003, 2007, 2010 Free Software Foundation, Inc.
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # GNU Mailutils is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -11,14 +12,18 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc.
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
 
-1{s/\/\*/@comment  /
-b
+MUT_TESTCASE([not], [test not boolean],
+[
+if not false {
+     discard;
 }
-2,/.*\*\//{s/\*\///;s/^/@comment/
-b
-}
-s/\([{}]\)/@\1/g
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+DISCARD on msg uid 3: marking as deleted
+])
+
+
diff --git a/sieve/testsuite/Redirect b/sieve/tests/redirect.at
similarity index 66%
rename from sieve/testsuite/Redirect
rename to sieve/tests/redirect.at
index 3063f3a..7044ba6 100644
--- a/sieve/testsuite/Redirect
+++ b/sieve/tests/redirect.at
@@ -1,30 +1,41 @@
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
 
-TEST redirect.sv
-PATTERN BEGIN
-REDIRECT on msg uid 1: to address@hidden
-REDIRECT on msg uid 2: to address@hidden
-REDIRECT on msg uid 3: to address@hidden
-PATTERN END
+AT_SETUP([redirect])
+AT_KEYWORDS([action])
+
+AT_CHECK([
+MUT_PREREQ_CAPA([ENABLE_SENDMAIL])
+MTA_DIAG=`pwd`/mta.diag
+MTA_APPEND=1
+export MTA_DIAG MTA_APPEND
 
-FILE BEGIN
-ENVELOPE FROM: address@hidden
+AT_DATA([prog],[
+require "redirect";
+
+redirect "address@hidden";
+])
+cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
+
+sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
+sed 's/ $//' ./mta.diag
+],
+[0],
+[ENVELOPE FROM: address@hidden
 ENVELOPE TO: <address@hidden>
    0: X-Loop-Prevention: address@hidden
    1: From: address@hidden
@@ -40,9 +51,9 @@ ENVELOPE TO: <address@hidden>
   11: for you.  I'm really sorry for all the problems I've caused
   12: for you over the years, but I know we can work this out.
   13: 
-  14: -- 
+  14: --
   15: Wile E. Coyote   "Super Genius"   address@hidden
-  16:
+  16: 
 END OF MESSAGE
 ENVELOPE FROM: address@hidden
 ENVELOPE TO: <address@hidden>
@@ -52,7 +63,7 @@ ENVELOPE TO: <address@hidden>
    3: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
    4: Date: TBD
    5: X-Number: 0015
-   6:
+   6: 
    7: YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
    8: IT!  SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS!  IT WILL
    9: GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
@@ -77,7 +88,10 @@ ENVELOPE TO: <address@hidden>
   10: How about some coffee?
   11: 
 END OF MESSAGE
-FILE END
-TEST END
+],
+[REDIRECT on msg uid 1: to address@hidden
+REDIRECT on msg uid 2: to address@hidden
+REDIRECT on msg uid 3: to address@hidden
+])
 
-# End of Redirect
+AT_CLEANUP
diff --git a/sieve/testsuite/Reject b/sieve/tests/reject.at
similarity index 55%
rename from sieve/testsuite/Reject
rename to sieve/tests/reject.at
index 0794cd3..3e531b7 100644
--- a/sieve/testsuite/Reject
+++ b/sieve/tests/reject.at
@@ -1,66 +1,86 @@
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
 
-TEST reject.sv
-PATTERN BEGIN
-REJECT on msg uid 1
-REJECT on msg uid 2
-REJECT on msg uid 3
-PATTERN END
+AT_SETUP([reject])
+AT_KEYWORDS([action])
 
-FILE BEGIN
-ENVELOPE FROM: address@hidden
+AT_CHECK([
+MUT_PREREQ_CAPA([ENABLE_SENDMAIL])
+MTA_DIAG=`pwd`/mta.diag
+MTA_APPEND=1
+export MTA_DIAG MTA_APPEND
+
+AT_DATA([prog],[
+require "reject";
+
+reject text:
+I don't want to read these messages.
+
+Regards.
+.
+;
+])
+
+AT_DATA([filter.sed],[
+# mta log contains trailing spaces
+s/ $//
+# MIME boundaries are unpredictable, so we replace them with a constant string.
+s/^\( *[[0-9]][[0-9]]*: Content-Type: .*boundary=\).*/\1(boundary)/
+s/^\( *[[0-9]][[0-9]]*:\) --[[0-9]].*/\1 --(boundary)/
+# Same goes for dates.
+s/^\( *[[0-9]][[0-9]]*: The original message was received at *\).*\( from 
.*\)/\1(date)\2/
+s/^\( *[[0-9]][[0-9]]*: Last-Attempt-Date:\).*/\1 (date)/
+])
+
+cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
+
+sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
+sed -f filter.sed ./mta.diag
+],
+[0],
+[ENVELOPE FROM: address@hidden
 ENVELOPE TO: <address@hidden>
    0: To: address@hidden
--re
-   1: Content-Type: multipart/mixed; boundary="[0-9:=-]+"
+   1: Content-Type: multipart/mixed; boundary=(boundary)
    2: MIME-Version: 1.0
-   3:
--re
-   4: [0-9:=-]+
+   3: 
+   4: --(boundary)
    5: Content-Type: text/plain;charset=UTF-8
    6: Content-Transfer-Encoding: 8bit
-   7:
--re
-   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 address@hidden
+   7: 
+   8: The original message was received at (date) from address@hidden
    9: Message was refused by recipient's mail filtering program.
   10: Reason given was as follows:
   11: 
   12: I don't want to read these messages.
   13: 
   14: Regards.
-  15:
--re
-  16: [0-9:=-]+
+  15: 
+  16: --(boundary)
   17: Content-Type: message/delivery-status
-  18:
--re
-  19: Reporting-UA: sieve; GNU Mailutils [0-9][0-9.]*
--re
-  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]*
+  18: 
+  19: Reporting-UA: sieve; GNU Mailutils 2.2.90
+  20: Arrival-Date: Mon, May 07 01:16:47 2001 EEST
   21: Final-Recipient: RFC822; address@hidden
   22: Action: deleted
   23: Disposition: automatic-action/MDN-sent-automatically;deleted
--re
-  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]*
-  25:
--re
-  26: [0-9:=-]+
+  24: Last-Attempt-Date: (date)
+  25: 
+  26: --(boundary)
   27: Content-Type: message/rfc822
   28: 
   29: From: address@hidden
@@ -76,50 +96,41 @@ ENVELOPE TO: <address@hidden>
   39: for you.  I'm really sorry for all the problems I've caused
   40: for you over the years, but I know we can work this out.
   41: 
-  42: -- 
+  42: --
   43: Wile E. Coyote   "Super Genius"   address@hidden
-  44:
--re
-  45: [0-9:=-]+
+  44: 
+  45: --(boundary)
   46: 
 END OF MESSAGE
 ENVELOPE FROM: address@hidden
 ENVELOPE TO: <address@hidden>
    0: To: address@hidden
--re
-   1: Content-Type: multipart/mixed; boundary="[0-9:=-]+"
+   1: Content-Type: multipart/mixed; boundary=(boundary)
    2: MIME-Version: 1.0
-   3:
--re
-   4: [0-9:=-]+
+   3: 
+   4: --(boundary)
    5: Content-Type: text/plain;charset=UTF-8
    6: Content-Transfer-Encoding: 8bit
-   7:
--re
-   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 address@hidden
+   7: 
+   8: The original message was received at (date) from address@hidden
    9: Message was refused by recipient's mail filtering program.
   10: Reason given was as follows:
   11: 
   12: I don't want to read these messages.
   13: 
   14: Regards.
-  15:
--re
-  16: [0-9:=-]+
+  15: 
+  16: --(boundary)
   17: Content-Type: message/delivery-status
-  18:
--re
-  19: Reporting-UA: sieve; GNU Mailutils [0-9][0-9.]*
--re
-  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]*
+  18: 
+  19: Reporting-UA: sieve; GNU Mailutils 2.2.90
+  20: Arrival-Date: Mon, May 07 01:17:15 2001 EEST
   21: Final-Recipient: RFC822; address@hidden
   22: Action: deleted
   23: Disposition: automatic-action/MDN-sent-automatically;deleted
--re
-  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]*
-  25:
--re
-  26: [0-9:=-]+
+  24: Last-Attempt-Date: (date)
+  25: 
+  26: --(boundary)
   27: Content-Type: message/rfc822
   28: 
   29: From: address@hidden
@@ -127,7 +138,7 @@ ENVELOPE TO: <address@hidden>
   31: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
   32: Date: TBD
   33: X-Number: 0015
-  34:
+  34: 
   35: YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
   36: IT!  SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS!  IT WILL
   37: GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
@@ -135,48 +146,39 @@ ENVELOPE TO: <address@hidden>
   39: $20,000 IN LESS THAN TWO MONTHS!  AND IT'S LEGAL!!!!!!!!!
   40: !!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1  JUST
   41: SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
-  42:
--re
-  43: [0-9:=-]+
-  44:
+  42: 
+  43: --(boundary)
+  44: 
 END OF MESSAGE
 ENVELOPE FROM: address@hidden
 ENVELOPE TO: <address@hidden>
    0: To: address@hidden
--re
-   1: Content-Type: multipart/mixed; boundary="[0-9:=-]+"
+   1: Content-Type: multipart/mixed; boundary=(boundary)
    2: MIME-Version: 1.0
-   3:
--re
-   4: [0-9:=-]+
+   3: 
+   4: --(boundary)
    5: Content-Type: text/plain;charset=UTF-8
    6: Content-Transfer-Encoding: 8bit
-   7:
--re
-   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 address@hidden
+   7: 
+   8: The original message was received at (date) from address@hidden
    9: Message was refused by recipient's mail filtering program.
   10: Reason given was as follows:
   11: 
   12: I don't want to read these messages.
   13: 
   14: Regards.
-  15:
--re
-  16: [0-9:=-]+
+  15: 
+  16: --(boundary)
   17: Content-Type: message/delivery-status
-  18:
--re
-  19: Reporting-UA: sieve; GNU Mailutils [0-9][0-9.]*
--re
-  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]*
+  18: 
+  19: Reporting-UA: sieve; GNU Mailutils 2.2.90
+  20: Arrival-Date: Sat, Dec 29 01:28:09 2001 EET
   21: Final-Recipient: RFC822; address@hidden
   22: Action: deleted
   23: Disposition: automatic-action/MDN-sent-automatically;deleted
--re
-  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]*
-  25:
--re
-  26: [0-9:=-]+
+  24: Last-Attempt-Date: (date)
+  25: 
+  26: --(boundary)
   27: Content-Type: message/rfc822
   28: 
   29: Received: (from address@hidden)
@@ -189,12 +191,14 @@ ENVELOPE TO: <address@hidden>
   36: Subject: Coffee
   37: 
   38: How about some coffee?
-  39:
--re
-  40: [0-9:=-]+
+  39: 
+  40: --(boundary)
   41: 
 END OF MESSAGE
-FILE END
-TEST END
+],
+[REJECT on msg uid 1
+REJECT on msg uid 2
+REJECT on msg uid 3
+])
 
-# End of Reject
+AT_CLEANUP
diff --git a/sieve/tests/relational.at b/sieve/tests/relational.at
new file mode 100644
index 0000000..84c199d
--- /dev/null
+++ b/sieve/tests/relational.at
@@ -0,0 +1,105 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+m4_pushdef([MUT_SIEVE_MAILBOX],[relational.mbox])
+m4_pushdef([MUT_SIEVE_OPTIONS],[--set ":mailbox:folder=`pwd`"])
+
+MUT_TESTCASE([relational address],[test relational address comparator 
i-ascii-numeric],
+[
+require [["relational", "comparator-i;ascii-numeric"]];
+
+if address :count "ge" :comparator "i;ascii-numeric" [["to", "cc"] ["3"]]
+  {
+    discard;
+  }
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+IMPLICIT KEEP on msg uid 4
+IMPLICIT KEEP on msg uid 5
+IMPLICIT KEEP on msg uid 6
+IMPLICIT KEEP on msg uid 7
+IMPLICIT KEEP on msg uid 8
+DISCARD on msg uid 9: marking as deleted
+])
+
+MUT_TESTCASE([relational header],[test relational header comparator 
i-ascii-numeric],
+[
+require [["relational", "comparator-i;ascii-numeric"]];
+
+if header :count "gt" [["received"]] [["2"]]
+  {
+    discard;
+  }
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+IMPLICIT KEEP on msg uid 3
+IMPLICIT KEEP on msg uid 4
+IMPLICIT KEEP on msg uid 5
+IMPLICIT KEEP on msg uid 6
+IMPLICIT KEEP on msg uid 7
+IMPLICIT KEEP on msg uid 8
+DISCARD on msg uid 9: marking as deleted
+])
+
+MUT_TESTCASE([relational big test],[test relational relational-hairy],
+[
+require [["relational", "comparator-i;ascii-numeric", "fileinto"]];
+
+if header :value "lt" :comparator "i;ascii-numeric" [["x-priority"]] [["3"]]
+  {
+    fileinto "%Priority";
+  }
+elsif address :count "gt" :comparator "i;ascii-numeric" [["to"]] [["5"]]
+  {
+    # everything with more than 5 recipients in the "to" field
+    # is considered SPAM
+    fileinto "%SPAM";
+  }
+elsif address :value "gt" :all :comparator "i;ascii-casemap" [["from"]] [["M"]]
+  {
+    fileinto "%From_N-Z";
+  }
+else
+  {
+    fileinto "%From_A-M";
+  }
+
+if allof (address :count "eq" :comparator "i;ascii-numeric"
+                  [["to", "cc"]] [["1"]] ,
+          address :all :comparator "i;ascii-casemap"
+                  [["to", "cc"]] [["address@hidden"]])
+  {
+    fileinto "%Only_me";
+  }
+],[],[0],[],
+[FILEINTO on msg uid 1: delivering into %From_A-M
+FILEINTO on msg uid 2: delivering into %From_N-Z
+FILEINTO on msg uid 3: delivering into %Priority
+FILEINTO on msg uid 4: delivering into %Priority
+FILEINTO on msg uid 5: delivering into %Priority
+FILEINTO on msg uid 6: delivering into %From_A-M
+FILEINTO on msg uid 7: delivering into %From_A-M
+FILEINTO on msg uid 8: delivering into %From_A-M
+FILEINTO on msg uid 8: delivering into %Only_me
+FILEINTO on msg uid 9: delivering into %SPAM
+])
+
+m4_popdef([MUT_SIEVE_MAILBOX])
+m4_popdef([MUT_SIEVE_OPTIONS])
diff --git a/sieve/tests/size.at b/sieve/tests/size.at
new file mode 100644
index 0000000..ab20800
--- /dev/null
+++ b/sieve/tests/size.at
@@ -0,0 +1,42 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+MUT_TESTCASE([size :under],[test size under size-under],
+[
+if size :under 400 {
+        discard;
+}
+],[],[0],[],
+[IMPLICIT KEEP on msg uid 1
+IMPLICIT KEEP on msg uid 2
+DISCARD on msg uid 3: marking as deleted
+])
+
+MUT_TESTCASE([size :over],[test size over size-over],
+[
+if size :over 500 {
+        discard;
+}
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+IMPLICIT KEEP on msg uid 3
+])
+
+
+
+
diff --git a/sieve/tests/testsuite.at b/sieve/tests/testsuite.at
new file mode 100644
index 0000000..5070269
--- /dev/null
+++ b/sieve/tests/testsuite.at
@@ -0,0 +1,110 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+# Require a reasonably recent autotest.
+m4_version_prereq([2.52g])
+
+m4_define([AT_SKIP_TEST],[exit 77])
+
+dnl ------------------------------------------------------------
+dnl testcompile(SCRIPT) -- test compilation of the Sieve SCRIPT
+dnl
+m4_define([testcompile],[
+AT_SETUP([compile $1])
+AT_CHECK([sieve -c $top_srcdir/sieve/examples/$1],
+[0])
+AT_CLEANUP
+])
+
+dnl ------------------------------------------------------------
+dnl MUT_SIEVE_OPTIONS  -- additional command line options for Sieve
+m4_define([MUT_SIEVE_OPTIONS])
+
+dnl ------------------------------------------------------------
+dnl MUT_SIEVE_MAILBOX  -- mailbox used for testing
+m4_define([MUT_SIEVE_MAILBOX],[sieve.mbox])
+
+dnl ------------------------------------------------------------
+m4_define([MUT_SIEVE_CMDLINE],[dnl
+ --verbose dnl
+ --line-info=no dnl
+ --no-program-name dnl
+ --no-site-config dnl
+ --no-user-config dnl
+ -M sendmail:$top_builddir/examples/mta dnl
+ --email address@hidden)
+ 
+dnl ------------------------------------------------------------
+dnl MUT_SIEVE_COMPILE(SCRIPT, [ADD-TEST = `'],
+dnl                   [STATUS = `0'], [STDOUT = `'], [STDERR = `'],
+dnl                   [RUN-IF-FAIL], [RUN-IF-PASS])
+dnl      
+m4_define([MUT_SIEVE_COMPILE],[
+AT_DATA([prog],[$1
+])
+AT_CHECK([sieve MUT_SIEVE_OPTIONS -c prog],m4_shift($@))])
+
+dnl ------------------------------------------------------------
+dnl MUT_SIEVE_RUN(SCRIPT, MBOX, [ADD-TEST = `'],
+dnl               [STATUS = `0'], [STDOUT = `'], [STDERR = `'],
+dnl               [RUN-IF-FAIL], [RUN-IF-PASS])
+dnl      
+m4_define([MUT_SIEVE_RUN],[
+AT_DATA([prog],[$1
+])
+AT_CHECK([sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f $2 prog
+               $3],
+               m4_shift(m4_shift(m4_shift($@))))])
+
+m4_define([MUT_TESTCASE],[
+AT_SETUP([$1])
+AT_KEYWORDS([$2])
+cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
+MUT_SIEVE_RUN([$3], ./MUT_SIEVE_MAILBOX, m4_shift(m4_shift(m4_shift($@))))
+AT_CLEANUP])
+
+m4_define([MUT_PREREQ_CAPA],[
+sieve --show-config-options | grep '^$1' > /dev/null 2>&1 || AT_SKIP_TEST
+])
+
+AT_INIT
+
+AT_TESTED([sieve])
+
+m4_include([version.at])
+m4_include([compile.at])
+m4_include([false.at])
+m4_include([true.at])
+m4_include([not.at])
+m4_include([action.at])
+m4_include([address.at])
+m4_include([allof.at])
+m4_include([anyof.at])
+m4_include([envelope.at])
+m4_include([exists.at])
+m4_include([header.at])
+m4_include([i-casemap.at])
+m4_include([i-numeric.at])
+m4_include([i-octet.at])
+m4_include([mul-addr.at])
+m4_include([relational.at])
+m4_include([size.at])
+m4_include([redirect.at])
+m4_include([reject.at])
+m4_include([ext.at])
+
+
diff --git a/mu-aux/texify.sed b/sieve/tests/true.at
similarity index 55%
copy from mu-aux/texify.sed
copy to sieve/tests/true.at
index 468001a..36e8a91 100644
--- a/mu-aux/texify.sed
+++ b/sieve/tests/true.at
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2003, 2007, 2010 Free Software Foundation, Inc.
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # GNU Mailutils is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -11,14 +12,17 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc.
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
 
-1{s/\/\*/@comment  /
-b
+MUT_TESTCASE([true],[test constant true],
+[
+if true {
+        discard;
 }
-2,/.*\*\//{s/\*\///;s/^/@comment/
-b
-}
-s/\([{}]\)/@\1/g
+],[],[0],[],
+[DISCARD on msg uid 1: marking as deleted
+DISCARD on msg uid 2: marking as deleted
+DISCARD on msg uid 3: marking as deleted
+])
+
diff --git a/sieve/tests/version.at b/sieve/tests/version.at
new file mode 100644
index 0000000..e8ae423
--- /dev/null
+++ b/sieve/tests/version.at
@@ -0,0 +1,34 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite. 
+
+AT_SETUP([sieve version])
+
+AT_CHECK([sieve --version | sed '1{s/ *[\[.*\]]//;q}' ],
+         [0],
+         [sieve (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
+],
+[],
+[cat >$[]XFAILFILE <<'_EOT'
+
+==============================================================
+WARNING: Not using the proper version, *all* checks dubious...
+==============================================================
+_EOT
+],
+[rm -f $[]XFAILFILE])
+
+AT_CLEANUP
diff --git a/sieve/testsuite/.gitignore b/sieve/testsuite/.gitignore
deleted file mode 100644
index 989f590..0000000
--- a/sieve/testsuite/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-*.log
-*.sum
-site.exp
-remote.exp
-data
diff --git a/sieve/testsuite/Makefile.am b/sieve/testsuite/Makefile.am
deleted file mode 100644
index e3b77ae..0000000
--- a/sieve/testsuite/Makefile.am
+++ /dev/null
@@ -1,91 +0,0 @@
-## Process this file with GNU Automake to create Makefile.in
-
-##   Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-##
-##   GNU Mailutils is free software; you can redistribute it and/or
-##   modify it under the terms of the GNU General Public License as
-##   published by the Free Software Foundation; either version 3, or (at
-##   your option) any later version.
-##
-##   This program is distributed in the hope that it will be useful, but
-##   WITHOUT ANY WARRANTY; without even the implied warranty of
-##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-##   General Public License for more details.
-##
-##   You should have received a copy of the GNU General Public License
-##   along with this program; if not, write to the Free Software
-##   Foundation, Inc.  51 Franklin Street, Fifth Floor, Boston, MA
-##   02110-1301 USA
-
-AUTOMAKE_OPTIONS = dejagnu
-DEJATOOL = sieve
-RUNTESTFLAGS = 
-CLEANFILES = *.log
-test_dirs = lib sieve scripts
-EXTRA_DIST = Reject Redirect
-
-dist-hook:
-       here=`cd $(top_builddir)/$(subdir) && pwd`; \
-       srcdir=`cd $(srcdir) && pwd`; \
-       distdir=`cd $(distdir) && pwd`; \
-       for dir in $(test_dirs); \
-       do \
-            cd $$srcdir;\
-            mkdir $$distdir/$$dir;\
-           cd $$dir;\
-           for file in DISTFILES `cat DISTFILES`; do \
-               d=$$srcdir/$$dir; \
-               if test -d $$d/$$file; then \
-                    cp -pr $$d/$$file $$distdir/$$dir/$$file; \
-               else \
-                   test -f $$distdir/$$dir/$$file \
-                        || cp -p $$d/$$file $$distdir/$$dir/$$file || exit; \
-                fi; \
-           done;\
-        done;\
-       cd $$here
-
-site.exp: Makefile remote.exp
-       @echo 'Making a new site.exp file...'
-       @test ! -f site.bak || rm -f site.bak
-       @echo '## these variables are automatically generated by make ##' > 
address@hidden
-       @echo '# Do not edit here.  If you wish to override these values' >> 
address@hidden
-       @echo '# edit the last section' >> address@hidden
-       @echo 'set tool $(DEJATOOL)' >> address@hidden
-       @echo "set top_srcdir `cd $(top_srcdir); pwd`" >> address@hidden
-       @echo "set top_builddir `cd $(top_builddir); pwd`" >> address@hidden
-       @echo "set srcdir `cd $(srcdir); pwd`" >> address@hidden
-       @echo 'set objdir' `pwd` >> address@hidden
-       @echo 'set host_alias "$(host_alias)"' >> address@hidden
-       @echo 'set host_triplet $(host_triplet)' >> address@hidden
-       @echo 'set target_alias "$(target_alias)"' >> address@hidden
-       @echo 'set target_triplet $(target_triplet)' >> address@hidden
-       @echo 'set build_alias "$(build_alias)"' >> address@hidden
-       @echo 'set build_triplet $(build_triplet)' >> address@hidden
-       @echo '## All variables above are generated by configure. Do Not Edit 
##' >> address@hidden
-       @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' 
site.exp >> address@hidden
-       @test ! -f site.exp || mv site.exp site.bak
-       @mv address@hidden site.exp
-
-remote.exp:;
-       @echo 'Making a new remote.exp file...'
-       @test ! -f remote.bak || rm -f remote.bak
-       @echo '## These variables are used to set up for the remote testing.' 
>> address@hidden
-       @echo '## Please, read file README in this directory for instructions' 
>> address@hidden
-       @echo '## on how to use this file' >> address@hidden
-       @echo "set host_board `hostname`" >> address@hidden
-       @echo 'set board_info($$host_board,connect) rlogin' >> address@hidden
-       @echo 'set board_info($$host_board,shell_prompt) "\\$$ "' >> 
address@hidden
-       @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); 
pwd`" >> address@hidden
-       @echo "set board_info(\$$host_board,srcdir) `cd $(srcdir); pwd`" >> 
address@hidden
-       @echo "set board_info(\$$host_board,objdir) `pwd`" >> address@hidden
-       @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); 
pwd`" >> address@hidden
-       @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); 
pwd`" >> address@hidden
-       @test ! -f remote.exp || mv remote.exp remote.bak
-       @mv address@hidden remote.exp
-
-
-DISTCLEANFILES=*.exp *.log *.sum 
-
-distclean-local:
-       -rm -rf data
diff --git a/sieve/testsuite/lib/DISTFILES b/sieve/testsuite/lib/DISTFILES
deleted file mode 100644
index aa94470..0000000
--- a/sieve/testsuite/lib/DISTFILES
+++ /dev/null
@@ -1 +0,0 @@
-sieve.exp
diff --git a/sieve/testsuite/lib/sieve.exp b/sieve/testsuite/lib/sieve.exp
deleted file mode 100644
index 83e8e77..0000000
--- a/sieve/testsuite/lib/sieve.exp
+++ /dev/null
@@ -1,153 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-source $top_srcdir/testsuite/lib/mailutils.exp
-set sieve_source_dir "${srcdir}/scripts"
-
-mu_init -noflags
-set env(MAIL) $MU_SPOOL_DIR/sieve.mbox
-set env(FOLDER) $env(MAIL)
-
-set SIEVE_ETC_DIR "$MU_DATA_DIR/etc"
-
-mu_makespool "$MU_RC_DIR" "$SIEVE_ETC_DIR"
-
-# sieve_test [-retcode N][-message MESSAGE][-default (FAIL|XFAIL)]
-#            [-reuse-spool]
-#            [ARGS...][-pattern PATTERN...]
-proc sieve_test {args} {
-    global sieve_source_dir
-    global top_builddir
-    global SIEVE_ETC_DIR
-    global MU_SPOOL_DIR
-    
-    set default ""
-    set sw [list "--config-file=$SIEVE_ETC_DIR/mailutils.rc" \
-                "--verbose" \
-                 "--line-info=no" \
-                 "--no-program-name" \
-                 "-M sendmail:$top_builddir/examples/mta" \
-                "--email address@hidden"]
-    set reuse_spool 0
-    set retcode 0
-    set mailbox "$MU_SPOOL_DIR/sieve.mbox"
-    for {set i 0} {$i < [llength $args]} {incr i} {
-       set a [lindex $args $i]
-       if {"$a" == "-default"} {
-           incr i
-           set default [lindex $args $i]
-       } elseif {"$a" == "-message"} {
-           incr i
-           set message [lindex $args $i]
-       } elseif {"$a" == "-pattern"} {
-           incr i
-           set pattern [lrange $args $i end]
-           break
-       } elseif {"$a" == "-reuse-spool"} {
-           set reuse_spool 1
-           break
-       } elseif {"$a" == "-retcode"} {
-           incr i
-           set retcode [lindex $args $i]
-       } elseif {"$a" == "-f"} {
-           incr i
-           set mailbox [lindex $args $i]
-       } else {
-           set sw [concat $sw [lindex $args $i]]
-       }
-    }
-
-    switch -- "[lindex $sw end]" {
-       ^/.*   { }
-       default {
-           set sw [concat [lrange $sw 0 [expr [llength $sw] - 2]] \
-                       [list "${sieve_source_dir}/[lindex $sw end]"]]
-       }
-    }
-    
-    set sw [concat "-f$mailbox" $sw]
-
-    if {![info exists message]} {
-       set message "[lindex $sw end]"
-    }
-    
-    if {!$reuse_spool} {
-       mu_prepare_spools
-    }
-
-    if [info exists pattern] {
-       mu_exec -default $default -message $message -arg-list $sw \
-               -pattern $pattern -retcode $retcode
-    } else {
-       mu_exec -default $default -message $message -arg-list $sw \
-               -retcode $retcode
-    }
-    #FIXME: examine the output mailbox
-}
-
-proc sieve_driver_test {name mailer diag} {
-    global srcdir
-    set chan [open "${srcdir}/$name" r]
-
-    set state 0
-    set command ""
-    for {gets $chan line} {![eof $chan]} {gets $chan line} {
-       verbose "LINE $line" 1
-       switch -regexp -- "$line" {
-           "^#.*" { }
-           "^TEST END" {
-               verbose "ARGS $args" 1
-               verbose "PATTERN $pattern" 1
-               verbose "OUTPUT $output" 1
-               eval sieve_test $args -pattern $pattern
-               eval mu_test_file "$diag" $output               
-               set state 0
-           }
-           "^TEST" {
-               regexp "^TEST (.*)" $line dummy args
-               set pattern [list]
-               set output [list]
-               set state 1
-           }
-           "^PATTERN BEGIN" {
-               set state 2
-           }
-           "^PATTERN END" {
-               set state 1
-           }
-           "^FILE BEGIN" {
-               set state 3
-           }
-           "^FILE END" {
-               set state 1
-           }
-           "^STOP" {
-               break
-           }
-           default {
-               if {$state == 2} {
-                   lappend pattern $line
-               } elseif {$state == 3} {
-                   lappend output $line
-               }
-           }
-       }
-    }
-    close $chan
-}
diff --git a/sieve/testsuite/scripts/DISTFILES 
b/sieve/testsuite/scripts/DISTFILES
deleted file mode 100644
index 948562e..0000000
--- a/sieve/testsuite/scripts/DISTFILES
+++ /dev/null
@@ -1,46 +0,0 @@
-addr_is_all.sv
-addr_is_domain.sv
-addr_is_local.sv
-addr_matches.sv
-address.sv
-allof00.sv
-allof01.sv
-allof11.sv
-anyof00.sv
-anyof01.sv
-anyof11.sv
-discard.sv
-envelope1.sv
-exists1.sv
-exists2.sv
-exists3.sv
-false.sv
-fileinto.sv
-header1.sv
-header2.sv
-header3.sv
-header-mime.sv
-i-casemap-contains.sv
-i-casemap-is.sv
-i-casemap-matches.sv
-i-casemap-regex.sv
-i-numeric-contains.sv
-i-numeric-is.sv
-i-octet-contains.sv
-i-octet-is.sv
-i-octet-matches.sv
-i-octet-regex.sv
-keep.sv
-mul-addr.sv
-not.sv
-null.sv
-numaddr.sv
-redirect.sv
-reject.sv
-rel-address.sv
-rel-hairy.sv
-rel-header.sv
-size1.sv
-size2.sv
-stop.sv
-true.sv
diff --git a/sieve/testsuite/scripts/addr_is_all.sv 
b/sieve/testsuite/scripts/addr_is_all.sv
deleted file mode 100644
index 9b41867..0000000
--- a/sieve/testsuite/scripts/addr_is_all.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if address :is :all "From" "address@hidden" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/addr_is_domain.sv 
b/sieve/testsuite/scripts/addr_is_domain.sv
deleted file mode 100644
index 5c463de..0000000
--- a/sieve/testsuite/scripts/addr_is_domain.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if address :is :domain "From" "desert.example.org" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/addr_is_local.sv 
b/sieve/testsuite/scripts/addr_is_local.sv
deleted file mode 100644
index db9c6fe..0000000
--- a/sieve/testsuite/scripts/addr_is_local.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if address :is :localpart "From" "youcouldberich!" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/addr_matches.sv 
b/sieve/testsuite/scripts/addr_matches.sv
deleted file mode 100644
index 90936b3..0000000
--- a/sieve/testsuite/scripts/addr_matches.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if address :matches :all "From" "*invalid" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/address.sv 
b/sieve/testsuite/scripts/address.sv
deleted file mode 100644
index 9b41867..0000000
--- a/sieve/testsuite/scripts/address.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if address :is :all "From" "address@hidden" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/allof00.sv 
b/sieve/testsuite/scripts/allof00.sv
deleted file mode 100644
index ff58f38..0000000
--- a/sieve/testsuite/scripts/allof00.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if allof(false,false) {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/allof01.sv 
b/sieve/testsuite/scripts/allof01.sv
deleted file mode 100644
index 04089b7..0000000
--- a/sieve/testsuite/scripts/allof01.sv
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if allof(false,true) {
-        discard;
-}
-
diff --git a/sieve/testsuite/scripts/allof11.sv 
b/sieve/testsuite/scripts/allof11.sv
deleted file mode 100644
index 7d9818a..0000000
--- a/sieve/testsuite/scripts/allof11.sv
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if allof(true,true) {
-        discard;
-}
-
diff --git a/sieve/testsuite/scripts/anyof00.sv 
b/sieve/testsuite/scripts/anyof00.sv
deleted file mode 100644
index 595ea6a..0000000
--- a/sieve/testsuite/scripts/anyof00.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if anyof(false,false) {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/anyof01.sv 
b/sieve/testsuite/scripts/anyof01.sv
deleted file mode 100644
index 0bb3e23..0000000
--- a/sieve/testsuite/scripts/anyof01.sv
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if anyof(false,true) {
-        discard;
-}
-
diff --git a/sieve/testsuite/scripts/anyof11.sv 
b/sieve/testsuite/scripts/anyof11.sv
deleted file mode 100644
index 5c5217f..0000000
--- a/sieve/testsuite/scripts/anyof11.sv
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if anyof(true,true) {
-        discard;
-}
-
diff --git a/sieve/testsuite/scripts/discard.sv 
b/sieve/testsuite/scripts/discard.sv
deleted file mode 100644
index 5a6718b..0000000
--- a/sieve/testsuite/scripts/discard.sv
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-discard;
diff --git a/sieve/testsuite/scripts/envelope1.sv 
b/sieve/testsuite/scripts/envelope1.sv
deleted file mode 100644
index 6e1ef89..0000000
--- a/sieve/testsuite/scripts/envelope1.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if envelope "from" "address@hidden" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/exists1.sv 
b/sieve/testsuite/scripts/exists1.sv
deleted file mode 100644
index fd64a4b..0000000
--- a/sieve/testsuite/scripts/exists1.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if exists "X-Caffeine" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/exists2.sv 
b/sieve/testsuite/scripts/exists2.sv
deleted file mode 100644
index 2b081a4..0000000
--- a/sieve/testsuite/scripts/exists2.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if exists ["X-Caffeine", "From"] {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/exists3.sv 
b/sieve/testsuite/scripts/exists3.sv
deleted file mode 100644
index 628be7b..0000000
--- a/sieve/testsuite/scripts/exists3.sv
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if exists ["X-Caffeine", "X-Status"] {
-        discard;
-}
-
diff --git a/sieve/testsuite/scripts/false.sv b/sieve/testsuite/scripts/false.sv
deleted file mode 100644
index eeeda39..0000000
--- a/sieve/testsuite/scripts/false.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if false {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/fileinto.sv 
b/sieve/testsuite/scripts/fileinto.sv
deleted file mode 100644
index 95fb702..0000000
--- a/sieve/testsuite/scripts/fileinto.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "fileinto";
-
-fileinto "+file";
diff --git a/sieve/testsuite/scripts/header-mime.sv 
b/sieve/testsuite/scripts/header-mime.sv
deleted file mode 100644
index 33a0912..0000000
--- a/sieve/testsuite/scripts/header-mime.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if header :mime :is "Content-Description" "How doth" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/header1.sv 
b/sieve/testsuite/scripts/header1.sv
deleted file mode 100644
index fc25b40..0000000
--- a/sieve/testsuite/scripts/header1.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if header :is "X-Caffeine" "C8H10N4O2" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/header2.sv 
b/sieve/testsuite/scripts/header2.sv
deleted file mode 100644
index 3c959e7..0000000
--- a/sieve/testsuite/scripts/header2.sv
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if header ["X-Caffeine","Subject"] ["C8H10N4O2","Coffee"] {
-        discard;
-}
-
diff --git a/sieve/testsuite/scripts/header3.sv 
b/sieve/testsuite/scripts/header3.sv
deleted file mode 100644
index fcf3235..0000000
--- a/sieve/testsuite/scripts/header3.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if header :matches "Subject" "*$$$*" {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/i-casemap-contains.sv 
b/sieve/testsuite/scripts/i-casemap-contains.sv
deleted file mode 100644
index f8dd74b..0000000
--- a/sieve/testsuite/scripts/i-casemap-contains.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;ascii-casemap";
-
-if header :comparator "i;ascii-casemap" :contains ["from", "to"] "ExAmPLe"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-casemap-is.sv 
b/sieve/testsuite/scripts/i-casemap-is.sv
deleted file mode 100644
index d3cd3d4..0000000
--- a/sieve/testsuite/scripts/i-casemap-is.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;ascii-casemap";
-
-if header :comparator "i;ascii-casemap" :is "to" "address@hidden"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-casemap-matches.sv 
b/sieve/testsuite/scripts/i-casemap-matches.sv
deleted file mode 100644
index 85a8c41..0000000
--- a/sieve/testsuite/scripts/i-casemap-matches.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;ascii-casemap";
-
-if header :comparator "i;ascii-casemap" :matches "subject" "*you, too,*"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-casemap-regex.sv 
b/sieve/testsuite/scripts/i-casemap-regex.sv
deleted file mode 100644
index 7909f39..0000000
--- a/sieve/testsuite/scripts/i-casemap-regex.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;ascii-casemap";
-
-if header :comparator "i;ascii-casemap" :regex "subject" ".*you.*"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-numeric-contains.sv 
b/sieve/testsuite/scripts/i-numeric-contains.sv
deleted file mode 100644
index c80df7b..0000000
--- a/sieve/testsuite/scripts/i-numeric-contains.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;ascii-numeric";
-
-if header :comparator "i;ascii-numeric" :contains "X-Number" "15"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-numeric-is.sv 
b/sieve/testsuite/scripts/i-numeric-is.sv
deleted file mode 100644
index ebae98e..0000000
--- a/sieve/testsuite/scripts/i-numeric-is.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;ascii-numeric";
-
-if header :comparator "i;ascii-numeric" :is "X-Number" "15"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-octet-contains.sv 
b/sieve/testsuite/scripts/i-octet-contains.sv
deleted file mode 100644
index bb559e2..0000000
--- a/sieve/testsuite/scripts/i-octet-contains.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;octet";
-
-if header :comparator "i;octet" :contains ["from", "to"] "example"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-octet-is.sv 
b/sieve/testsuite/scripts/i-octet-is.sv
deleted file mode 100644
index a4ff1d7..0000000
--- a/sieve/testsuite/scripts/i-octet-is.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;octet";
-
-if header :comparator "i;octet" :is "to" "address@hidden"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-octet-matches.sv 
b/sieve/testsuite/scripts/i-octet-matches.sv
deleted file mode 100644
index d7b8233..0000000
--- a/sieve/testsuite/scripts/i-octet-matches.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;octet";
-
-if header :comparator "i;octet" :matches "subject" "$$$*$$$"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/i-octet-regex.sv 
b/sieve/testsuite/scripts/i-octet-regex.sv
deleted file mode 100644
index 6a4703d..0000000
--- a/sieve/testsuite/scripts/i-octet-regex.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "comparator-i;octet";
-
-if header :comparator "i;octet" :regex "subject" ".*you.*"
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/keep.sv b/sieve/testsuite/scripts/keep.sv
deleted file mode 100644
index 9e8c837..0000000
--- a/sieve/testsuite/scripts/keep.sv
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-keep;
diff --git a/sieve/testsuite/scripts/mul-addr.sv 
b/sieve/testsuite/scripts/mul-addr.sv
deleted file mode 100644
index fd4b077..0000000
--- a/sieve/testsuite/scripts/mul-addr.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "fileinto";
-
-if address :localpart :is ["To", "Cc"] [ "foo", "oof" ]
-  {
-    discard;
-  } 
diff --git a/sieve/testsuite/scripts/not.sv b/sieve/testsuite/scripts/not.sv
deleted file mode 100644
index 27b7370..0000000
--- a/sieve/testsuite/scripts/not.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if not false {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/null.sv b/sieve/testsuite/scripts/null.sv
deleted file mode 100644
index 02e27a4..0000000
--- a/sieve/testsuite/scripts/null.sv
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-# Empty script to test implicit keep.
diff --git a/sieve/testsuite/scripts/numaddr.sv 
b/sieve/testsuite/scripts/numaddr.sv
deleted file mode 100644
index 2f63cdd..0000000
--- a/sieve/testsuite/scripts/numaddr.sv
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "test-numaddr";
-
-if numaddr [ "to", "cc" ] :over 5
-  {
-    discard;
-  }
diff --git a/sieve/testsuite/scripts/redirect.sv 
b/sieve/testsuite/scripts/redirect.sv
deleted file mode 100644
index aac6c52..0000000
--- a/sieve/testsuite/scripts/redirect.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "redirect";
-
-redirect "address@hidden";
diff --git a/sieve/testsuite/scripts/reject.sv 
b/sieve/testsuite/scripts/reject.sv
deleted file mode 100644
index c164dec..0000000
--- a/sieve/testsuite/scripts/reject.sv
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require "reject";
-
-reject text:
-I don't want to read these messages.
-
-Regards.
-.
-;
diff --git a/sieve/testsuite/scripts/rel-address.sv 
b/sieve/testsuite/scripts/rel-address.sv
deleted file mode 100644
index 103298d..0000000
--- a/sieve/testsuite/scripts/rel-address.sv
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2003, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require ["relational", "comparator-i;ascii-numeric"];
-
-if address :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"]
-  {
-    discard;
-  }
-
-# End of rel-address.sv
diff --git a/sieve/testsuite/scripts/rel-hairy.sv 
b/sieve/testsuite/scripts/rel-hairy.sv
deleted file mode 100644
index f319f19..0000000
--- a/sieve/testsuite/scripts/rel-hairy.sv
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2003, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require ["relational", "comparator-i;ascii-numeric", "fileinto"];
-
-if header :value "lt" :comparator "i;ascii-numeric" ["x-priority"] ["3"]
-  {
-    fileinto "%Priority";
-  }
-elsif address :count "gt" :comparator "i;ascii-numeric" ["to"] ["5"]
-  {
-    # everything with more than 5 recipients in the "to" field
-    # is considered SPAM
-    fileinto "%SPAM";
-  }
-elsif address :value "gt" :all :comparator "i;ascii-casemap" ["from"] ["M"]
-  {
-    fileinto "%From_N-Z";
-  }
-else
-  {
-    fileinto "%From_A-M";
-  }
-
-if allof (address :count "eq" :comparator "i;ascii-numeric"
-                  ["to", "cc"] ["1"] ,
-          address :all :comparator "i;ascii-casemap"
-                  ["to", "cc"] ["address@hidden"])
-  {
-    fileinto "%Only_me";
-  }
-
-# End of rel-hairy.sv
diff --git a/sieve/testsuite/scripts/rel-header.sv 
b/sieve/testsuite/scripts/rel-header.sv
deleted file mode 100644
index 1a131fa..0000000
--- a/sieve/testsuite/scripts/rel-header.sv
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2003, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-require ["relational", "comparator-i;ascii-numeric"];
-
-if header :count "gt" ["received"] ["2"]
-  {
-    discard;
-  }
-
-# End of rel-address.sv
diff --git a/sieve/testsuite/scripts/size1.sv b/sieve/testsuite/scripts/size1.sv
deleted file mode 100644
index 023656a..0000000
--- a/sieve/testsuite/scripts/size1.sv
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if size :under 400 {
-        discard;
-}
-
diff --git a/sieve/testsuite/scripts/size2.sv b/sieve/testsuite/scripts/size2.sv
deleted file mode 100644
index 49a271e..0000000
--- a/sieve/testsuite/scripts/size2.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if size :over 500 {
-       discard;
-}
diff --git a/sieve/testsuite/scripts/stop.sv b/sieve/testsuite/scripts/stop.sv
deleted file mode 100644
index 9a6335d..0000000
--- a/sieve/testsuite/scripts/stop.sv
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-stop;
diff --git a/sieve/testsuite/scripts/true.sv b/sieve/testsuite/scripts/true.sv
deleted file mode 100644
index 64068d0..0000000
--- a/sieve/testsuite/scripts/true.sv
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- sieve -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2010 Free Software Foundation, Inc.
-# See file COPYING for distribution conditions.
-
-if true {
-       discard;
-}
diff --git a/sieve/testsuite/sieve/DISTFILES b/sieve/testsuite/sieve/DISTFILES
deleted file mode 100644
index ab33c2b..0000000
--- a/sieve/testsuite/sieve/DISTFILES
+++ /dev/null
@@ -1,19 +0,0 @@
-action.exp
-address.exp
-allof.exp
-anyof.exp
-envelope.exp
-exists.exp
-ext.exp
-false.exp
-header.exp
-i-casemap.exp
-i-numeric.exp
-i-octet.exp
-mul-addr.exp
-not.exp
-redirect.exp
-reject.exp
-relational.exp
-size.exp
-true.exp
diff --git a/sieve/testsuite/sieve/action.exp b/sieve/testsuite/sieve/action.exp
deleted file mode 100644
index fcb1d6e..0000000
--- a/sieve/testsuite/sieve/action.exp
+++ /dev/null
@@ -1,91 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test stop.sv -pattern\
-"STOP on msg uid 1"\
-"STOP on msg uid 2"\
-"STOP on msg uid 3"
-
-sieve_test null.sv -pattern\
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test keep.sv -pattern\
-"KEEP on msg uid 1"\
-"KEEP on msg uid 2"\
-"KEEP on msg uid 3"
-
-sieve_test discard.sv -pattern\
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"DISCARD on msg uid 3: marking as deleted"
-
-sieve_test --set "mailbox.folder=\"'$MU_SPOOL_DIR'\"" fileinto.sv -pattern\
-"FILEINTO on msg uid 1: delivering into +file"\
-"FILEINTO on msg uid 2: delivering into +file"\
-"FILEINTO on msg uid 3: delivering into +file"
-
-mu_test_file "$MU_SPOOL_DIR/file" \
-"From address@hidden Sun May  6 22:16:47 2001"\
-"From: address@hidden"\
-"To: address@hidden"\
-"Subject: I have a present for you"\
-"X-Caffeine: C8H10N4O2"\
-""\
-"Look, I'm sorry about the whole anvil thing, and I really"\
-"didn't mean to try and drop it on you from the top of the"\
-"cliff.  I want to try to make it up to you.  I've got some"\
-"great birdseed over here at my place--top of the line"\
-"stuff--and if you come by, I'll have it all wrapped up"\
-"for you.  I'm really sorry for all the problems I've caused"\
-"for you over the years, but I know we can work this out."\
-""\
--- "--"\
-"Wile E. Coyote   \"Super Genius\"   address@hidden"\
-""\
-"From address@hidden Sun May  6 22:17:15 2001"\
-"From: address@hidden"\
-"To: address@hidden"\
-"Subject: \$\$\$ YOU, TOO, CAN BE A MILLIONAIRE! \$\$\$"\
-"Date: TBD"\
-"X-Number: 0015"\
-""\
-"YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT"\
-"IT!  SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS!  IT WILL"\
-"GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!"\
-"MONEY! MONEY! COLD HARD CASH!  YOU WILL RECEIVE OVER"\
-"\$20,000 IN LESS THAN TWO MONTHS!  AND IT'S LEGAL!!!!!!!!!"\
-"!!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1  JUST"\
-"SEND \$5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!"\
-""\
-"From address@hidden  Fri Dec 28 23:28:09 2001"\
-"Received: (from address@hidden)"\
-"\tby dontmailme.org id fERKR9N16790"\
-"\tfor address@hidden; Fri, 28 Dec 2001 22:18:08 +0200"\
-"Date: Fri, 28 Dec 2001 23:28:08 +0200"\
-"From: Bar <address@hidden>"\
-"To: Foo Bar <address@hidden>"\
-"Message-Id: <address@hidden>"\
-"Subject: Coffee"\
-""\
-"How about some coffee?"
-
-# end of action.exp
-
diff --git a/sieve/testsuite/sieve/address.exp 
b/sieve/testsuite/sieve/address.exp
deleted file mode 100644
index 60f0909..0000000
--- a/sieve/testsuite/sieve/address.exp
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test addr_is_all.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test addr_is_domain.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test addr_is_local.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"DISCARD on msg uid 2: marking as deleted"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test addr_matches.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"DISCARD on msg uid 2: marking as deleted"\
-"IMPLICIT KEEP on msg uid 3"
-
-# end of address.exp
diff --git a/sieve/testsuite/sieve/allof.exp b/sieve/testsuite/sieve/allof.exp
deleted file mode 100644
index 1cdfa1e..0000000
--- a/sieve/testsuite/sieve/allof.exp
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test allof00.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test allof01.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test allof11.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"DISCARD on msg uid 3: marking as deleted"
-
-# end of allof.exp
diff --git a/sieve/testsuite/sieve/anyof.exp b/sieve/testsuite/sieve/anyof.exp
deleted file mode 100644
index 7f720a6..0000000
--- a/sieve/testsuite/sieve/anyof.exp
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test anyof00.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test anyof01.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"DISCARD on msg uid 3: marking as deleted"
-
-sieve_test anyof11.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"DISCARD on msg uid 3: marking as deleted"
-
-# end of anyof.exp
diff --git a/sieve/testsuite/sieve/compile.exp 
b/sieve/testsuite/sieve/compile.exp
deleted file mode 100644
index dd7d5c0..0000000
--- a/sieve/testsuite/sieve/compile.exp
+++ /dev/null
@@ -1,52 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
-
-set exdir "${srcdir}/../examples"
-
-set scripts [list\
-             ex-null.sv\
-             box.sv\
-             ex-1.10.2.sv\
-             ex-2.3a.sv\
-             ex-2.5.1.sv\
-             ex-2.7.3.sv\
-             ex-3.1a.sv\
-             ex-3.1b.sv\
-             ex-4.2.sv\
-             ex-4.4a.sv\
-             ex-4.4b.sv\
-             ex-4.5.sv\
-             ex-5.1.sv\
-             ex-5.7.sv\
-             ex-save-all.sv\
-             example.sv\
-             exn-2.3b.sv]
-
-# t-complex.sv
-# t-exists.sv
-# t-fileinto.sv
-# t-mailutils.sv
-
-
-for {set s $scripts} {[llength $s] != 0} {set s [lrange $s 1 end]} {
-    set source_name [lindex $s 0]
-    mu_exec -message "sieve -c $source_name" \
-           -arg -c -arg ${exdir}/$source_name
-}
-
-# end of compile.exp
diff --git a/sieve/testsuite/sieve/envelope.exp 
b/sieve/testsuite/sieve/envelope.exp
deleted file mode 100644
index 3c94fe0..0000000
--- a/sieve/testsuite/sieve/envelope.exp
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test envelope1.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-# end of envelope.exp
diff --git a/sieve/testsuite/sieve/exists.exp b/sieve/testsuite/sieve/exists.exp
deleted file mode 100644
index 5f7b514..0000000
--- a/sieve/testsuite/sieve/exists.exp
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test exists1.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test exists2.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test exists3.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-# end of exists.exp
diff --git a/sieve/testsuite/sieve/ext.exp b/sieve/testsuite/sieve/ext.exp
deleted file mode 100644
index ac34c44..0000000
--- a/sieve/testsuite/sieve/ext.exp
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-mu_version
-if ![mu_check_capability HAVE_LIBLTDL] {
-    unsupported "This test requires libltdl"
-} else {
-    sieve_test --clearpath -L "${top_builddir}/examples" -f 
${MU_SPOOL_DIR}/bigto.mbox numaddr.sv -pattern \
-       "DISCARD on msg uid 1: marking as deleted"
-}
-# End of ext.exp
diff --git a/sieve/testsuite/sieve/false.exp b/sieve/testsuite/sieve/false.exp
deleted file mode 100644
index f1709f5..0000000
--- a/sieve/testsuite/sieve/false.exp
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test false.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-# end of false.exp
diff --git a/sieve/testsuite/sieve/header.exp b/sieve/testsuite/sieve/header.exp
deleted file mode 100644
index 91a0e33..0000000
--- a/sieve/testsuite/sieve/header.exp
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test header1.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test header2.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"DISCARD on msg uid 3: marking as deleted"
-
-sieve_test header3.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"DISCARD on msg uid 2: marking as deleted"\
-"IMPLICIT KEEP on msg uid 3"
-
-sieve_test -f "$MU_SPOOL_DIR/mbox1" header-mime.sv  -pattern \
-       "IMPLICIT KEEP on msg uid 1"\
-       "IMPLICIT KEEP on msg uid 2"\
-       "DISCARD on msg uid 3: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 4"\
-       "IMPLICIT KEEP on msg uid 5"
-
-# end of header.exp
diff --git a/sieve/testsuite/sieve/i-casemap.exp 
b/sieve/testsuite/sieve/i-casemap.exp
deleted file mode 100644
index 08cf4fb..0000000
--- a/sieve/testsuite/sieve/i-casemap.exp
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test i-casemap-is.sv -pattern \
-       "DISCARD on msg uid 1: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 2"\
-       "IMPLICIT KEEP on msg uid 3"
-
-sieve_test i-casemap-matches.sv -pattern \
-       "IMPLICIT KEEP on msg uid 1"\
-       "DISCARD on msg uid 2: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 3"
-
-sieve_test i-casemap-contains.sv -pattern \
-       "DISCARD on msg uid 1: marking as deleted"\
-       "DISCARD on msg uid 2: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 3"
-
-sieve_test i-casemap-regex.sv -pattern \
-       "DISCARD on msg uid 1: marking as deleted"\
-       "DISCARD on msg uid 2: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 3"
-
-# end of i-casemap.exp
diff --git a/sieve/testsuite/sieve/i-numeric.exp 
b/sieve/testsuite/sieve/i-numeric.exp
deleted file mode 100644
index 82cc7e6..0000000
--- a/sieve/testsuite/sieve/i-numeric.exp
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test i-numeric-is.sv -pattern \
-       "IMPLICIT KEEP on msg uid 1"\
-       "DISCARD on msg uid 2: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 3"
-
-sieve_test i-numeric-contains.sv -retcode 78 -pattern \
-       -re ".*i-numeric-contains.sv:9: comparator `i;ascii-numeric' is 
incompatible with match type `contains' in call to `header'"
-
-# end of i-numeric.exp
diff --git a/sieve/testsuite/sieve/i-octet.exp 
b/sieve/testsuite/sieve/i-octet.exp
deleted file mode 100644
index 18abe89..0000000
--- a/sieve/testsuite/sieve/i-octet.exp
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test i-octet-is.sv -pattern \
-       "DISCARD on msg uid 1: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 2"\
-       "IMPLICIT KEEP on msg uid 3"
-
-sieve_test i-octet-matches.sv -pattern \
-       "IMPLICIT KEEP on msg uid 1"\
-       "DISCARD on msg uid 2: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 3"
-
-sieve_test i-octet-contains.sv -pattern \
-       "DISCARD on msg uid 1: marking as deleted"\
-       "DISCARD on msg uid 2: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 3"
-
-sieve_test i-octet-regex.sv -pattern \
-       "DISCARD on msg uid 1: marking as deleted"\
-       "IMPLICIT KEEP on msg uid 2"\
-       "IMPLICIT KEEP on msg uid 3"
-
-# end of i-octet.exp
diff --git a/sieve/testsuite/sieve/mul-addr.exp 
b/sieve/testsuite/sieve/mul-addr.exp
deleted file mode 100644
index 2d63ae3..0000000
--- a/sieve/testsuite/sieve/mul-addr.exp
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test -f $MU_SPOOL_DIR/relational.mbox mul-addr.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"DISCARD on msg uid 3: marking as deleted"\
-"DISCARD on msg uid 4: marking as deleted"\
-"DISCARD on msg uid 5: marking as deleted"\
-"DISCARD on msg uid 6: marking as deleted"\
-"DISCARD on msg uid 7: marking as deleted"\
-"IMPLICIT KEEP on msg uid 8"\
-"DISCARD on msg uid 9: marking as deleted"
-
-# End of mul-addr.exp
diff --git a/sieve/testsuite/sieve/not.exp b/sieve/testsuite/sieve/not.exp
deleted file mode 100644
index 346629e..0000000
--- a/sieve/testsuite/sieve/not.exp
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test not.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"DISCARD on msg uid 3: marking as deleted"
-
-# end of not.exp
diff --git a/sieve/testsuite/sieve/redirect.exp 
b/sieve/testsuite/sieve/redirect.exp
deleted file mode 100644
index c947000..0000000
--- a/sieve/testsuite/sieve/redirect.exp
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-mu_version
-if ![mu_check_capability ENABLE_SENDMAIL] {
-    unsupported "Support for sendmail not compiled in"
-} else {
-    set mtafile "$MU_FOLDER_DIR/mta.diag"
-    set env(MTA_DIAG) "$mtafile"
-    set env(MTA_APPEND) 1
-
-    set mailer "sendmail:$top_builddir/examples/mta"
-
-    sieve_driver_test "Redirect" "$mailer" "$mtafile"
-}
-# End of redirect.exp  
-
-
diff --git a/sieve/testsuite/sieve/reject.exp b/sieve/testsuite/sieve/reject.exp
deleted file mode 100644
index 2a904a7..0000000
--- a/sieve/testsuite/sieve/reject.exp
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-mu_version
-if ![mu_check_capability ENABLE_SENDMAIL] {
-    unsupported "Support for sendmail not compiled in"
-} else {
-    set mtafile "$MU_FOLDER_DIR/mta.diag"
-    set env(MTA_DIAG) "$mtafile"
-    set env(MTA_APPEND) 1
-
-    set mailer "sendmail:$top_builddir/examples/mta"
-
-    sieve_driver_test "Reject" "$mailer" "$mtafile"
-}
-# End of reject.exp    
-
-
diff --git a/sieve/testsuite/sieve/relational.exp 
b/sieve/testsuite/sieve/relational.exp
deleted file mode 100644
index 79866ec..0000000
--- a/sieve/testsuite/sieve/relational.exp
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test -f $MU_SPOOL_DIR/relational.mbox rel-address.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"\
-"IMPLICIT KEEP on msg uid 4"\
-"IMPLICIT KEEP on msg uid 5"\
-"IMPLICIT KEEP on msg uid 6"\
-"IMPLICIT KEEP on msg uid 7"\
-"IMPLICIT KEEP on msg uid 8"\
-"DISCARD on msg uid 9: marking as deleted"
-
-sieve_test -f $MU_SPOOL_DIR/relational.mbox rel-header.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"IMPLICIT KEEP on msg uid 3"\
-"IMPLICIT KEEP on msg uid 4"\
-"IMPLICIT KEEP on msg uid 5"\
-"IMPLICIT KEEP on msg uid 6"\
-"IMPLICIT KEEP on msg uid 7"\
-"IMPLICIT KEEP on msg uid 8"\
-"DISCARD on msg uid 9: marking as deleted"
-
-sieve_test -f $MU_SPOOL_DIR/relational.mbox rel-hairy.sv -pattern \
-"FILEINTO on msg uid 1: delivering into %From_A-M"\
-"FILEINTO on msg uid 2: delivering into %From_N-Z"\
-"FILEINTO on msg uid 3: delivering into %Priority"\
-"FILEINTO on msg uid 4: delivering into %Priority"\
-"FILEINTO on msg uid 5: delivering into %Priority"\
-"FILEINTO on msg uid 6: delivering into %From_A-M"\
-"FILEINTO on msg uid 7: delivering into %From_A-M"\
-"FILEINTO on msg uid 8: delivering into %From_A-M"\
-"FILEINTO on msg uid 8: delivering into %Only_me"\
-"FILEINTO on msg uid 9: delivering into %SPAM"
-
-# End of relational.exp
diff --git a/sieve/testsuite/sieve/size.exp b/sieve/testsuite/sieve/size.exp
deleted file mode 100644
index bdca47f..0000000
--- a/sieve/testsuite/sieve/size.exp
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test size1.sv -pattern \
-"IMPLICIT KEEP on msg uid 1"\
-"IMPLICIT KEEP on msg uid 2"\
-"DISCARD on msg uid 3: marking as deleted"
-
-sieve_test size2.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"IMPLICIT KEEP on msg uid 3"
-
-# end of size.exp
diff --git a/sieve/testsuite/sieve/true.exp b/sieve/testsuite/sieve/true.exp
deleted file mode 100644
index 7fc7e02..0000000
--- a/sieve/testsuite/sieve/true.exp
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- tcl -*-
-# This file is part of Mailutils testsuite.
-# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
-#  
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#   
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#  
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-
-sieve_test true.sv -pattern \
-"DISCARD on msg uid 1: marking as deleted"\
-"DISCARD on msg uid 2: marking as deleted"\
-"DISCARD on msg uid 3: marking as deleted"
-
-# end of true.exp
diff --git a/testsuite/spool/sieve.mbox b/testsuite/spool/sieve.mbox
index c760e79..d74be27 100644
--- a/testsuite/spool/sieve.mbox
+++ b/testsuite/spool/sieve.mbox
@@ -12,7 +12,7 @@ stuff--and if you come by, I'll have it all wrapped up
 for you.  I'm really sorry for all the problems I've caused
 for you over the years, but I know we can work this out.
 
--- 
+--
 Wile E. Coyote   "Super Genius"   address@hidden
 
 From address@hidden Sun May  6 22:17:15 2001


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]