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-311-g2d75640


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-311-g2d75640
Date: Wed, 22 Dec 2010 20:54:39 +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=2d75640f30de68fc3659fc740edaa9043fea5e8e

The branch, master has been updated
       via  2d75640f30de68fc3659fc740edaa9043fea5e8e (commit)
       via  b2d144c529a2e0f452885958cd49a38403d7750c (commit)
       via  252fcde9b5643eb23703dc16bad6625a47994f1b (commit)
      from  2a4b7ae3830b57341e29c0fd80545b6ed12b68fa (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 2d75640f30de68fc3659fc740edaa9043fea5e8e
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Dec 22 22:42:27 2010 +0200

    Improve debug parser and output functions.
    
    New parser accepts range specifications (mailbox.trace3-prot).
    mu_debug_format_spec outputs specs in the canonical form.
    
    * include/mailutils/debug.h (MU_DEBUG_LEVEL_RANGE): New macro.
    (mu_debug_set_category_level): Change return type to int.
    (mu_debug_get_category_level): New proto.
    * libmailutils/diag/debug.c (mu_debug_set_category_level): Change
    return type to int.
    (mu_debug_get_category_level): New function.
    (mu_debug_level_from_string): New function.
    (parse_spec): Accept range specification.  Negation at the start
    of spec implies 'proto'.
    (mu_debug_format_spec): Rewrite.
    
    * libmailutils/tests/debugspec.c: New file.
    * libmailutils/tests/debugspec.at: New file.
    * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add debugspec.
    (TESTSUITE_AT): add debugspec.at
    * libmailutils/tests/testsuite.at: Include debugspec.at.
    * libmailutils/tests/.gitignore: Add debugspec.
    
    * sieve/sieve.c: Do not advertise 'T' and 'P' arguments to --debug.
    (debug_level): Remove.
    (set_debug_level): Rewrite the handling of legacy debug specifiers 'TP'.

commit b2d144c529a2e0f452885958cd49a38403d7750c
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Dec 22 20:10:08 2010 +0200

    Improve debugging; fix c522de119a.
    
    * include/mailutils/types.hin (mu_debug_handle_t)
    (mu_debug_level_t): New data types.
    * include/mailutils/debug.h (mu_debug_level_p)
    (mu_debug_category_level)
    (mu_debug_set_category_level): Change argument types to
    mu_debug_handle_t/mu_debug_level_t.
    * libmailutils/diag/debug.c: Likewise.
    
    * libmailutils/server/acl.c (_run_entry): Call mu_debug_log_nl
    instead of mu_debug_log_end with an empty format string.
    
    * include/mailutils/sieve.h
    * libmailutils/filter/base64.c
    * libmailutils/stream/stream.c
    * libmu_sieve/conf.c
    * libmu_sieve/extensions/spamd.c
    * libmu_sieve/sieve.y
    * sieve/sieve.c: Commit the changes c522de119a failed to commit.

commit 252fcde9b5643eb23703dc16bad6625a47994f1b
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Dec 22 18:23:50 2010 +0200

    Bugfixes.
    
    * libmailutils/filter/iconvflt.c (_icvt_decoder): Do not iconv_close
    if cd is -1.
    * mh/mboxprop.c (mh_mailbox_get_cur): Ignore whitespace following the cur
    value.

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

Summary of changes:
 include/mailutils/debug.h                          |   18 ++-
 include/mailutils/sieve.h                          |    3 +
 include/mailutils/types.hin                        |    2 +
 libmailutils/diag/debug.c                          |  211 +++++++++++++-----
 libmailutils/filter/base64.c                       |    9 +-
 libmailutils/filter/iconvflt.c                     |    3 +-
 libmailutils/server/acl.c                          |    2 +-
 libmailutils/stream/stream.c                       |    9 +-
 libmailutils/tests/.gitignore                      |    1 +
 libmailutils/tests/Makefile.am                     |    2 +
 libmailutils/tests/debugspec.at                    |   85 ++++++++
 examples/iconv.c => libmailutils/tests/debugspec.c |   76 +++++---
 libmailutils/tests/testsuite.at                    |    1 +
 libmu_sieve/conf.c                                 |   10 +
 libmu_sieve/extensions/spamd.c                     |  226 ++++++++++++++------
 libmu_sieve/sieve.y                                |    3 +-
 mh/mboxprop.c                                      |    2 +
 sieve/sieve.c                                      |   24 ++-
 18 files changed, 518 insertions(+), 169 deletions(-)
 create mode 100644 libmailutils/tests/debugspec.at
 copy examples/iconv.c => libmailutils/tests/debugspec.c (50%)

diff --git a/include/mailutils/debug.h b/include/mailutils/debug.h
index b87fbc6..7ccc46b 100644
--- a/include/mailutils/debug.h
+++ b/include/mailutils/debug.h
@@ -48,6 +48,10 @@ extern int mu_debug_line_info;
 
 #define MU_DEBUG_LEVEL_MASK(lev) (1 << (lev))
 #define MU_DEBUG_LEVEL_UPTO(lev) ((1 << ((lev)+1)) - 1)
+#define MU_DEBUG_LEVEL_RANGE(a, b)                                     \
+  ((a) == 0 ? MU_DEBUG_LEVEL_UPTO (b) :                                        
\
+              MU_DEBUG_LEVEL_UPTO (b) & ~MU_DEBUG_LEVEL_UPTO ((a) - 1))
+
 
 struct sockaddr;
 void mu_sockaddr_to_str (const struct sockaddr *sa, int salen,
@@ -58,14 +62,20 @@ char *mu_sockaddr_to_astr (const struct sockaddr *sa, int 
salen);
 
 size_t mu_debug_register_category (char *name);
 size_t mu_debug_next_handle (void);
-int mu_debug_level_p (int catn, int level);
-void mu_debug_enable_category (const char *catname, size_t catlen, int level);
+int mu_debug_level_p (mu_debug_handle_t catn, mu_debug_level_t level);
+void mu_debug_enable_category (const char *catname, size_t catlen,
+                              mu_debug_level_t level);
 void mu_debug_disable_category (const char *catname, size_t catlen);
-int mu_debug_category_level (const char *catname, size_t catlen, int *plev);
+int mu_debug_category_level (const char *catname, size_t catlen,
+                            mu_debug_level_t *plev);
 void mu_debug_parse_spec (const char *spec);  
 int mu_debug_format_spec(mu_stream_t str, const char *names, int showunset);
 
-void mu_debug_set_category_level (int catn, int level);
+int mu_debug_get_category_level (mu_debug_handle_t catn,
+                                mu_debug_level_t *plev);
+int mu_debug_set_category_level (mu_debug_handle_t catn,
+                                mu_debug_level_t level);
+  
 void mu_debug_clear_all (void);
   
 void mu_debug_log (const char *fmt, ...) MU_PRINTFLIKE(1,2);
diff --git a/include/mailutils/sieve.h b/include/mailutils/sieve.h
index 833dc9f..941f820 100644
--- a/include/mailutils/sieve.h
+++ b/include/mailutils/sieve.h
@@ -120,10 +120,13 @@ typedef struct
 #define MU_SIEVE_DRY_RUN      0x0008
 
 extern int mu_sieve_yydebug;
+extern mu_debug_handle_t mu_sieve_debug_handle;
 extern mu_list_t mu_sieve_include_path;
 extern mu_list_t mu_sieve_library_path;
 extern mu_list_t mu_sieve_library_path_prefix;
 
+void mu_sieve_debug_init (void);
+  
 /* Memory allocation functions */
 void *mu_sieve_alloc (size_t size);
 void *mu_sieve_palloc (mu_list_t * pool, size_t size);
diff --git a/include/mailutils/types.hin b/include/mailutils/types.hin
index 78802f1..bea8672 100644
--- a/include/mailutils/types.hin
+++ b/include/mailutils/types.hin
@@ -120,6 +120,8 @@ typedef struct _mu_secret *mu_secret_t;
 typedef struct _mu_mime_io_buffer *mu_mime_io_buffer_t;
 
 typedef void (*mu_onexit_t) (void*);
+typedef unsigned int mu_debug_handle_t;
+typedef unsigned int mu_debug_level_t;
 
 #define MU_FOLDER_ATTRIBUTE_DIRECTORY  0x001
 #define MU_FOLDER_ATTRIBUTE_FILE       0x002
diff --git a/libmailutils/diag/debug.c b/libmailutils/diag/debug.c
index 092d3d5..5916de1 100644
--- a/libmailutils/diag/debug.c
+++ b/libmailutils/diag/debug.c
@@ -38,7 +38,7 @@ int mu_debug_line_info;          /* Debug messages include 
source locations */
 struct debug_category
 {
   char *name;
-  size_t level;
+  mu_debug_level_t level;
   int isset;
 };
 
@@ -103,7 +103,7 @@ mu_debug_next_handle ()
 }
 
 int
-mu_debug_level_p (int catn, int level)
+mu_debug_level_p (mu_debug_handle_t catn, mu_debug_level_t level)
 {
   return catn < catcnt
     && ((cattab[catn].isset ? cattab[catn].level : cattab[0].level) &
@@ -111,16 +111,16 @@ mu_debug_level_p (int catn, int level)
 }
 
 int
-mu_debug_category_match (int catn, int mask)
+mu_debug_category_match (mu_debug_handle_t catn, mu_debug_level_t mask)
 {
   return catn < catcnt
     && ((cattab[catn].isset ? cattab[catn].level : cattab[0].level) & mask);
 }
 
-static size_t
+static mu_debug_handle_t
 find_category (const char *name, size_t len)
 {
-  size_t i;
+  mu_debug_handle_t i;
 
   for (i = 0; i < catcnt; i++)
     {
@@ -128,14 +128,15 @@ find_category (const char *name, size_t len)
          memcmp (cattab[i].name, name, len) == 0)
        return i;
     }
-  return -1;
+  return (mu_debug_handle_t)-1;
 }
 
 void
-mu_debug_enable_category (const char *catname, size_t catlen, int level)
+mu_debug_enable_category (const char *catname, size_t catlen,
+                         mu_debug_level_t level)
 {
-  size_t catn = find_category (catname, catlen);
-  if (catn == (size_t)-1)
+  mu_debug_handle_t catn = find_category (catname, catlen);
+  if (catn == (mu_debug_handle_t)-1)
     {
       mu_error (_("unknown category: %.*s"), (int) catlen, catname);
       return;
@@ -148,7 +149,7 @@ void
 mu_debug_disable_category (const char *catname, size_t catlen)
 {
   size_t catn = find_category (catname, catlen);
-  if (catn == (size_t)-1)
+  if (catn == (mu_debug_handle_t)-1)
     {
       mu_error (_("unknown category: %.*s"), (int) catlen, catname);
       return;
@@ -157,14 +158,15 @@ mu_debug_disable_category (const char *catname, size_t 
catlen)
 }
 
 int
-mu_debug_category_level (const char *catname, size_t catlen, int *plev)
+mu_debug_category_level (const char *catname, size_t catlen,
+                        mu_debug_level_t *plev)
 {
-  size_t catn;
+  mu_debug_handle_t catn;
 
   if (catname)
     {
       catn = find_category (catname, catlen);
-      if (catn == (size_t)-1) 
+      if (catn == (mu_debug_handle_t)-1) 
        return MU_ERR_NOENT;
     }
   else
@@ -173,23 +175,78 @@ mu_debug_category_level (const char *catname, size_t 
catlen, int *plev)
   return 0;
 }
 
-void
-mu_debug_set_category_level (int catn, int level)
+int
+mu_debug_set_category_level (mu_debug_handle_t catn, mu_debug_level_t level)
 {
   if (catn < catcnt)
     {
       cattab[catn].isset = 1;
       cattab[catn].level = level;
+      return 0;
     }
-  else
-    abort ();
+  return MU_ERR_NOENT;
 }
   
+int
+mu_debug_get_category_level (mu_debug_handle_t catn, mu_debug_level_t *plev)
+{
+  if (catn < catcnt)
+    {
+      if (!cattab[catn].isset)
+       *plev = 0;
+      else
+       *plev = cattab[catn].level;
+      return 0;
+    }
+  return MU_ERR_NOENT;
+}
+
+static char *mu_debug_level_str[] = {
+  "error",
+  "trace0",
+  "trace1",
+  "trace2",
+  "trace3",
+  "trace4",
+  "trace5",
+  "trace6",
+  "trace7",
+  "trace8",
+  "trace9",
+  "prot"   
+};
+
+static int
+mu_debug_level_from_string (const char *str, mu_debug_level_t *lev,
+                           char **endp)
+{
+  int i;
+  const char *p;
+  char *q;
+    
+  for (i = 0; i < MU_ARRAY_SIZE (mu_debug_level_str); i++)
+    {
+      for (p = str, q = mu_debug_level_str[i]; ; p++, q++)
+       {
+         if (!*q)
+           {
+             if (endp)
+               *endp = (char*) p;
+             *lev = i;
+             return 0;
+           }
+         if (*q != *p)
+           break;
+       }
+    }
+  return MU_ERR_NOENT;
+}
+
 static void
 parse_spec (const char *spec)
 {
   char *q;
-  int level;
+  mu_debug_level_t level;
 
   if (mu_isdigit (*spec))
     {
@@ -229,18 +286,21 @@ parse_spec (const char *spec)
          else
            {
              size_t i;
-             unsigned lev = 0;
-             unsigned xlev = 0;
+             mu_debug_level_t lev = 0;
+             mu_debug_level_t xlev = 0;
+             char *end;
              
              for (i = 0; i < ws.ws_wordc; i++)
                {
                  char *s = ws.ws_wordv[i];
                  int exact = 0;
-                 unsigned n;
-                 unsigned *tgt = &lev;
+                 mu_debug_level_t n;
+                 mu_debug_level_t *tgt = &lev;
                  
                  if (*s == '!')
                    {
+                     if (i == 0)
+                       lev = MU_DEBUG_LEVEL_UPTO (MU_DEBUG_PROT);
                      tgt = &xlev;
                      s++;
                    }
@@ -250,20 +310,37 @@ parse_spec (const char *spec)
                      s++;
                    }
 
-                 if (strcmp (s, "error") == 0)
-                   n = MU_DEBUG_ERROR;
-                 else if (strcmp (s, "prot") == 0)
-                   n = MU_DEBUG_PROT;
-                 else if (strlen (s) == 6 && memcmp (s, "trace", 5) == 0 &&
-                          mu_isdigit (s[5]))
-                   n = MU_DEBUG_TRACE0 + s[5] - '0';
-                 else
+                 if (mu_debug_level_from_string (s, &n, &end))
                    {
                      mu_error (_("unknown level `%s'"), s);
                      continue;
                    }
-
-                 if (exact)
+                 else if (*end == '-')
+                   {
+                     mu_debug_level_t l;
+                     
+                     s = end + 1;
+                     if (mu_debug_level_from_string (s, &l, &end))
+                       {
+                         mu_error (_("unknown level `%s'"), s);
+                         continue;
+                       }
+                     else if (*end)
+                       {
+                         mu_error (_("invalid level: %s"), s);
+                         continue;
+                       }
+                     if (n < l)
+                       *tgt |= MU_DEBUG_LEVEL_RANGE (n, l);
+                     else
+                       *tgt |= MU_DEBUG_LEVEL_RANGE (l, n);
+                   }
+                 else if (*end)
+                   {
+                     mu_error (_("invalid level: %s"), s);
+                     continue;
+                   }
+                 else if (exact)
                    *tgt |= MU_DEBUG_LEVEL_MASK (n);
                  else
                    *tgt |= MU_DEBUG_LEVEL_UPTO (n);
@@ -315,21 +392,6 @@ mu_debug_clear_all ()
 
 #define _LEVEL_ALL MU_DEBUG_LEVEL_UPTO(MU_DEBUG_PROT)
 
-static char *mu_debug_level_str[] = {
-  "error",
-  "trace0",
-  "trace1",
-  "trace2",
-  "trace3",
-  "trace4",
-  "trace5",
-  "trace6",
-  "trace7",
-  "trace8",
-  "trace9",
-  "prot"   
-};
-
 static int
 name_matches (char **names, char *str)
 {
@@ -342,7 +404,7 @@ name_matches (char **names, char *str)
 }
 
 int
-mu_debug_format_spec(mu_stream_t str, const char *names, int showunset)
+mu_debug_format_spec (mu_stream_t str, const char *names, int showunset)
 {
   int i;
   size_t cnt = 0;
@@ -362,6 +424,7 @@ mu_debug_format_spec(mu_stream_t str, const char *names, 
int showunset)
     {
       if (names && !name_matches (ws.ws_wordv, cattab[i].name))
        continue;
+      
       if (cattab[i].isset && cattab[i].level)
        {
          if (cnt)
@@ -370,28 +433,58 @@ mu_debug_format_spec(mu_stream_t str, const char *names, 
int showunset)
              if (rc)
                break;
            }
-         rc = mu_stream_printf(str, "%s", cattab[i].name);
+         rc = mu_stream_printf (str, "%s", cattab[i].name);
          if (rc)
            break;
          if (cattab[i].level != _LEVEL_ALL)
            {
-             int j;
+             mu_debug_level_t j = MU_DEBUG_ERROR, minl, maxl;
              int delim = '.';
-             
-             for (j = MU_DEBUG_ERROR; j <= MU_DEBUG_PROT; j++)
-               if (cattab[i].level & MU_DEBUG_LEVEL_MASK(j))
-                 {
-                   rc = mu_stream_printf(str, "%c%s", delim,
-                                         mu_debug_level_str[j]);
-                   if (rc)
+
+             while (1)
+               {
+                 /* Find the least bit set */
+                 for (; j <= MU_DEBUG_PROT; j++)
+                   if (cattab[i].level & MU_DEBUG_LEVEL_MASK (j))
                      break;
-                   delim = ',';
-                 }
+
+                 if (j > MU_DEBUG_PROT)
+                   break;
+                 
+                 minl = j;
+
+                 for (; j + 1 <= MU_DEBUG_PROT &&
+                        cattab[i].level & MU_DEBUG_LEVEL_MASK (j + 1);
+                      j++)
+                   ;
+                 
+                 maxl = j++;
+
+                 if (minl == maxl)
+                   rc = mu_stream_printf (str, "%c=%s", delim,
+                                          mu_debug_level_str[minl]);
+                 else if (minl == 0)
+                   rc = mu_stream_printf (str, "%c%s", delim,
+                                          mu_debug_level_str[maxl]);
+                 else
+                   rc = mu_stream_printf (str, "%c%s-%s", delim,
+                                          mu_debug_level_str[minl],
+                                          mu_debug_level_str[maxl]);
+                 if (rc)
+                   break;
+                 delim = ',';
+               }
            }
          cnt++;
        }
       else if (showunset)
        {
+         if (cnt)
+           {
+             rc = mu_stream_printf(str, ";");
+             if (rc)
+               break;
+           }
          rc = mu_stream_printf(str, "!%s", cattab[i].name);
          if (rc)
            break;
diff --git a/libmailutils/filter/base64.c b/libmailutils/filter/base64.c
index 0208576..e56d299 100644
--- a/libmailutils/filter/base64.c
+++ b/libmailutils/filter/base64.c
@@ -110,6 +110,7 @@ _base64_decoder (void *xd MU_ARG_UNUSED,
                 enum mu_filter_command cmd,
                 struct mu_filter_io *iobuf)
 {
+  enum mu_filter_result result = mu_filter_ok;
   int i = 0, tmp = 0, pad = 0;
   size_t consumed = 0;
   unsigned char data[4];
@@ -165,14 +166,18 @@ _base64_decoder (void *xd MU_ARG_UNUSED,
       else
        {
          /* I did not get all the data.  */
-         consumed -= i;
+         if (cmd != mu_filter_lastbuf)
+           {
+             consumed -= i;
+             result = mu_filter_again;
+           }
          break;
        }
       i = 0;
     }
   iobuf->isize = consumed;
   iobuf->osize = nbytes;
-  return mu_filter_ok;
+  return result;
 }
 
 enum base64_state
diff --git a/libmailutils/filter/iconvflt.c b/libmailutils/filter/iconvflt.c
index 3c9565f..3267eb7 100644
--- a/libmailutils/filter/iconvflt.c
+++ b/libmailutils/filter/iconvflt.c
@@ -100,7 +100,8 @@ _icvt_decoder (void *xd,
       return mu_filter_ok;
 
     case mu_filter_done:
-      iconv_close (_icvt->cd);
+      if (_icvt->cd != (iconv_t) -1)
+       iconv_close (_icvt->cd);
       free (_icvt->fromcode);
       free (_icvt->tocode);
       return mu_filter_ok;
diff --git a/libmailutils/server/acl.c b/libmailutils/server/acl.c
index 5cebc99..296055d 100644
--- a/libmailutils/server/acl.c
+++ b/libmailutils/server/acl.c
@@ -688,7 +688,7 @@ _run_entry (void *item, void *data)
                if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
                  {
                    debug_sockaddr (rp->sa, rp->salen);
-                   mu_debug_log_end ("");
+                   mu_debug_log_nl ();
                  }
              }
          }
diff --git a/libmailutils/stream/stream.c b/libmailutils/stream/stream.c
index 7b6a3c7..f1c838d 100644
--- a/libmailutils/stream/stream.c
+++ b/libmailutils/stream/stream.c
@@ -1202,16 +1202,21 @@ mu_stream_truncate (mu_stream_t stream, mu_off_t size)
 int
 mu_stream_shutdown (mu_stream_t stream, int how)
 {
+  int rc;
+  
   if (!(stream->flags & _MU_STR_OPEN))
     {
       if (stream->open)
        return MU_ERR_NOT_OPEN;
       _stream_init (stream);
     }
-  
+
+  rc = mu_stream_flush (stream);
+  if (rc)
+    return rc;
   if (stream->shutdown)
     return stream->shutdown (stream, how);
-  return ENOSYS;
+  return 0;
 }
 
 int
diff --git a/libmailutils/tests/.gitignore b/libmailutils/tests/.gitignore
index 8bdc039..d205efe 100644
--- a/libmailutils/tests/.gitignore
+++ b/libmailutils/tests/.gitignore
@@ -6,6 +6,7 @@ testsuite.dir
 testsuite.log
 addr
 argcv
+debugspec
 decode2047
 encode2047
 fltst
diff --git a/libmailutils/tests/Makefile.am b/libmailutils/tests/Makefile.am
index 6add3b2..8128d88 100644
--- a/libmailutils/tests/Makefile.am
+++ b/libmailutils/tests/Makefile.am
@@ -41,6 +41,7 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
 INCLUDES = @MU_LIB_COMMON_INCLUDES@ 
 noinst_PROGRAMS = \
  addr\
+ debugspec\
  decode2047\
  encode2047\
  fltst\
@@ -64,6 +65,7 @@ TESTSUITE_AT = \
  address.at\
  base64d.at\
  base64e.at\
+ debugspec.at\
  decode2047.at\
  encode2047.at\
  fromflt.at\
diff --git a/libmailutils/tests/debugspec.at b/libmailutils/tests/debugspec.at
new file mode 100644
index 0000000..a6d1c76
--- /dev/null
+++ b/libmailutils/tests/debugspec.at
@@ -0,0 +1,85 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 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.
+#
+# GNU Mailutils 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/>.
+
+dnl ------------------------------------------------------------
+dnl TESTDBG([KW = `'], [ARGS], [STDOUT = `'],
+dnl         [STDERR = `'])
+dnl
+m4_pushdef([TESTDBG],[
+AT_SETUP([debugspec: $2])
+AT_KEYWORDS([debugspec debug dbgspec $1])
+AT_CHECK([debugspec $2],
+[0],
+[$3],
+[$4])
+AT_CLEANUP])
+
+dnl ------------------------------------------------------------
+TESTDBG([debugspec00],[mailbox],
+[mailbox
+])
+
+TESTDBG([debugspec01],[mailbox.=trace2],
+[mailbox.=trace2
+])
+
+TESTDBG([debugspec02],[mailbox.trace3],
+[mailbox.trace3
+])
+
+TESTDBG([debugspec03],[mailbox.!trace3],
+[mailbox.trace4-prot
+])
+
+TESTDBG([debugspec04],[mailbox.!=trace3],
+[mailbox.trace2,trace4-prot
+])
+
+TESTDBG([debugspec05],[mailbox.!=prot],
+[mailbox.trace9
+])
+
+TESTDBG([debugspec06],[mailbox.prot,!=trace4],
+[mailbox.trace3,trace5-prot
+])
+
+TESTDBG([debugspec07],[mailbox.prot,!trace4],
+[mailbox.trace5-prot
+])
+
+TESTDBG([debugspec08],[mailbox.trace2-trace5],
+[mailbox.trace2-trace5
+])
+
+TESTDBG([debugspec09],[mailbox.trace2-trace5,trace7-prot],
+[mailbox.trace2-trace5,trace7-prot
+])
+
+TESTDBG([debugspec10],
+['mailbox.error,=trace3,=trace7,=trace9;mailer.trace7,!trace2'],
+[mailbox.=error,=trace3,=trace7,=trace9;mailer.trace3-trace7
+])
+
+TESTDBG([debugspec11],
+[-showunset -names='mailbox;mailer;filter' dnl
+ 'mailbox.error,=trace3,=trace7,=trace9;mailer.trace7,!trace2'],
+[!filter;mailbox.=error,=trace3,=trace7,=trace9;mailer.trace3-trace7
+])
+
+dnl ------------------------------------------------------------
+
+m4_popdef([TESTDBG])
+
diff --git a/examples/iconv.c b/libmailutils/tests/debugspec.c
similarity index 50%
copy from examples/iconv.c
copy to libmailutils/tests/debugspec.c
index 1e3195f..f6d75fd 100644
--- a/examples/iconv.c
+++ b/libmailutils/tests/debugspec.c
@@ -1,5 +1,6 @@
 /* GNU Mailutils -- a suite of utilities for electronic mail
-   Copyright (C) 2004, 2005, 2007, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2005, 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
@@ -17,43 +18,64 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include <unistd.h>
 #include <stdio.h>
-#include <stdlib.h>
+#include <assert.h>
+#include <ctype.h>
 #include <string.h>
-#include <errno.h>
-#include <unistd.h>
-
 #include <mailutils/mailutils.h>
 
 int
 main (int argc, char **argv)
 {
-  int i;
-  mu_stream_t in, out;
-  mu_stream_t cvt;
-  const char *args[5] = { "iconv" };
+  char *names = NULL;
+  int showunset = 0;
+  char *arg;
   
-  if (argc < 3 || argc > 4)
+  mu_set_program_name (argv[0]);
+  mu_stdstream_setup ();
+
+  if (argc == 1)
     {
-      fprintf (stderr, "usage: %s from-code to-code [err]\n", argv[0]);
-      return 1;
+      mu_printf ("usage: %s spec\n", argv[0]);
+      return 0;
     }
 
-  MU_ASSERT (mu_stdio_stream_create (&in, MU_STDIN_FD, 0));
-  args[1] = argv[1];
-  args[2] = argv[2];
-  i = 3;
-  if (argc == 4)
-    args[i++] = argv[3];
-  args[i] = NULL;
+  while (argc--)
+    {
+      arg = *++argv;
+
+      if (strncmp (arg, "-names=", 7) == 0)
+       names = arg + 7;
+      else if (strcmp (arg, "-showunset") == 0)
+       showunset = 1;
+      else if (arg[0] == '-')
+       {
+         if (arg[1] == '-' && arg[2] == 0)
+           {
+             argc--;
+             argv++;
+             break;
+           }
+         mu_error ("unrecognised argument: %s", arg);
+         return 1;
+       }
+      else
+       break;
+    }
+
+  if (argc != 1)
+    {
+      mu_error ("usage: %s spec", mu_program_name);
+      return 1;
+    }
+  
+  mu_debug_parse_spec (arg);
+  
+  mu_debug_format_spec (mu_strout, names, showunset);
+  mu_printf ("\n");
   
-  MU_ASSERT (mu_filter_create_args (&cvt, in, args[0], i, args,
-                                   MU_FILTER_DECODE,
-                                   MU_FILTER_READ));
-  mu_stream_unref (in);
-  MU_ASSERT (mu_stdio_stream_create (&out, MU_STDOUT_FD, 0));
-  MU_ASSERT (mu_stream_copy (out, cvt, 0, NULL));
-  mu_stream_unref (cvt);
-  mu_stream_flush (out);
   return 0;
 }
+
+    
diff --git a/libmailutils/tests/testsuite.at b/libmailutils/tests/testsuite.at
index d16cd99..52cbf61 100644
--- a/libmailutils/tests/testsuite.at
+++ b/libmailutils/tests/testsuite.at
@@ -68,4 +68,5 @@ m4_include([prop.at])
 m4_include([inline-comment.at])
 m4_include([hdrflt.at])
 m4_include([linecon.at])
+m4_include([debugspec.at])
 
diff --git a/libmu_sieve/conf.c b/libmu_sieve/conf.c
index 7c322a5..32b4c5a 100644
--- a/libmu_sieve/conf.c
+++ b/libmu_sieve/conf.c
@@ -26,6 +26,15 @@ mu_list_t mu_sieve_include_path = NULL;
 mu_list_t mu_sieve_library_path = NULL;
 mu_list_t mu_sieve_library_path_prefix = NULL;
 
+mu_debug_handle_t mu_sieve_debug_handle;
+
+void
+mu_sieve_debug_init ()
+{
+  if (!mu_sieve_debug_handle)
+    mu_sieve_debug_handle = mu_debug_register_category ("sieve");
+}
+
 static int
 _path_append (void *item, void *data)
 {
@@ -65,5 +74,6 @@ mu_sieve_module_init (enum mu_gocs_op op, void *data)
   mu_list_destroy (&p->library_path);
   mu_list_destroy (&p->library_path_prefix);
   mu_list_destroy (&p->include_path);
+  mu_sieve_debug_init ();
   return 0;
 }
diff --git a/libmu_sieve/extensions/spamd.c b/libmu_sieve/extensions/spamd.c
index fb746e1..804840e 100644
--- a/libmu_sieve/extensions/spamd.c
+++ b/libmu_sieve/extensions/spamd.c
@@ -45,7 +45,7 @@ static int
 spamd_connect_tcp (mu_sieve_machine_t mach, mu_stream_t *stream,
                   char *host, int port)
 {
-  int rc = mu_tcp_stream_create (stream, host, port, 0);
+  int rc = mu_tcp_stream_create (stream, host, port, MU_STREAM_RDWR);
   if (rc)
     {
       mu_sieve_error (mach, "mu_tcp_stream_create: %s", mu_strerror (rc));
@@ -57,7 +57,7 @@ spamd_connect_tcp (mu_sieve_machine_t mach, mu_stream_t 
*stream,
 static int
 spamd_connect_socket (mu_sieve_machine_t mach, mu_stream_t *stream, char *path)
 {
-  int rc = mu_socket_stream_create (stream, path, 0);
+  int rc = mu_socket_stream_create (stream, path, MU_STREAM_RDWR);
   if (rc)
     {
       mu_sieve_error (mach, "mu_socket_stream_create: %s", mu_strerror (rc));
@@ -91,7 +91,12 @@ spamd_send_message (mu_stream_t stream, mu_message_t msg)
 {
   int rc;
   mu_stream_t mstr, flt;
-
+  struct mu_buffer_query newbuf, oldbuf;
+  int bufchg = 0;
+  mu_debug_handle_t dlev;
+  int xlev;
+  int xlevchg = 0;
+  
   rc = mu_message_get_streamref (msg, &mstr);
   if (rc)
     return rc;
@@ -103,47 +108,60 @@ spamd_send_message (mu_stream_t stream, mu_message_t msg)
       return rc;
     }
 
+  /* Ensure effective transport buffering */
+  if (mu_stream_ioctl (stream, MU_IOCTL_TRANSPORT_BUFFER,
+                      MU_IOCTL_OP_GET, &oldbuf) == 0)
+    {
+      newbuf.type = MU_TRANSPORT_OUTPUT;
+      newbuf.buftype = mu_buffer_full;
+      newbuf.bufsize = 64*1024;
+      mu_stream_ioctl (stream, MU_IOCTL_TRANSPORT_BUFFER, MU_IOCTL_OP_SET, 
+                      &newbuf);
+      bufchg = 1;
+    }
+
+  if (mu_debug_category_level ("sieve", 5, &dlev) == 0 &&
+      !(dlev & MU_DEBUG_LEVEL_MASK (MU_DEBUG_TRACE9)))
+    {
+      /* Mark out the following data as payload */
+      xlev = MU_XSCRIPT_PAYLOAD;
+      if (mu_stream_ioctl (stream, MU_IOCTL_XSCRIPTSTREAM,
+                          MU_IOCTL_XSCRIPTSTREAM_LEVEL, &xlev) == 0)
+       xlevchg = 1;
+    }
+  
   rc = mu_stream_copy (stream, flt, 0, NULL);
 
+  /* Restore prior transport buffering and xscript level */
+  if (bufchg)
+    mu_stream_ioctl (stream, MU_IOCTL_TRANSPORT_BUFFER, MU_IOCTL_OP_SET, 
+                    &oldbuf);
+  if (xlevchg)
+    mu_stream_ioctl (stream, MU_IOCTL_XSCRIPTSTREAM,
+                    MU_IOCTL_XSCRIPTSTREAM_LEVEL, &xlev);
+  
   mu_stream_destroy (&mstr);
   mu_stream_destroy (&flt);
   return rc;
 }
 
-static size_t
-spamd_read_line (mu_sieve_machine_t mach, mu_stream_t stream,
-                char *buffer, size_t size, size_t *pn)
-{
-  size_t n = 0;
-  int rc = mu_stream_readline (stream, buffer, size, &n);
-  if (rc == 0)
-    {
-      if (pn)
-       *pn = n;
-      while (n > 0 && (buffer[n-1] == '\r' || buffer[n-1] == '\n'))
-       n--;
-      buffer[n] = 0;
-      if (mu_sieve_get_debug_level (mach) & MU_SIEVE_DEBUG_TRACE)
-       mu_sieve_debug (mach, ">> %s\n", buffer);
-    }
-  return rc;
-}
-
 #define char_to_num(c) (c-'0')
 
 static void
-decode_float (long *vn, char *str, int digits)
+decode_float (long *vn, const char *str, int digits, char **endp)
 {
   long v;
   size_t frac = 0;
   size_t base = 1;
   int i;
   int negative = 0;
+  char *end;
   
   for (i = 0; i < digits; i++)
     base *= 10;
   
-  v = strtol (str, &str, 10);
+  v = strtol (str, &end, 10);
+  str = end;
   if (v < 0)
     {
       negative = 1;
@@ -153,12 +171,16 @@ decode_float (long *vn, char *str, int digits)
   v *= base;
   if (*str == '.')
     {
-      for (str++, i = 0; *str && i < digits; i++, str++)
+      for (str++, i = 0; *str && mu_isdigit (*str) && i < digits;
+          i++, str++)
        frac = frac * 10 + char_to_num (*str);
-      if (*str)
+      if (*str && mu_isdigit (*str))
        {
          if (char_to_num (*str) >= 5)
            frac++;
+         if (endp)
+           while (*str && mu_isdigit (*str))
+             str++;
        }
       else
        for (; i < digits; i++)
@@ -167,6 +189,8 @@ decode_float (long *vn, char *str, int digits)
   *vn = v + frac;
   if (negative)
     *vn = - *vn;
+  if (endp)
+    *endp = (char*) str;
 }
 
 static int
@@ -209,6 +233,7 @@ spamd_abort (mu_sieve_machine_t mach, mu_stream_t *stream, 
signal_handler handle
 }
 
 static int got_sigpipe;
+static signal_handler handler;
 
 static RETSIGTYPE
 sigpipe_handler (int sig MU_ARG_UNUSED)
@@ -216,6 +241,60 @@ sigpipe_handler (int sig MU_ARG_UNUSED)
   got_sigpipe = 1;
 }
 
+static void
+spamd_read_line (mu_sieve_machine_t mach, mu_stream_t stream,
+                char **pbuffer, size_t *psize)
+{
+  size_t n;
+  int rc = mu_stream_getline (stream, pbuffer, psize, &n);
+  if (rc == 0)
+    mu_rtrim_cset (*pbuffer, "\r\n");
+  else
+    {
+      /* FIXME: Need an 'onabort' mechanism in Sieve machine, which
+        would restore the things to their prior state.  This will
+        also allow to make handler local again. */
+      free (pbuffer);
+      mu_sieve_error (mach, "read error: %s", mu_strerror (rc));
+      spamd_abort (mach, &stream, handler);
+    }
+}
+
+static int
+parse_response_line (mu_sieve_machine_t mach, const char *buffer)
+{
+  const char *str;
+  char *end;
+  long version;
+  unsigned long resp;
+  
+  str = buffer;
+  if (strncmp (str, "SPAMD/", 6))
+    return MU_ERR_BADREPLY;
+  str += 6;
+
+  decode_float (&version, str, 1, &end);
+  if (version < 10)
+    {
+      mu_sieve_error (mach, _("unsupported SPAMD version: %s"), str);
+      return MU_ERR_BADREPLY;
+    }
+
+  str = mu_str_skip_class (end, MU_CTYPE_SPACE);
+  if (!*str || !mu_isdigit (*str))
+    {
+      mu_sieve_error (mach, _("malformed spamd response: %s"), buffer);
+      return MU_ERR_BADREPLY;
+    }
+
+  resp = strtoul (str, &end, 10);
+  if (resp != 0)
+    {
+      mu_sieve_error (mach, _("spamd failure: %lu %s"), resp, end);
+      return MU_ERR_REPLY;
+    }
+  return 0;
+}
 
 /* The test proper */
 
@@ -246,20 +325,19 @@ sigpipe_handler (int sig MU_ARG_UNUSED)
 static int
 spamd_test (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
 {
-  char buffer[512];
-  char version_str[19];
+  char *buffer = NULL;
+  size_t size = 0;
   char spam_str[6], score_str[21], threshold_str[21];
-  int response, rc;
-  long version;
+  int rc;
   int result;
   long score, threshold, limit;
-  mu_stream_t stream = NULL;
+  mu_stream_t stream = NULL, null;
   mu_sieve_value_t *arg;
   mu_message_t msg;
-  size_t m_size, m_lines, size;
-  signal_handler handler;
+  size_t m_size, m_lines;
   char *host;
   mu_header_t hdr;
+  mu_debug_handle_t lev = 0;
   
   if (mu_sieve_get_debug_level (mach) & MU_SIEVE_DEBUG_TRACE)
     {
@@ -284,11 +362,37 @@ spamd_test (mu_sieve_machine_t mach, mu_list_t args, 
mu_list_t tags)
   if (result) /* spamd_connect_ already reported error */
     mu_sieve_abort (mach);
 
+  mu_stream_set_buffer (stream, mu_buffer_line, 0);
+  if (mu_debug_category_level ("sieve", 5, &lev) == 0 &&
+      (lev & MU_DEBUG_LEVEL_MASK (MU_DEBUG_PROT)))
+    {
+      int rc;
+      mu_stream_t dstr, xstr;
+      
+      rc = mu_dbgstream_create (&dstr, MU_DIAG_DEBUG);
+      if (rc)
+       mu_error (_("cannot create debug stream; transcript disabled: %s"),
+                 mu_strerror (rc));
+      else
+       {
+         rc = mu_xscript_stream_create (&xstr, stream, dstr, NULL);
+         if (rc)
+           mu_error (_("cannot create transcript stream: %s"),
+                     mu_strerror (rc));
+         else
+           {
+             mu_stream_unref (stream);
+             stream = xstr;
+           }
+       }
+    }
+
   msg = mu_sieve_get_message (mach);
   mu_message_size (msg, &m_size);
   mu_message_lines (msg, &m_lines);
 
   spamd_send_command (stream, "SYMBOLS SPAMC/1.2");
+  
   spamd_send_command (stream, "Content-length: %lu",
                      (u_long) (m_size + m_lines));
   if (mu_sieve_tag_lookup (tags, "user", &arg))
@@ -307,7 +411,7 @@ spamd_test (mu_sieve_machine_t mach, mu_list_t args, 
mu_list_t tags)
   spamd_send_message (stream, msg);
   mu_stream_shutdown (stream, MU_STREAM_WRITE);
 
-  spamd_read_line (mach, stream, buffer, sizeof buffer, NULL);
+  spamd_read_line (mach, stream, &buffer, &size);
 
   if (got_sigpipe)
     {
@@ -315,25 +419,10 @@ spamd_test (mu_sieve_machine_t mach, mu_list_t args, 
mu_list_t tags)
       spamd_abort (mach, &stream, handler);
     }
 
-  if (sscanf (buffer, "SPAMD/%18s %d %*s", version_str, &response) != 2)
-    {
-      mu_sieve_error (mach, _("spamd responded with bad string '%s'"), buffer);
-      spamd_abort (mach, &stream, handler);
-    }
+  if (parse_response_line (mach, buffer))
+    spamd_abort (mach, &stream, handler);
   
-  decode_float (&version, version_str, 1);
-  if (version < 10)
-    {
-      mu_sieve_error (mach, _("unsupported SPAMD version: %s"), version_str);
-      spamd_abort (mach, &stream, handler);
-    }
-
-  /*
-  if (response)
-    ...
-  */
-  
-  spamd_read_line (mach, stream, buffer, sizeof buffer, NULL);
+  spamd_read_line (mach, stream, &buffer, &size);
   if (sscanf (buffer, "Spam: %5s ; %20s / %20s",
              spam_str, score_str, threshold_str) != 3)
     {
@@ -344,27 +433,27 @@ spamd_test (mu_sieve_machine_t mach, mu_list_t args, 
mu_list_t tags)
 
   result = decode_boolean (spam_str);
   score = strtoul (score_str, NULL, 10);
-  decode_float (&score, score_str, 3);
-  decode_float (&threshold, threshold_str, 3);
+  decode_float (&score, score_str, 3, NULL);
+  decode_float (&threshold, threshold_str, 3, NULL);
 
   if (!result)
     {
       if (mu_sieve_tag_lookup (tags, "over", &arg))
        {
-         decode_float (&limit, arg->v.string, 3);
+         decode_float (&limit, arg->v.string, 3, NULL);
          result = score >= limit;
        }
       else if (mu_sieve_tag_lookup (tags, "under", &arg))
        {
-         decode_float (&limit, arg->v.string, 3);
+         decode_float (&limit, arg->v.string, 3, NULL);
          result = score <= limit;        
        }
     }
   
   /* Skip newline */
-  spamd_read_line (mach, stream, buffer, sizeof buffer, NULL);
+  spamd_read_line (mach, stream, &buffer, &size);
   /* Read symbol list */
-  spamd_read_line (mach, stream, buffer, sizeof buffer, &size);
+  spamd_read_line (mach, stream, &buffer, &size);
 
   rc = mu_message_get_header (msg, &hdr);
   if (rc)
@@ -379,11 +468,22 @@ spamd_test (mu_sieve_machine_t mach, mu_list_t args, 
mu_list_t tags)
   mu_header_append (hdr, "X-Spamd-Threshold", threshold_str);
   mu_header_append (hdr, "X-Spamd-Keywords", buffer);
 
-  while (spamd_read_line (mach, stream, buffer, sizeof buffer, &size) == 0
-        && size > 0)
-    /* Drain input */;
-  
-  spamd_destroy (&stream);
+  free (buffer);
+
+  /* Create a data sink */
+  mu_nullstream_create (&null, MU_STREAM_WRITE);
+
+  /* Mark out the following data as payload */
+  if (!(lev & MU_DEBUG_LEVEL_MASK (MU_DEBUG_TRACE9)))
+    {
+      int xlev = MU_XSCRIPT_PAYLOAD;
+      mu_stream_ioctl (stream, MU_IOCTL_XSCRIPTSTREAM,
+                      MU_IOCTL_XSCRIPTSTREAM_LEVEL, &xlev);
+    }
+  mu_stream_copy (null, stream, 0, NULL);
+  mu_stream_destroy (&null);
+  mu_stream_destroy (&stream);
+
   set_signal_handler (SIGPIPE, handler);
 
   return result;
diff --git a/libmu_sieve/sieve.y b/libmu_sieve/sieve.y
index 7666309..79ae1fb 100644
--- a/libmu_sieve/sieve.y
+++ b/libmu_sieve/sieve.y
@@ -349,7 +349,8 @@ mu_sieve_machine_init_ex (mu_sieve_machine_t *pmach,
 {
   int rc;
   mu_sieve_machine_t mach;
-  
+
+  mu_sieve_debug_init ();
   mach = malloc (sizeof (*mach));
   if (!mach)
     return ENOMEM;
diff --git a/mh/mboxprop.c b/mh/mboxprop.c
index bba10e7..2c39cbd 100644
--- a/mh/mboxprop.c
+++ b/mh/mboxprop.c
@@ -41,6 +41,8 @@ mh_mailbox_get_cur (mu_mailbox_t mbox, size_t *pcur)
       char *p;
       *pcur = strtoul (s, &p, 10);
       if (*p)
+        p = mu_str_skip_class (p, MU_CTYPE_SPACE);
+      if (*p)
        {
          mu_error (_("invalid \"cur\" value (%s)"), s);
          *pcur = 1;
diff --git a/sieve/sieve.c b/sieve/sieve.c
index 7043f0b..8e3f337 100644
--- a/sieve/sieve.c
+++ b/sieve/sieve.c
@@ -51,8 +51,8 @@ N_("GNU sieve -- a mail filtering tool.")
 "\v"
 N_("Debug flags:\n\
   g - main parser traces\n\
-  T - mailutils traces (MU_DEBUG_TRACE0-MU_DEBUG_TRACE1)\n\
-  P - network protocols (MU_DEBUG_PROT)\n\
+  T - mailutils traces (same as --debug-level=sieve.trace0-trace1)\n\
+  P - network protocols (same as --debug-level=sieve.=prot)\n\
   t - sieve trace (MU_SIEVE_DEBUG_TRACE)\n\
   i - sieve instructions trace (MU_SIEVE_DEBUG_INSTR)\n");
 
@@ -104,7 +104,6 @@ static struct argp_option options[] =
 int keep_going;
 int compile_only;
 char *mbox_url;
-int debug_level;
 int sieve_debug;
 int verbose;
 char *script;
@@ -127,16 +126,24 @@ is_true_p (char *p)
 static void
 set_debug_level (const char *arg)
 {
+  mu_debug_level_t lev;
+  
   for (; *arg; arg++)
     {
       switch (*arg)
        {
        case 'T':
-         debug_level |= MU_DEBUG_LEVEL_UPTO (MU_DEBUG_TRACE7);
+         mu_debug_get_category_level (mu_sieve_debug_handle, &lev);
+         mu_debug_set_category_level (mu_sieve_debug_handle, 
+                                      lev |
+                                   (MU_DEBUG_LEVEL_UPTO(MU_DEBUG_TRACE9) &
+                                    ~MU_DEBUG_LEVEL_MASK(MU_DEBUG_ERROR)));
          break;
 
        case 'P':
-         debug_level |= MU_DEBUG_LEVEL_MASK (MU_DEBUG_PROT);
+         mu_debug_get_category_level (mu_sieve_debug_handle, &lev);
+         mu_debug_set_category_level (mu_sieve_debug_handle,
+                                   lev | MU_DEBUG_LEVEL_MASK(MU_DEBUG_PROT));
          break;
 
        case 'g':
@@ -181,6 +188,7 @@ parser (int key, char *arg, struct argp_state *state)
       
     case 'n':
       sieve_debug |= MU_SIEVE_DRY_RUN;
+      mu_argp_node_list_new (lst, "verbose", "yes");
       break;
 
     case 'k':
@@ -451,12 +459,10 @@ main (int argc, char *argv[])
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif
   mu_gocs_register ("sieve", mu_sieve_module_init);
-
+  mu_sieve_debug_init ();
+  
   mu_register_all_formats ();
 
-  debug_level = MU_DEBUG_LEVEL_MASK (MU_DEBUG_ERROR);
-  mu_log_facility = 0;
-
   if (mu_app_init (&argp, sieve_argp_capa, sieve_cfg_param, 
                   argc, argv, ARGP_IN_ORDER, NULL, NULL))
     exit (EX_USAGE);


hooks/post-receive
-- 
GNU Mailutils



reply via email to

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