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-205-gc08b926


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-205-gc08b926
Date: Sat, 20 Nov 2010 14:52:15 +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=c08b926f664b27953483a0dffcbe381ddaa154e5

The branch, master has been updated
       via  c08b926f664b27953483a0dffcbe381ddaa154e5 (commit)
       via  77d2867d07ba9d1c5b8b0af1ba8b0543cf57f384 (commit)
       via  33a277e9f8e8541fee73f902413afb100e48b95c (commit)
      from  1a8279af0d705aa7121805613fcba9963fb1b4ec (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 c08b926f664b27953483a0dffcbe381ddaa154e5
Author: Sergey Poznyakoff <address@hidden>
Date:   Sat Nov 20 16:30:31 2010 +0200

    Re-implement MH sequences via mailbox properties.
    
    * libmailutils/mailbox/header.c (mu_header_clear): New function.
    (mu_header_sget_value_n): Tolerate pval == NULL.
    * libmailutils/property/assocprop.c (_assoc_prop_setval): Bugfix.
    (_assoc_prop_clear): New method.
    (mu_assoc_property_init): Reference the stream.
    (mu_assoc_property_init): Initialize _prop_clear.
    * libmailutils/property/create.c (_mu_property_init): Now extern.
    * libmailutils/property/propset.c (mu_property_set_value): Null value
    means unset.
    * libmailutils/tests/prop.at: Test property clear and invalidate.
    * libmailutils/tests/prop.c: New commands: 0 for property clear and ! for
    invalidate.
    
    * libmailutils/property/mhprop.c: New file.
    * libmailutils/property/propclr.c: New file.
    * libmailutils/property/propinv.c: New file.
    * libmailutils/property/Makefile.am (noinst_LTLIBRARIES): Add new files.
    
    * include/mailutils/header.h (mu_header_clear): New proto.
    * include/mailutils/property.h (mu_property_clear)
    (mu_property_invalidate): New protos.
    (mu_mh_prop): New struct.
    (mu_mh_property_init): New proto.
    * include/mailutils/sys/property.h (_mu_property) <_prop_clear>: New member.
    (_mu_property_init): New proto.
    * include/mailutils/mh.h: New file.
    * include/mailutils/Makefile.am (pkginclude_HEADERS): Add mh.h
    
    * libproto/mh/profile.c: New file.
    * libproto/mh/Makefile.am (libmu_mh_la_SOURCES): Add new files.
    
    * libproto/mh/mbox.c (mh_get_property): New static function.
    (_mailbox_mh_init): Set _get_property.
    
    * mh/mh_global.c (current_message, sequences): Remove.  Use mbox
    properties instead.
    (mh_global_sequences_get)
    (mh_global_sequences_set)
    (mh_global_sequences_iterate)
    (mh_global_sequences_drop): Take mbox as first argument. All callers
    updated.
    * mh/mh_init.c (mh_init2): Remove call to mh_global_sequences_get.
    * mh/mh_msgset.c (msgset_cur): Use mh_mailbox_get_cur.
    * mh/mh_sequence.c (mh_seq_read, write_sequence)
    (delete_sequence, mh_seq_add, mh_seq_delete): Take mbox as first argument.
    All callers updated.
    
    * mh/mh.h: Include mailutils/property.h.
    (current_message): Remove.
    (mh_mailbox_cur_default): New extern.
    (mh_global_sequences_get)
    (mh_global_sequences_set)
    (mh_global_sequences_iterate)
    (mh_global_sequences_drop): Take mbox as first argument. All callers
    updated.
    
    * mh/mh_format.c (builtin_cur): Rewrite using mh_message_number.
    
    * mh/mboxprop.c: New file.
    * mh/Makefile.am (libmh_a_SOURCES): Add new file.
    
    * mh/folder.c: Update calls to sequence management functions.
    * mh/mark.c: Likewise.
    * mh/pick.c: Likewise.
    
    * mh/inc.c (main): Set mh_mailbox_cur_default to 1.
    Invalidate properties if changecur is not set.
    * mh/prompter.c (main): Destroy the iterator.
    * mh/rmf.c: Rewrite using mu_mailbox_remove.
    * mh/scan.c: Always close the mailbox.
    
    * mh/tests/folder.at: Update.
    * mh/tests/inc.at: Update.  Inc now sets cur to 1 if it was not
    originally set.  This is what others MHs do.

commit 77d2867d07ba9d1c5b8b0af1ba8b0543cf57f384
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Nov 18 20:27:18 2010 +0200

    Rewrite property support.
    
    * configure.ac: Add libmailutils/property/Makefile to config files.
    
    * include/mailutils/property.h (mu_property_create)
    (mu_property_destroy): Change signature.
    (mu_property_get_owner): Remove.
    (mu_property_create_init)
    (mu_property_set_init, mu_property_set_init_data)
    (mu_property_ref, mu_property_unref)
    (mu_property_save): New protos.
    (mu_property_get_iterator)
    (mu_assoc_property_init): New protos.
    * include/mailutils/sys/property.h (property_item): Remove definition.
    (MU_PROP_INIT, MU_PROP_FILL, MU_PROP_MODIFIED): New flags.
    (_mu_property): Rewrite from scratch.
    (_mu_property_check): New proto.
    
    * libmailutils/property/Makefile.am: New file.
    * libmailutils/property/assocprop.c: New file.
    * libmailutils/property/create.c: New file.
    * libmailutils/property/propget.c: New file.
    * libmailutils/property/propitr.c: New file.
    * libmailutils/property/propset.c: New file.
    
    * libmailutils/Makefile.am (SUBDIRS): Add property.
    (libmailutils_la_LIBADD): Add property/libproperty.la.
    
    * libmailutils/base/property.c: Remove.
    * libmailutils/base/Makefile.am (libbase_la_SOURCES): Remove property.c
    
    * libmailutils/base/assoc.c (first): Avoid coredumping on empty
    hash table.
    
    * include/mailutils/folder.h (mu_folder_set_property)
    (mu_folder_get_property): New protos.
    * include/mailutils/sys/folder.h (_mu_folder) <property>
    <_get_property>: New members.
    * libmailutils/mailbox/folder.c (mu_folder_destroy): Destroy the
    property.
    (mu_folder_get_property)
    (mu_folder_set_property): New functions.
    
    * include/mailutils/mailbox.h (mu_mailbox_set_property): New proto.
    * libmailutils/mailbox/mailbox.c (mu_mailbox_set_property): New function.
    (mu_mailbox_get_property): Use _get_property method.
    
    * include/mailutils/mailer.h (mu_mailer_set_property): New proto.
    * include/mailutils/sys/mailer.h (_mu_mailer) <_get_property>: New member.
    * libmailutils/mailer/mailer.c (mu_mailer_set_property): New function.
    (mu_mailer_get_property): Use _get_property method.
    
    * include/mailutils/iterator.h (mu_iterator_set_dataptr): New proto.
    * include/mailutils/sys/iterator.h (_mu_iterator) <dataptr>: New method.
    * libmailutils/base/iterator.c (mu_iterator_set_dataptr): New function.
    (mu_iterator_current): Rewrite as a wrapper around mu_iterator_current_kv.
    (mu_iterator_current_kv): Use dataptr method (if defined) to extract the
    data pointer.
    
    * libmailutils/tests/prop.c: New file.
    * libmailutils/tests/prop.at: New file.
    * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add prop.
    (TESTSUITE_AT): Add prop.at.
    * libmailutils/tests/testsuite.at: Include prop.at.

commit 33a277e9f8e8541fee73f902413afb100e48b95c
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Nov 18 20:05:25 2010 +0200

    mh: Minor fixes.

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

Summary of changes:
 configure.ac                                       |    1 +
 include/mailutils/Makefile.am                      |    1 +
 include/mailutils/folder.h                         |    4 +
 include/mailutils/header.h                         |    1 +
 include/mailutils/iterator.h                       |    2 +
 include/mailutils/mailbox.h                        |    1 +
 include/mailutils/mailer.h                         |    2 +
 mail/version.c => include/mailutils/mh.h           |   52 ++---
 include/mailutils/property.h                       |   51 +++--
 include/mailutils/sys/folder.h                     |    2 +
 include/mailutils/sys/iterator.h                   |    1 +
 include/mailutils/sys/mailer.h                     |    1 +
 include/mailutils/sys/property.h                   |   42 +++-
 libmailutils/Makefile.am                           |    3 +-
 libmailutils/base/Makefile.am                      |    1 -
 libmailutils/base/assoc.c                          |    9 +-
 libmailutils/base/iterator.c                       |   22 ++-
 libmailutils/base/property.c                       |  191 ----------------
 libmailutils/mailbox/folder.c                      |   28 +++
 libmailutils/mailbox/header.c                      |   20 ++-
 libmailutils/mailbox/mailbox.c                     |   22 ++-
 libmailutils/mailer/mailer.c                       |   22 ++-
 libmailutils/{mime => property}/Makefile.am        |   15 +-
 libmailutils/property/assocprop.c                  |  228 ++++++++++++++++++
 libmailutils/property/create.c                     |  166 ++++++++++++++
 libmailutils/property/mhprop.c                     |  241 ++++++++++++++++++++
 libmailutils/{url/urlstr.c => property/propclr.c}  |   23 ++-
 libmailutils/property/propget.c                    |   83 +++++++
 .../{url/get-secret.c => property/propinv.c}       |   36 ++--
 .../radius.h => libmailutils/property/propitr.c    |   29 ++-
 libmailutils/property/propset.c                    |   70 ++++++
 libmailutils/tests/.gitignore                      |    1 +
 libmailutils/tests/Makefile.am                     |    2 +
 libmailutils/tests/prop.at                         |  124 ++++++++++
 libmailutils/tests/prop.c                          |  158 +++++++++++++
 libmailutils/tests/testsuite.at                    |    1 +
 libproto/mh/Makefile.am                            |    3 +-
 libproto/mh/mbox.c                                 |   38 +++-
 libproto/mh/profile.c                              |   60 +++++
 mh/.gitignore                                      |    1 +
 mh/Makefile.am                                     |    1 +
 mh/folder.c                                        |   32 ++-
 mh/inc.c                                           |   18 +-
 mh/mark.c                                          |   36 ++-
 mh/mboxprop.c                                      |   74 ++++++
 mh/mh.h                                            |   30 ++-
 mh/mh_format.c                                     |   13 +-
 mh/mh_format.h                                     |    2 +-
 mh/mh_global.c                                     |  107 ++++++----
 mh/mh_init.c                                       |    1 -
 mh/mh_msgset.c                                     |   28 ++-
 mh/mh_sequence.c                                   |   29 ++-
 mh/pick.c                                          |   17 ++-
 mh/prompter.c                                      |    5 +-
 mh/rmf.c                                           |   84 ++++---
 mh/scan.c                                          |    3 +-
 mh/tests/folder.at                                 |    2 -
 mh/tests/inc.at                                    |   36 +++-
 mu/Makefile.am                                     |    2 +-
 59 files changed, 1816 insertions(+), 462 deletions(-)
 copy mail/version.c => include/mailutils/mh.h (58%)
 delete mode 100644 libmailutils/base/property.c
 copy libmailutils/{mime => property}/Makefile.am (83%)
 create mode 100644 libmailutils/property/assocprop.c
 create mode 100644 libmailutils/property/create.c
 create mode 100644 libmailutils/property/mhprop.c
 copy libmailutils/{url/urlstr.c => property/propclr.c} (70%)
 create mode 100644 libmailutils/property/propget.c
 copy libmailutils/{url/get-secret.c => property/propinv.c} (67%)
 copy include/mailutils/radius.h => libmailutils/property/propitr.c (67%)
 create mode 100644 libmailutils/property/propset.c
 create mode 100644 libmailutils/tests/prop.at
 create mode 100644 libmailutils/tests/prop.c
 create mode 100644 libproto/mh/profile.c
 create mode 100644 mh/mboxprop.c

diff --git a/configure.ac b/configure.ac
index 7c9df0a..10d1e6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1389,6 +1389,7 @@ AC_CONFIG_FILES([
  libmailutils/mailbox/Makefile
  libmailutils/mailer/Makefile
  libmailutils/mime/Makefile
+ libmailutils/property/Makefile
  libmailutils/server/Makefile
  libmailutils/string/Makefile
  libmailutils/stream/Makefile
diff --git a/include/mailutils/Makefile.am b/include/mailutils/Makefile.am
index cd17f85..b52db2c 100644
--- a/include/mailutils/Makefile.am
+++ b/include/mailutils/Makefile.am
@@ -67,6 +67,7 @@ pkginclude_HEADERS = \
  mailutils.h\
  md5.h\
  message.h\
+ mh.h\
  mime.h\
  monitor.h\
  mu_auth.h\
diff --git a/include/mailutils/folder.h b/include/mailutils/folder.h
index 6e5fc7f..742176a 100644
--- a/include/mailutils/folder.h
+++ b/include/mailutils/folder.h
@@ -89,6 +89,10 @@ extern int  mu_folder_set_authority  (mu_folder_t, 
mu_authority_t);
 extern int  mu_folder_get_url        (mu_folder_t, mu_url_t *);
 extern int  mu_folder_set_url        (mu_folder_t, mu_url_t);
 
+/* Property */
+extern int  mu_folder_set_property   (mu_folder_t, mu_property_t);  
+extern int  mu_folder_get_property   (mu_folder_t, mu_property_t *);
+  
 /* FIXME: not implemented */
 extern int  mu_folder_decrement      (mu_folder_t);
 
diff --git a/include/mailutils/header.h b/include/mailutils/header.h
index c326c5c..2c9d7e0 100644
--- a/include/mailutils/header.h
+++ b/include/mailutils/header.h
@@ -78,6 +78,7 @@ extern "C" {
 extern int mu_header_create (mu_header_t *, const char *, size_t);
 extern void mu_header_destroy (mu_header_t *);
 extern int mu_header_invalidate (mu_header_t);
+extern int mu_header_clear (mu_header_t header);
 
 extern int mu_header_is_modified (mu_header_t);
 extern int mu_header_clear_modified (mu_header_t);
diff --git a/include/mailutils/iterator.h b/include/mailutils/iterator.h
index d67c063..b6e4f5c 100644
--- a/include/mailutils/iterator.h
+++ b/include/mailutils/iterator.h
@@ -72,6 +72,8 @@ extern int mu_iterator_set_itrctl (mu_iterator_t itr,
                                   int (*itrctl) (void *,
                                                  enum mu_itrctl_req,
                                                  void *));
+extern int mu_iterator_set_dataptr (mu_iterator_t itr,
+                                   void *(*dataptr) (void *));
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/mailutils/mailbox.h b/include/mailutils/mailbox.h
index 298e6e8..b2149ba 100644
--- a/include/mailutils/mailbox.h
+++ b/include/mailutils/mailbox.h
@@ -97,6 +97,7 @@ extern int  mu_mailbox_set_locker      (mu_mailbox_t, 
mu_locker_t);
 /* Property.  */
 extern int  mu_mailbox_get_flags       (mu_mailbox_t, int *);
 extern int  mu_mailbox_get_property    (mu_mailbox_t, mu_property_t *);
+extern int  mu_mailbox_set_property (mu_mailbox_t, mu_property_t);
 
 /* URL.  */
 extern int  mu_mailbox_get_url         (mu_mailbox_t, mu_url_t *);
diff --git a/include/mailutils/mailer.h b/include/mailutils/mailer.h
index f42f0eb..4d7f6c2 100644
--- a/include/mailutils/mailer.h
+++ b/include/mailutils/mailer.h
@@ -50,6 +50,8 @@ extern int mu_mailer_get_url_default       (const char** url);
 
 /* Accessor functions. */
 extern int mu_mailer_get_property   (mu_mailer_t, mu_property_t *);
+int mu_mailer_set_property (mu_mailer_t, mu_property_t);
+  
 extern int mu_mailer_get_stream     (mu_mailer_t, mu_stream_t *)
                                       __attribute__ ((deprecated));
 extern int mu_mailer_get_streamref  (mu_mailer_t, mu_stream_t *);
diff --git a/mail/version.c b/include/mailutils/mh.h
similarity index 58%
copy from mail/version.c
copy to include/mailutils/mh.h
index 12c907b..d986ee3 100644
--- a/mail/version.c
+++ b/include/mailutils/mh.h
@@ -15,40 +15,24 @@
    You should have received a copy of the GNU General Public License
    along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>. */
 
-#include "mail.h"
+#ifndef _MAILUTILS_MH_H
+#define _MAILUTILS_MH_H
 
-/*
- * ve[rsion]
- */
+extern mu_property_t mu_mh_profile;
+extern mu_property_t mu_mh_context;
+
+#define MU_MH_SEQUENCES_FILE ".mh_sequences"
+#define MU_MH_USER_PROFILE ".mh_profile"
+#define MU_MH_GLOBAL_PROFILE "mh-profile"
+#define MU_MH_CONTEXT_FILE "context"
+
+typedef int (*mu_mhprop_iterator_t) (const char *field, const char *value,
+                                    void *data);
+
+const char *mu_mhprop_get_value (mu_property_t prop, const char *name,
+                                const char *defval);
+int mu_mhprop_iterate (mu_property_t prop, mu_mhprop_iterator_t fp,
+                      void *data);
 
-static const char *with_defs[] =
-{
-#ifdef WITH_PTHREAD
-  "PTHREAD",
-#endif
-#ifdef WITH_BDB2
-  "BDB2",
-#endif
-#ifdef WITH_READLINE
-  "READLINE",
 #endif
-  NULL
-};
-
-
-int
-mail_version (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
-{ 
-  fprintf (ofile, "%s", program_version);
-  if (with_defs[0] != NULL)
-    {
-      int i;
-      fprintf (ofile, " (");
-      for (i = 0; with_defs[i]; i++)
-       fprintf (ofile, " %s", with_defs[i]);
-      fprintf (ofile, " )");
-    }
-  fprintf (ofile, "\n");
-
-  return 0;
-}
+
diff --git a/include/mailutils/property.h b/include/mailutils/property.h
index 1fb7334..40cbb8f 100644
--- a/include/mailutils/property.h
+++ b/include/mailutils/property.h
@@ -27,23 +27,46 @@
 extern "C" {
 #endif
 
-extern int  mu_property_create   (mu_property_t *, void *);
-extern void mu_property_destroy (mu_property_t *, void *);
-extern void *mu_property_get_owner (mu_property_t);
-
-extern int  mu_property_set_value (mu_property_t, const char *, const char *, 
int);
-extern int mu_property_get_value (mu_property_t, const char *, char *, size_t, 
-                                 size_t *);
-extern int mu_property_sget_value (mu_property_t prop, const char *key,
-                                  const char **buffer);
-extern int mu_property_aget_value (mu_property_t prop, const char *key,
-                                  char **buffer);
+int mu_property_create   (mu_property_t *);
+int mu_property_create_init (mu_property_t *pprop,
+                            int (*initfun) (mu_property_t), void *initdata);
+int mu_property_set_init (mu_property_t prop,
+                         int (*initfun) (mu_property_t), void *initdata);
+int mu_property_set_init_data (mu_property_t prop, void *data,
+                              void **old_data);
+void mu_property_destroy (mu_property_t *pprop);
+
+void mu_property_ref (mu_property_t prop);
+void mu_property_unref (mu_property_t prop);
+int mu_property_save (mu_property_t prop);
+int mu_property_set_value (mu_property_t, const char *, const char *, int);
+int mu_property_get_value (mu_property_t, const char *, char *, size_t, 
+                          size_t *);
+int mu_property_sget_value (mu_property_t prop, const char *key,
+                           const char **buffer);
+int mu_property_aget_value (mu_property_t prop, const char *key,
+                           char **buffer);
+int mu_property_clear (mu_property_t prop);
+int mu_property_invalidate (mu_property_t prop);
 
 /* Helper functions.  */
-extern int mu_property_set  (mu_property_t, const char *);
-extern int mu_property_unset (mu_property_t, const char *);
-extern int mu_property_is_set (mu_property_t, const char *);
+int mu_property_set  (mu_property_t, const char *);
+int mu_property_unset (mu_property_t, const char *);
+int mu_property_is_set (mu_property_t, const char *);
+
+int mu_property_get_iterator (mu_property_t, mu_iterator_t *itr);
+  
+/* Implementation init functions */
+int mu_assoc_property_init (mu_property_t);
+
+struct mu_mh_prop
+{
+  char *filename;
+  int ro;
+};
 
+int mu_mh_property_init (mu_property_t);
+  
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/mailutils/sys/folder.h b/include/mailutils/sys/folder.h
index 53b909d..3cbbdc2 100644
--- a/include/mailutils/sys/folder.h
+++ b/include/mailutils/sys/folder.h
@@ -38,6 +38,7 @@ struct _mu_folder
   mu_authority_t authority;
   mu_observable_t observable;
   mu_debug_t debug;
+  mu_property_t property;
   mu_stream_t stream;
   mu_monitor_t monitor;
   mu_url_t url;
@@ -63,6 +64,7 @@ struct _mu_folder
   int  (*_rename)      (mu_folder_t, const char *, const char *);
   int  (*_subscribe)   (mu_folder_t, const char *);
   int  (*_unsubscribe) (mu_folder_t, const char *);
+  int  (*_get_property)(mu_folder_t, mu_property_t *);
 };
 
 # ifdef __cplusplus
diff --git a/include/mailutils/sys/iterator.h b/include/mailutils/sys/iterator.h
index 2eaf4d5..f40eb3b 100644
--- a/include/mailutils/sys/iterator.h
+++ b/include/mailutils/sys/iterator.h
@@ -39,6 +39,7 @@ struct _mu_iterator
   int (*curitem_p) (void *owner, void *item);
   int (*finished_p) (void *owner);
   int (*itrctl) (void *owner, enum mu_itrctl_req req, void *arg);
+  void *(*dataptr) (void *);
 };
 
 # ifdef __cplusplus
diff --git a/include/mailutils/sys/mailer.h b/include/mailutils/sys/mailer.h
index 4bd2381..02ff6e1 100644
--- a/include/mailutils/sys/mailer.h
+++ b/include/mailutils/sys/mailer.h
@@ -51,6 +51,7 @@ struct _mu_mailer
   int (*_open)         (mu_mailer_t, int flags);
   int (*_close)        (mu_mailer_t);
   int (*_send_message) (mu_mailer_t, mu_message_t, mu_address_t, mu_address_t);
+  int (*_get_property) (mu_mailer_t, mu_property_t *);
 };
 
 int _mu_mailer_mailbox_init (mu_mailbox_t mailbox);
diff --git a/include/mailutils/sys/property.h b/include/mailutils/sys/property.h
index cbc090f..3705ee7 100644
--- a/include/mailutils/sys/property.h
+++ b/include/mailutils/sys/property.h
@@ -31,18 +31,44 @@
 extern "C" {
 # endif
 
-struct property_item
-{
-  char *value;
-};
-
+#define MU_PROP_INIT     0x01
+#define MU_PROP_FILL     0x02
+#define MU_PROP_MODIFIED 0x04
+  
 struct _mu_property
 {
-  mu_assoc_t assoc;
-  void *owner;
-  mu_monitor_t lock;
+  size_t _prop_ref_count;    /* Reference counter */
+  int _prop_flags;           /* Flags describing the state of this object */
+  void *_prop_data;          /* Implementation-specific data */
+  void *_prop_init_data;     /* Initialization data */
+
+  /* Methods */
+
+  /* Delayed initialization.  This function must allocate _prop_data,
+     if needed, and initialize the rest of _prop_* methods. */
+  int (*_prop_init)  (struct _mu_property *);
+  /* Free memory allocated in _prop_data */
+  void (*_prop_done) (struct _mu_property *);
+  /* Fill in the properties from an external storage */
+  int (*_prop_fill)  (struct _mu_property *);
+  /* Write the properties to an external storage */
+  int (*_prop_save)  (struct _mu_property *);
+  /* Get the value of the property named in the 2nd argument.  If 3rd
+     arg is NULL, _prop_getval tests whether the given property is set. */
+  int (*_prop_getval) (struct _mu_property *, const char *, const char **);
+  /* Set the property */
+  int (*_prop_setval) (struct _mu_property *, const char *, const char *, int);
+  /* Unset (delete) the property */
+  int (*_prop_unset) (struct _mu_property *, const char *);
+  /* Return iterator for this property object */
+  int (*_prop_getitr) (struct _mu_property *, mu_iterator_t *);
+  /* Clear all properties. */
+  int (*_prop_clear) (struct _mu_property *);
 };
 
+int _mu_property_init (mu_property_t prop);
+int _mu_property_check (mu_property_t prop);
+  
 # ifdef __cplusplus
 }
 # endif
diff --git a/libmailutils/Makefile.am b/libmailutils/Makefile.am
index 454962b..34246dc 100644
--- a/libmailutils/Makefile.am
+++ b/libmailutils/Makefile.am
@@ -17,7 +17,7 @@
 # <http://www.gnu.org/licenses/>.
 
 SUBDIRS = auth base address cfg diag filter mailbox mailer mime\
- server string stream url . tests 
+ server string stream property url . tests 
 
 lib_LTLIBRARIES = libmailutils.la
 
@@ -34,6 +34,7 @@ libmailutils_la_LIBADD = \
  mailbox/libmailbox.la\
  mailer/libmailer.la\
  mime/libmime.la\
+ property/libproperty.la\
  server/libserver.la\
  string/libstring.la\
  stream/libstream.la\
diff --git a/libmailutils/base/Makefile.am b/libmailutils/base/Makefile.am
index b4f208e..8160e04 100644
--- a/libmailutils/base/Makefile.am
+++ b/libmailutils/base/Makefile.am
@@ -52,7 +52,6 @@ libbase_la_SOURCES = \
  opool.c\
  parsedate.c\
  permstr.c\
- property.c\
  registrar.c\
  refcount.c\
  rfc2047.c\
diff --git a/libmailutils/base/assoc.c b/libmailutils/base/assoc.c
index b2e3f60..56b293b 100644
--- a/libmailutils/base/assoc.c
+++ b/libmailutils/base/assoc.c
@@ -391,10 +391,11 @@ first (void *owner)
   mu_assoc_t assoc = itr->assoc;
   unsigned hash_max = hash_size[assoc->hash_num];
   unsigned i;
-  
-  for (i = 0; i < hash_max; i++)
-    if ((ASSOC_ELEM (assoc, i))->name)
-      break;
+
+  if (assoc->tab)
+    for (i = 0; i < hash_max; i++)
+      if ((ASSOC_ELEM (assoc, i))->name)
+       break;
   itr->index = i;
   return 0;
 }
diff --git a/libmailutils/base/iterator.c b/libmailutils/base/iterator.c
index 97f7b75..e4d1846 100644
--- a/libmailutils/base/iterator.c
+++ b/libmailutils/base/iterator.c
@@ -103,6 +103,15 @@ mu_iterator_set_itrctl (mu_iterator_t itr,
 }
 
 int
+mu_iterator_set_dataptr (mu_iterator_t itr, void *(*dataptr) (void *))
+{
+  if (!itr)
+    return EINVAL;
+  itr->dataptr = dataptr;
+  return 0;
+}
+
+int
 mu_iterator_set_destroy (mu_iterator_t itr, int (*destroy) (mu_iterator_t, 
void *))
 {
   if (!itr)
@@ -202,14 +211,23 @@ mu_iterator_skip (mu_iterator_t iterator, ssize_t count)
 int
 mu_iterator_current (mu_iterator_t iterator, void **pitem)
 {
-  return iterator->getitem (iterator->owner, pitem, NULL);
+  return mu_iterator_current_kv (iterator, NULL, pitem);
 }
 
 int
 mu_iterator_current_kv (mu_iterator_t iterator, 
                         const void **pkey, void **pitem)
 {
-  return iterator->getitem (iterator->owner, (void**)pitem, pkey);
+  void *ptr;
+  int rc = iterator->getitem (iterator->owner, &ptr, pkey);
+  if (rc == 0)
+    {
+      if (iterator->dataptr)
+       *pitem = iterator->dataptr (ptr);
+      else
+       *pitem = ptr;
+    }
+  return rc;
 }
 
 int
diff --git a/libmailutils/base/property.c b/libmailutils/base/property.c
deleted file mode 100644
index eec0ddc..0000000
--- a/libmailutils/base/property.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* GNU Mailutils -- a suite of utilities for electronic mail
-   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2008, 2010 Free
-   Software Foundation, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 3 of the License, or (at your option) any later version.
-
-   This library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General
-   Public License along with this library.  If not, see 
-   <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#include <mailutils/sys/property.h>
-#include <mailutils/errno.h>
-#include <mailutils/assoc.h>
-#include <stdlib.h>
-
-static void
-prop_free_value (void *data)
-{
-  struct property_item *item = data;
-  free (item->value);
-}
-
-int
-mu_property_create (mu_property_t *pp, void *owner)
-{
-  int rc;
-  mu_property_t prop;
-  if (pp == NULL)
-    return MU_ERR_OUT_PTR_NULL;
-  prop = calloc (1, sizeof *prop);
-  if (prop == NULL)
-    return ENOMEM;
-  rc = mu_assoc_create (&prop->assoc, sizeof (struct property_item), 0);
-  if (rc)
-    {
-      free (prop);
-      return rc;
-    }
-  mu_assoc_set_free (prop->assoc, prop_free_value);
-  mu_monitor_create (&prop->lock, 0, prop);
-  prop->owner = owner;
-  *pp = prop;
-  return 0;
-}
-
-void
-mu_property_destroy (mu_property_t *pp, void *owner)
-{
-  if (pp && *pp)
-    {
-      mu_property_t prop = *pp;
-      if (prop->owner == owner)
-       {
-         /* Destroy the list and is properties.  */
-         mu_monitor_wrlock (prop->lock);
-         mu_assoc_destroy (&prop->assoc);
-         mu_monitor_unlock (prop->lock);
-         mu_monitor_destroy (&prop->lock, prop);
-         free (prop);
-       }
-      *pp = NULL;
-    }
-}
-
-void *
-mu_property_get_owner (mu_property_t prop)
-{
-  return (prop == NULL) ? NULL : prop->owner;
-}
-
-int
-mu_property_set_value (mu_property_t prop, const char *key, const char *value,
-                      int overwrite)
-{
-  struct property_item *item;
-  int rc;
-
-  if (!prop)
-    return EINVAL;
-  rc = mu_assoc_ref_install (prop->assoc, key, (void **)&item);
-  if (rc == MU_ERR_NOENT)
-    {
-      item->value = strdup (value);
-    }
-  else if (overwrite)
-    {
-      free (item->value);
-      item->value = strdup (value);
-    }
-  else
-    return 0;
-  
-  if (!item->value)
-    {
-      mu_assoc_remove (prop->assoc, key);
-      return ENOMEM;
-    }
-
-  return 0;
-}
-  
-int
-mu_property_sget_value (mu_property_t prop, const char *key,
-                       const char **buffer)
-{
-  struct property_item *item;
-
-  if (!prop)
-    return EINVAL;
-  item = mu_assoc_ref (prop->assoc, key);
-  if (item == NULL)
-    return MU_ERR_NOENT;
-  if (buffer)
-    *buffer = item->value;
-  return 0;
-}
-
-int
-mu_property_aget_value (mu_property_t prop, const char *key,
-                       char **buffer)
-{
-  const char *value;
-  int rc = mu_property_sget_value (prop, key, &value);
-  if (rc == 0)
-    {
-      if ((*buffer = strdup (value)) == NULL)
-       return ENOMEM;
-    }
-  return rc;
-}
-
-int
-mu_property_get_value (mu_property_t prop, const char *key, char *buffer,
-                      size_t buflen, size_t *n)
-{
-  size_t len = 0;
-  const char *value;
-  int rc = mu_property_sget_value (prop, key, &value);
-  if (rc == 0)
-    {
-      len = strlen (value) + 1;
-      if (buffer && buflen)
-       {
-         if (buflen < len)
-           len = buflen;
-         len--;
-         memcpy (buffer, value, len);
-         buffer[len] = 0;
-       }
-    }
-  if (n)
-    *n = len;
-  return rc;
-}
-
-int
-mu_property_is_set (mu_property_t prop, const char *key)
-{
-  struct property_item *item = mu_assoc_ref (prop->assoc, key);
-  return (item == NULL) ? 0 : 1;
-}
-
-int
-mu_property_set (mu_property_t prop, const char *key)
-{
-  return mu_property_set_value (prop, key, "", 1);
-}
-
-int
-mu_property_unset (mu_property_t prop, const char *key)
-{
-  if (!prop)
-    return EINVAL;
-  return mu_assoc_remove (prop->assoc, key);
-}
-  
diff --git a/libmailutils/mailbox/folder.c b/libmailutils/mailbox/folder.c
index fe91823..071fc22 100644
--- a/libmailutils/mailbox/folder.c
+++ b/libmailutils/mailbox/folder.c
@@ -35,6 +35,7 @@
 #include <mailutils/stream.h>
 #include <mailutils/url.h>
 #include <mailutils/errno.h>
+#include <mailutils/property.h>
 
 #include <mailutils/sys/folder.h>
 
@@ -208,6 +209,8 @@ mu_folder_destroy (mu_folder_t *pfolder)
            mu_stream_destroy (&folder->stream);
          if (folder->url)
            mu_url_destroy (&folder->url);
+         if (folder->property)
+           mu_property_destroy (&folder->property);
          free (folder);
        }
       mu_monitor_unlock (monitor);
@@ -217,6 +220,31 @@ mu_folder_destroy (mu_folder_t *pfolder)
     }
 }
 
+int
+mu_folder_get_property (mu_folder_t folder, mu_property_t *prop)
+{
+  if (folder == NULL)
+    return EINVAL;
+  if (prop == NULL)
+    return MU_ERR_OUT_PTR_NULL;
+  
+  if (folder->property == NULL)
+    {
+      int status;
+
+      if (folder->_get_property)
+       status = folder->_get_property (folder, &folder->property);
+      else
+       status = mu_property_create_init (&folder->property,
+                                         mu_assoc_property_init, NULL);
+      if (status != 0)
+       return status;
+    }
+  *prop = folder->property;
+  return 0;
+}
+
+
 /* Cover functions.  */
 int
 mu_folder_open (mu_folder_t folder, int flags)
diff --git a/libmailutils/mailbox/header.c b/libmailutils/mailbox/header.c
index 6ce70d1..b3c28c7 100644
--- a/libmailutils/mailbox/header.c
+++ b/libmailutils/mailbox/header.c
@@ -611,7 +611,23 @@ mu_header_insert (mu_header_t header,
   HEADER_SET_MODIFIED (header);
   return 0;
 }
+
+int
+mu_header_clear (mu_header_t header)
+{
+  int status;
   
+  if (header == NULL)
+    return EINVAL;
+
+  status = mu_header_fill (header);
+  if (status)
+    return status;
+  mu_header_invalidate (header);
+  HEADER_SET_MODIFIED (header);
+  return 0;
+}
+
 
 int
 mu_header_sget_value_n (mu_header_t header,
@@ -630,8 +646,8 @@ mu_header_sget_value_n (mu_header_t header,
   ent = mu_hdrent_find (header, name, n);
   if (!ent)
     return MU_ERR_NOENT;
-
-  *pval = MU_HDRENT_VALUE (header, ent);
+  if (pval)
+    *pval = MU_HDRENT_VALUE (header, ent);
   return 0;
 }
 
diff --git a/libmailutils/mailbox/mailbox.c b/libmailutils/mailbox/mailbox.c
index 0677e88..269223c 100644
--- a/libmailutils/mailbox/mailbox.c
+++ b/libmailutils/mailbox/mailbox.c
@@ -272,7 +272,7 @@ mu_mailbox_destroy (mu_mailbox_t *pmbox)
        mu_folder_destroy (&mbox->folder);
 
       if (mbox->property)
-       mu_property_destroy (&mbox->property, mbox);
+       mu_property_destroy (&mbox->property);
 
       free (mbox);
       *pmbox = NULL;
@@ -648,6 +648,18 @@ mu_mailbox_get_observable (mu_mailbox_t mbox, 
mu_observable_t *pobservable)
 }
 
 int
+mu_mailbox_set_property (mu_mailbox_t mbox, mu_property_t property)
+{
+  if (mbox == NULL)
+    return MU_ERR_MBX_NULL;
+  if (mbox->property)
+    mu_property_unref (mbox->property);
+  mbox->property = property;
+  mu_property_ref (property);
+  return 0;
+}
+
+int
 mu_mailbox_get_property (mu_mailbox_t mbox, mu_property_t *pproperty)
 {
   if (mbox == NULL)
@@ -657,7 +669,13 @@ mu_mailbox_get_property (mu_mailbox_t mbox, mu_property_t 
*pproperty)
   
   if (mbox->property == NULL)
     {
-      int status = mu_property_create (&mbox->property, mbox);
+      int status;
+
+      if (mbox->_get_property)
+       status = mbox->_get_property (mbox, &mbox->property);
+      else
+       status = mu_property_create_init (&mbox->property,
+                                         mu_assoc_property_init, NULL);
       if (status != 0)
        return status;
     }
diff --git a/libmailutils/mailer/mailer.c b/libmailutils/mailer/mailer.c
index fec7cab..e60e70b 100644
--- a/libmailutils/mailer/mailer.c
+++ b/libmailutils/mailer/mailer.c
@@ -210,7 +210,7 @@ mu_mailer_destroy (mu_mailer_t * pmailer)
        mu_debug_destroy (&(mailer->debug), mailer);
 
       if (mailer->property)
-       mu_property_destroy (&(mailer->property), mailer);
+       mu_property_destroy (&mailer->property);
 
       free (mailer);
       *pmailer = NULL;
@@ -706,6 +706,18 @@ mu_mailer_get_observable (mu_mailer_t mailer, 
mu_observable_t * pobservable)
 }
 
 int
+mu_mailer_set_property (mu_mailer_t mailer, mu_property_t property)
+{
+  if (mailer == NULL)
+    return EINVAL;
+  if (mailer->property)
+    mu_property_unref (mailer->property);
+  mailer->property = property;
+  mu_property_ref (property);
+  return 0;
+}
+
+int
 mu_mailer_get_property (mu_mailer_t mailer, mu_property_t * pproperty)
 {
   if (mailer == NULL)
@@ -714,7 +726,13 @@ mu_mailer_get_property (mu_mailer_t mailer, mu_property_t 
* pproperty)
     return MU_ERR_OUT_PTR_NULL;
   if (mailer->property == NULL)
     {
-      int status = mu_property_create (&(mailer->property), mailer);
+      int status;
+
+      if (mailer->_get_property)
+       status = mailer->_get_property (mailer, &mailer->property);
+      else
+       status = mu_property_create_init (&mailer->property,
+                                         mu_assoc_property_init, NULL);
       if (status != 0)
        return status;
     }
diff --git a/libmailutils/mime/Makefile.am b/libmailutils/property/Makefile.am
similarity index 83%
copy from libmailutils/mime/Makefile.am
copy to libmailutils/property/Makefile.am
index 70a3ebc..4f2ea03 100644
--- a/libmailutils/mime/Makefile.am
+++ b/libmailutils/property/Makefile.am
@@ -15,11 +15,16 @@
 # Public License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-noinst_LTLIBRARIES = libmime.la
+noinst_LTLIBRARIES = libproperty.la
 
-libmime_la_SOURCES = \
- attachment.c\
- mime.c\
- mimehdr.c
+libproperty_la_SOURCES = \
+ assocprop.c\
+ create.c\
+ mhprop.c\
+ propclr.c\
+ propget.c\
+ propitr.c\
+ propinv.c\
+ propset.c
 
 INCLUDES = @MU_LIB_COMMON_INCLUDES@ -I/libmailutils
diff --git a/libmailutils/property/assocprop.c 
b/libmailutils/property/assocprop.c
new file mode 100644
index 0000000..6bf7099
--- /dev/null
+++ b/libmailutils/property/assocprop.c
@@ -0,0 +1,228 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2008, 2010 Free
+   Software Foundation, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General
+   Public License along with this library.  If not, see 
+   <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mailutils/sys/property.h>
+#include <mailutils/errno.h>
+#include <mailutils/assoc.h>
+#include <mailutils/stream.h>
+#include <mailutils/iterator.h>
+#include <stdlib.h>
+
+struct property_item
+{
+  char *value;
+};
+
+static void
+_assoc_prop_done (struct _mu_property *prop)
+{
+  mu_assoc_t assoc = prop->_prop_data;
+  mu_stream_t str = prop->_prop_init_data;
+  mu_assoc_destroy (&assoc);
+  mu_stream_destroy (&str);
+}
+
+static int
+_assoc_prop_getval (struct _mu_property *prop,
+                   const char *key, const char **pval)
+{
+  mu_assoc_t assoc = prop->_prop_data;
+  struct property_item *item;
+
+  item = mu_assoc_ref (assoc, key);
+  if (item == NULL)
+    return MU_ERR_NOENT;
+  if (pval)
+    *pval = item->value;
+  return 0;
+
+}
+
+static int
+_assoc_prop_setval (struct _mu_property *prop, const char *key,
+                      const char *val, int overwrite)
+{
+  mu_assoc_t assoc = prop->_prop_data;
+  struct property_item *item;
+  int rc;
+
+  rc = mu_assoc_ref_install (assoc, key, (void **)&item);
+  if (rc == 0)
+    {
+      item->value = strdup (val);
+      if (!item->value)
+       {
+         mu_assoc_remove (assoc, key);
+         return ENOMEM;
+       }
+    }
+  else if (rc == MU_ERR_EXISTS && overwrite)
+    {
+      char *newval = strdup (val);
+      if (!newval)
+       return ENOMEM;
+      free (item->value);
+      item->value = newval;
+    }
+  else
+    return rc;
+  return 0;
+}
+
+static int
+_assoc_prop_unset (struct _mu_property *prop, const char *key)
+{
+  mu_assoc_t assoc = prop->_prop_data;
+
+  return mu_assoc_remove (assoc, key);
+}
+
+static int
+_assoc_prop_clear (struct _mu_property *prop)
+{
+  mu_assoc_t assoc = prop->_prop_data;
+  mu_assoc_clear (assoc);
+  return 0;
+}
+
+
+static void *
+_assoc_prop_dataptr (void *in)
+{
+  struct property_item *item = in;
+  return item->value;
+}
+
+static int
+_assoc_prop_getitr (struct _mu_property *prop, mu_iterator_t *pitr)
+{
+  int rc;
+  mu_iterator_t itr;
+  
+  rc = mu_assoc_get_iterator ((mu_assoc_t)prop->_prop_data, &itr);
+  if (rc)
+    return rc;
+  mu_iterator_set_dataptr (itr, _assoc_prop_dataptr);
+  *pitr = itr;
+  return 0;
+}
+
+
+static void
+prop_free_value (void *data)
+{
+  struct property_item *item = data;
+  free (item->value);
+}
+
+
+static int
+_assoc_prop_fill (struct _mu_property *prop)
+{
+  int rc;
+  mu_stream_t str = prop->_prop_init_data;
+  int state = 0;
+  char *buf[2] = { NULL, NULL };
+  size_t size[2] = { 0, 0 }, n;
+  
+  if (!str)
+    return EINVAL;
+  mu_stream_seek (str, 0, MU_SEEK_SET, NULL);
+  while ((rc = mu_stream_getdelim (str, &buf[state], &size[state],
+                                  0, &n)) == 0 &&
+        n > 0)
+    {
+      if (state == 1)
+       _assoc_prop_setval (prop, buf[0], buf[1], 1);
+      state = !state;
+    }
+  free (buf[0]);
+  free (buf[1]);
+  return rc;
+}
+
+static int
+_assoc_prop_save (struct _mu_property *prop)
+{
+  mu_stream_t str = prop->_prop_init_data;
+  mu_iterator_t itr;
+  int rc;
+  mu_off_t off;
+  
+  if (!str)
+    return EINVAL;
+  rc = mu_property_get_iterator (prop, &itr);
+  if (rc)
+    return rc;
+
+  mu_stream_seek (str, 0, MU_SEEK_SET, NULL);
+  for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
+       mu_iterator_next (itr))
+    {
+      const char *name, *val;
+         
+      mu_iterator_current_kv (itr, (const void **)&name, (void**)&val);
+      rc = mu_stream_write (str, name, strlen (name) + 1, NULL);
+      if (rc)
+       break;
+      rc = mu_stream_write (str, val, strlen (val) + 1, NULL);
+      if (rc)
+       break;
+    }      
+  mu_iterator_destroy (&itr);
+  rc = mu_stream_seek (str, 0, MU_SEEK_CUR, &off);
+  if (rc == 0)
+    rc = mu_stream_truncate (str, off);
+  return rc;
+}
+
+int
+mu_assoc_property_init (struct _mu_property *prop)
+{
+  mu_assoc_t assoc;
+  int rc;
+  
+  rc = mu_assoc_create (&assoc, sizeof (struct property_item), 0);
+  if (rc)
+    return rc;
+  mu_assoc_set_free (assoc, prop_free_value);
+  prop->_prop_data = assoc;
+
+  prop->_prop_done = _assoc_prop_done;
+  if (prop->_prop_init_data)
+    {
+      prop->_prop_fill = _assoc_prop_fill;
+      prop->_prop_save = _assoc_prop_save;
+    }
+  else
+    {
+      prop->_prop_fill = NULL;
+      prop->_prop_save = NULL;
+    }
+  prop->_prop_getval = _assoc_prop_getval;
+  prop->_prop_setval = _assoc_prop_setval;
+  prop->_prop_unset = _assoc_prop_unset;
+  prop->_prop_getitr = _assoc_prop_getitr;
+  prop->_prop_clear = _assoc_prop_clear;
+  return 0;
+}
+
diff --git a/libmailutils/property/create.c b/libmailutils/property/create.c
new file mode 100644
index 0000000..cee1e7d
--- /dev/null
+++ b/libmailutils/property/create.c
@@ -0,0 +1,166 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2008, 2010 Free
+   Software Foundation, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General
+   Public License along with this library.  If not, see 
+   <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mailutils/types.h>
+#include <mailutils/errno.h>
+#include <mailutils/sys/property.h>
+
+int
+mu_property_create (mu_property_t *pprop)
+{
+  mu_property_t prop = calloc (1, sizeof (prop[0]));
+  if (!prop)
+    return ENOMEM;
+  *pprop = prop;
+  return 0;
+}
+
+int
+mu_property_create_init (mu_property_t *pprop,
+                        int (*initfun) (mu_property_t), void *initdata)
+{
+  mu_property_t prop;
+  int rc = mu_property_create (&prop);
+  if (rc == 0)
+    {
+      mu_property_set_init (prop, initfun, initdata);
+      *pprop = prop;
+    }
+  return 0;
+}
+
+int
+mu_property_set_init (mu_property_t prop,
+                     int (*initfun) (mu_property_t), void *initdata)
+{
+  if (!prop)
+    return ENOMEM;
+  if (prop->_prop_flags & MU_PROP_INIT)
+    return MU_ERR_SEQ;
+  prop->_prop_init = initfun;
+  prop->_prop_init_data = initdata;
+  return 0;
+}
+
+int
+mu_property_set_init_data (mu_property_t prop, void *data, void **old_data)
+{
+  if (!prop)
+    return ENOMEM;
+  if (prop->_prop_flags & MU_PROP_INIT)
+    return MU_ERR_SEQ;
+  if (old_data)
+    *old_data = prop->_prop_init_data;
+  prop->_prop_init_data = data;
+  return 0;
+}
+
+void
+mu_property_destroy (mu_property_t *pprop)
+{
+  if (pprop)
+    {
+      mu_property_t prop = *pprop;
+      if (prop && (prop->_prop_ref_count == 0 || --prop->_prop_ref_count == 0))
+       {
+         mu_property_save (prop);
+         if (prop->_prop_done)
+           prop->_prop_done (prop);
+         free (prop);
+         *pprop = NULL;
+       }
+    }
+}
+
+void
+mu_property_ref (mu_property_t prop)
+{
+  if (prop)
+    prop->_prop_ref_count++;
+}
+
+void
+mu_property_unref (mu_property_t prop)
+{
+  mu_property_destroy (&prop);
+}
+
+int
+mu_property_save (mu_property_t prop)
+{
+  int rc = 0;
+      
+  if (!prop)
+    return EINVAL;
+  if (prop->_prop_flags & MU_PROP_MODIFIED)
+    {
+      if (prop->_prop_save)
+       rc = prop->_prop_save (prop);
+
+      if (rc == 0)
+       prop->_prop_flags &= ~MU_PROP_MODIFIED;
+    }
+  return rc;
+}
+
+int
+_mu_property_init (mu_property_t prop)
+{
+  int rc = 0;
+  if (!(prop->_prop_flags & MU_PROP_INIT))
+    {
+      if (prop->_prop_init)
+       rc = prop->_prop_init (prop);
+      if (rc == 0)
+       prop->_prop_flags |= MU_PROP_INIT;
+    }
+  return rc;
+}
+
+static int
+_mu_property_fill (mu_property_t prop)
+{
+  int rc = 0;
+  if (!(prop->_prop_flags & MU_PROP_FILL))
+    {
+      if (prop->_prop_fill)
+       rc = prop->_prop_fill (prop);
+      if (rc == 0)
+       prop->_prop_flags |= MU_PROP_FILL;
+    }
+  return rc;
+}
+
+int
+_mu_property_check (mu_property_t prop)
+{
+  int rc;
+  
+  if (!prop)
+    return EINVAL;
+  rc = _mu_property_init (prop);
+  if (rc == 0)
+    rc = _mu_property_fill (prop);
+  return rc;
+}
+
+  
diff --git a/libmailutils/property/mhprop.c b/libmailutils/property/mhprop.c
new file mode 100644
index 0000000..12b16e9
--- /dev/null
+++ b/libmailutils/property/mhprop.c
@@ -0,0 +1,241 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   Copyright (C) 2010 Free Software Foundation, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General
+   Public License along with this library.  If not, see 
+   <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mailutils/errno.h>
+#include <mailutils/error.h>
+#include <mailutils/stream.h>
+#include <mailutils/iterator.h>
+#include <mailutils/header.h>
+#include <mailutils/nls.h>
+#include <mailutils/filter.h>
+#include <mailutils/property.h>
+#include <mailutils/sys/property.h>
+#include <stdlib.h>
+
+static void
+_mh_prop_done (struct _mu_property *prop)
+{
+  struct mu_mh_prop *mhprop = prop->_prop_init_data;
+  mu_header_t header = prop->_prop_data;
+  mu_header_destroy (&header);
+  free (mhprop->filename);
+  free (mhprop);
+}
+
+static int
+_mh_prop_getval (struct _mu_property *prop,
+                const char *key, const char **pval)
+{
+  mu_header_t header = prop->_prop_data;
+
+  if (!header)
+    return MU_ERR_NOENT;
+  return mu_header_sget_value (header, key, pval);
+}
+
+static int
+_mh_prop_setval (struct _mu_property *prop, const char *key,
+                const char *val, int overwrite)
+{
+  struct mu_mh_prop *mhprop = prop->_prop_init_data;
+  mu_header_t header = prop->_prop_data;
+  if (!header)
+    {
+      int rc;
+      if ((rc = mu_header_create (&header, NULL, 0)) != 0)
+       {
+         mu_error (_("cannot create context %s: %s"),
+                   mhprop->filename, mu_strerror (rc));
+         return 1;
+       }
+      prop->_prop_data = header;
+    }
+  return mu_header_set_value (header, key, val, overwrite);
+}
+
+static int
+_mh_prop_unset (struct _mu_property *prop, const char *key)
+{
+  mu_header_t header = prop->_prop_data;
+  if (!header)
+    return 0;
+  return mu_header_remove (header, key, 1);
+}
+
+static int
+_mh_prop_getitr (struct _mu_property *prop, mu_iterator_t *pitr)
+{
+  mu_header_t header = prop->_prop_data;
+  return mu_header_get_iterator (header, pitr);
+}
+
+static int
+_mh_prop_clear (struct _mu_property *prop)
+{
+  mu_header_t header = prop->_prop_data;
+  return mu_header_clear (header);
+}
+
+    
+static int
+_mh_prop_read_stream (mu_header_t *phdr, mu_stream_t stream)
+{
+  int rc;
+  mu_stream_t flt;
+  const char *argv[3];
+  mu_off_t size;
+  size_t total;
+  char *blurb;
+  
+  rc = mu_stream_size (stream, &size);
+  if (rc)
+    return rc;
+  
+  argv[0] = "INLINE-COMMENT";
+  argv[1] = "#";
+  argv[2] = NULL;
+  rc = mu_filter_create_args (&flt, stream, argv[0], 2, argv,
+                             MU_FILTER_DECODE, MU_STREAM_READ);
+  if (rc)
+    {
+      mu_error (_("cannot open filter stream: %s"), mu_strerror (rc));
+      return rc;
+    }
+
+  blurb = malloc (size + 1);
+  if (!blurb)
+    {
+      mu_stream_destroy (&flt);
+      return ENOMEM;
+    }
+
+  total = 0;
+  while (1)
+    {
+      size_t n;
+      
+      rc = mu_stream_read (flt, blurb + total, size - total, &n);
+      if (rc)
+       break;
+      if (n == 0)
+       break;
+      total += n;
+    }
+
+  mu_stream_destroy (&flt);
+  if (rc)
+    {
+      free (blurb);
+      return rc;
+    }
+
+  rc = mu_header_create (phdr, blurb, total);
+  free (blurb);
+  return rc;
+}
+
+static int
+_mh_prop_write_stream (mu_header_t header, struct mu_mh_prop *mhprop,
+                      mu_stream_t stream)
+{
+  int rc;
+  mu_stream_t instream;
+  mu_off_t size;
+
+  mu_header_get_streamref (header, &instream);
+  rc = mu_stream_copy (stream, instream, 0, &size);
+  if (rc)
+    {
+      mu_error (_("error writing to context file %s: %s"),
+               mhprop->filename, mu_strerror (rc));
+      return rc;
+    }
+  else
+    rc = mu_stream_truncate (stream, size);
+  mu_stream_destroy (&instream);
+  return rc;
+}
+
+static int
+_mh_prop_fill (struct _mu_property *prop)
+{
+  struct mu_mh_prop *mhprop = prop->_prop_init_data;
+  int rc;
+  mu_stream_t stream;
+  mu_header_t header;
+  
+  rc = mu_file_stream_create (&stream, mhprop->filename, MU_STREAM_READ);
+  if (rc)
+    {
+      if ((rc = mu_header_create (&header, NULL, 0)) != 0)
+       mu_error (_("cannot create context %s: %s"),
+                 mhprop->filename, mu_strerror (rc));
+    }
+  else
+    {
+      rc = _mh_prop_read_stream (&header, stream);
+      mu_stream_unref (stream);
+    }
+  if (rc == 0)
+    prop->_prop_data = header;
+  return rc;
+}
+
+static int
+_mh_prop_save (struct _mu_property *prop)
+{
+  struct mu_mh_prop *mhprop = prop->_prop_init_data;
+  mu_header_t header = prop->_prop_data;
+  mu_stream_t stream;
+  int rc;
+  
+  if (mhprop->ro)
+    return 0;
+  
+  rc = mu_file_stream_create (&stream, mhprop->filename,
+                             MU_STREAM_WRITE|MU_STREAM_CREAT);
+  if (rc)
+    return rc;
+  rc = _mh_prop_write_stream (header, mhprop, stream);
+  mu_stream_unref (stream);
+  return rc;
+}
+
+int
+mu_mh_property_init (struct _mu_property *prop)
+{
+  struct mu_mh_prop *mhprop = prop->_prop_init_data;
+
+  if (!mhprop)
+    return EINVAL;
+  
+  prop->_prop_data = NULL;
+
+  prop->_prop_done = _mh_prop_done;
+  prop->_prop_fill = _mh_prop_fill;
+  prop->_prop_save = _mh_prop_save;
+  prop->_prop_getval = _mh_prop_getval;
+  prop->_prop_setval = _mh_prop_setval;
+  prop->_prop_unset = _mh_prop_unset;
+  prop->_prop_getitr = _mh_prop_getitr;
+  prop->_prop_clear = _mh_prop_clear;
+  return 0;
+}
diff --git a/libmailutils/url/urlstr.c b/libmailutils/property/propclr.c
similarity index 70%
copy from libmailutils/url/urlstr.c
copy to libmailutils/property/propclr.c
index 31e5197..fab9b25 100644
--- a/libmailutils/url/urlstr.c
+++ b/libmailutils/property/propclr.c
@@ -16,16 +16,23 @@
    <http://www.gnu.org/licenses/>. */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
 #endif
-#include <stdlib.h>
+
 #include <mailutils/types.h>
-#include <mailutils/sys/url.h>
+#include <mailutils/errno.h>
+#include <mailutils/sys/property.h>
 
-const char *
-mu_url_to_string (const mu_url_t url)
+int
+mu_property_clear (mu_property_t prop)
 {
-  if (url == NULL || url->name == NULL)
-    return "";
-  return url->name;
+  int rc = _mu_property_check (prop);
+  if (rc)
+    return rc;
+  if (!prop->_prop_clear)
+    return MU_ERR_EMPTY_VFN;
+  rc = prop->_prop_clear (prop);
+  if (rc == 0)
+    prop->_prop_flags |= MU_PROP_MODIFIED;
+  return rc;
 }
diff --git a/libmailutils/property/propget.c b/libmailutils/property/propget.c
new file mode 100644
index 0000000..79be2f5
--- /dev/null
+++ b/libmailutils/property/propget.c
@@ -0,0 +1,83 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2008, 2010 Free
+   Software Foundation, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General
+   Public License along with this library.  If not, see 
+   <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mailutils/types.h>
+#include <mailutils/errno.h>
+#include <mailutils/sys/property.h>
+
+int
+mu_property_sget_value (mu_property_t prop, const char *key,
+                       const char **pval)
+{
+  int rc = _mu_property_check (prop);
+  if (rc)
+    return rc;
+  if (!prop->_prop_getval)
+    return MU_ERR_EMPTY_VFN;
+  return prop->_prop_getval (prop, key, pval);
+}
+
+int
+mu_property_aget_value (mu_property_t prop, const char *key,
+                       char **buffer)
+{
+  const char *value;
+  int rc = mu_property_sget_value (prop, key, &value);
+  if (rc == 0)
+    {
+      if ((*buffer = strdup (value)) == NULL)
+       return ENOMEM;
+    }
+  return rc;
+}
+
+int
+mu_property_get_value (mu_property_t prop, const char *key, char *buffer,
+                      size_t buflen, size_t *n)
+{
+  size_t len = 0;
+  const char *value;
+  int rc = mu_property_sget_value (prop, key, &value);
+  if (rc == 0)
+    {
+      len = strlen (value) + 1;
+      if (buffer && buflen)
+       {
+         if (buflen < len)
+           len = buflen;
+         len--;
+         memcpy (buffer, value, len);
+         buffer[len] = 0;
+       }
+    }
+  if (n)
+    *n = len;
+  return rc;
+}
+
+int
+mu_property_is_set (mu_property_t prop, const char *key)
+{
+  if (_mu_property_check (prop))
+    return 0;
+  return mu_property_sget_value (prop, key, NULL) == 0;
+}
diff --git a/libmailutils/url/get-secret.c b/libmailutils/property/propinv.c
similarity index 67%
copy from libmailutils/url/get-secret.c
copy to libmailutils/property/propinv.c
index 34fb229..b4ee6fc 100644
--- a/libmailutils/url/get-secret.c
+++ b/libmailutils/property/propinv.c
@@ -16,29 +16,31 @@
    <http://www.gnu.org/licenses/>. */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
+#include <config.h>
 #endif
 
 #include <mailutils/types.h>
 #include <mailutils/errno.h>
-#include <mailutils/secret.h>
-#include <mailutils/sys/url.h>
+#include <mailutils/sys/property.h>
 
 int
-mu_url_get_secret (const mu_url_t url, mu_secret_t *psecret)
+mu_property_invalidate (mu_property_t prop)
 {
-  if (url->_get_secret)
-    return url->_get_secret (url, psecret);
-  if (url->secret == NULL)
-    return MU_ERR_NOENT;
-  mu_secret_ref (url->secret);
-  *psecret = url->secret;
+  int rc;
+  
+  if (!prop)
+    return EINVAL;
+  rc = _mu_property_init (prop);
+  if (rc)
+    return rc;
+  if (prop->_prop_flags & MU_PROP_FILL)
+    {
+      if (!prop->_prop_clear)
+       return MU_ERR_EMPTY_VFN;
+      rc = prop->_prop_clear (prop);
+      if (rc)
+       return rc;
+      prop->_prop_flags &= ~(MU_PROP_FILL | MU_PROP_MODIFIED);
+    }
   return 0;
 }
diff --git a/include/mailutils/radius.h b/libmailutils/property/propitr.c
similarity index 67%
copy from include/mailutils/radius.h
copy to libmailutils/property/propitr.c
index 1ce4c24..87c9c2d 100644
--- a/include/mailutils/radius.h
+++ b/libmailutils/property/propitr.c
@@ -13,21 +13,24 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General
-   Public License along with this library.  If not, see
+   Public License along with this library.  If not, see 
    <http://www.gnu.org/licenses/>. */
 
-#ifndef _MAILUTILS_RADIUS_H
-#define _MAILUTILS_RADIUS_H
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <mailutils/types.h>
+#include <mailutils/errno.h>
+#include <mailutils/sys/property.h>
 
-struct mu_radius_module_data
+int
+mu_property_get_iterator (mu_property_t prop, mu_iterator_t *pitr)
 {
-  char *config_dir;
-  char *auth_request;
-  char *getpwnam_request;
-  char *getpwuid_request;
-};
-
-extern int mu_radius_module_init (enum mu_gocs_op, void *data);
-
-#endif
+  int rc = _mu_property_check (prop);
+  if (rc)
+    return rc;
+  if (!prop->_prop_getitr)
+    return MU_ERR_EMPTY_VFN;
+  return prop->_prop_getitr (prop, pitr);
+}
diff --git a/libmailutils/property/propset.c b/libmailutils/property/propset.c
new file mode 100644
index 0000000..ed7c61b
--- /dev/null
+++ b/libmailutils/property/propset.c
@@ -0,0 +1,70 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2008, 2010 Free
+   Software Foundation, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General
+   Public License along with this library.  If not, see 
+   <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mailutils/types.h>
+#include <mailutils/errno.h>
+#include <mailutils/sys/property.h>
+
+int
+mu_property_set_value (mu_property_t prop, const char *key,
+                      const char *value, int overwrite)
+{
+  int rc;
+  
+  if (!value)
+    rc = mu_property_unset (prop, key);
+  else
+    {
+      rc = _mu_property_check (prop);
+      if (rc)
+       return rc;
+      if (!prop->_prop_setval)
+       return MU_ERR_EMPTY_VFN;
+      rc = prop->_prop_setval (prop, key, value, overwrite);
+      if (rc == 0)
+       prop->_prop_flags |= MU_PROP_MODIFIED;
+    }
+  return rc;
+}
+
+int
+mu_property_unset (mu_property_t prop, const char *key)
+{
+  int rc = _mu_property_check (prop);
+  if (rc)
+    return rc;
+  if (!prop->_prop_unset)
+    return MU_ERR_EMPTY_VFN;
+  rc = prop->_prop_unset (prop, key);
+  if (rc == 0)
+    prop->_prop_flags |= MU_PROP_MODIFIED;
+  return rc;
+}
+
+int
+mu_property_set (mu_property_t prop, const char *key)
+{
+  return mu_property_set_value (prop, key, "", 1);
+}
+
+  
+
diff --git a/libmailutils/tests/.gitignore b/libmailutils/tests/.gitignore
index 0157222..8bdc039 100644
--- a/libmailutils/tests/.gitignore
+++ b/libmailutils/tests/.gitignore
@@ -11,6 +11,7 @@ encode2047
 fltst
 listop
 mailcap
+prop
 url-parse
 wicket
 wsp
diff --git a/libmailutils/tests/Makefile.am b/libmailutils/tests/Makefile.am
index e34d265..a3ae2aa 100644
--- a/libmailutils/tests/Makefile.am
+++ b/libmailutils/tests/Makefile.am
@@ -47,6 +47,7 @@ noinst_PROGRAMS = \
  fltst\
  listop\
  mailcap\
+ prop\
  url-parse\
  wicket\
  wsp
@@ -69,6 +70,7 @@ TESTSUITE_AT = \
  fromflt.at\
  list.at\
  mailcap.at\
+ prop.at\
  testsuite.at\
  url.at\
  wicket.at\
diff --git a/libmailutils/tests/prop.at b/libmailutils/tests/prop.at
new file mode 100644
index 0000000..298918a
--- /dev/null
+++ b/libmailutils/tests/prop.at
@@ -0,0 +1,124 @@
+# 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.
+#
+# 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. 
+
+dnl ------------------------------------------------------------------
+dnl TESTPROP([NAME], [KW = `'], [PROG], [STDOUT = `'], [STDERR = `'])
+dnl
+m4_pushdef([TESTPROP],[
+AT_SETUP([prop: $1])
+AT_KEYWORDS([prop $2])
+AT_CHECK([$3],[0],[$4],[$5])
+AT_CLEANUP])
+
+TESTPROP([set],[prop00],[
+prop foo=bar ?foo +foo
+],
+[0: foo=bar: Success
+1: foo is set
+2: foo=bar
+])
+
+TESTPROP([overwrite],[prop01],[
+prop foo=bar foo=baz +foo
+],
+[0: foo=bar: Success
+1: foo=baz: Success
+2: foo=baz
+])
+
+TESTPROP([set without overwrite],[prop03],[
+prop foo=bar foo:=baz +foo
+],
+[0: foo=bar: Success
+1: foo=baz: Item already exists
+2: foo=bar
+])
+
+TESTPROP([set/unset],[prop04],[
+prop foo=bar ?foo +foo -foo ?foo
+],
+[0: foo=bar: Success
+1: foo is set
+2: foo=bar
+3: unset foo: Success
+4: foo is not set
+])
+
+TESTPROP([read/save],[prop06],[
+prop --file=db user=gray package=mailutils org=GNU test=6.a
+if test -f db; then
+  prop --file=db | sort
+else
+  echo 2>&1 "failed to create file"
+  exit 1
+fi
+
+prop --file=db -test
+prop --file=db | sort
+
+prop --file=db test=6.b descr="New test"
+prop --file=db | sort
+],
+[0: user=gray: Success
+1: package=mailutils: Success
+2: org=GNU: Success
+3: test=6.a: Success
+Property dump:
+org=GNU
+package=mailutils
+test=6.a
+user=gray
+0: unset test: Success
+Property dump:
+org=GNU
+package=mailutils
+user=gray
+0: test=6.b: Success
+1: descr=New test: Success
+Property dump:
+descr=New test
+org=GNU
+package=mailutils
+test=6.b
+user=gray
+])
+
+TESTPROP([clear],[prop07],[
+prop --dump user=gray package=mailutils org=GNU 0 ?org
+],
+[0: user=gray: Success
+1: package=mailutils: Success
+2: org=GNU: Success
+3: clear: Success
+4: org is not set
+Property dump:
+])
+
+TESTPROP([invalidate],[prop08],[
+prop --file=db user=foo
+prop --file=db ?user user=bar +user '!' +user
+],
+[0: user=foo: Success
+0: user is set
+1: user=bar: Success
+2: user=bar
+3: invalidate: Success
+4: user=foo
+])
+
+m4_popdef([TESTPROP])
+
diff --git a/libmailutils/tests/prop.c b/libmailutils/tests/prop.c
new file mode 100644
index 0000000..3cc4fd3
--- /dev/null
+++ b/libmailutils/tests/prop.c
@@ -0,0 +1,158 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif 
+#include <mailutils/mailutils.h>
+
+void
+help (char *progname)
+{
+  printf ("usage: %s [--file=NAME] [--dump] [COMMAND...]\n", progname);
+  printf ("Valid COMMANDs are:\n");
+  printf (" X=Y      set property X to value Y\n");
+  printf (" X:=Y     same, but fail if X has already been set\n");
+  printf (" ?X       query whether X is set\n");
+  printf (" +X       query the value of the property X\n");
+  printf (" -X       unset property X\n");
+  printf (" 0        clear all properties\n");
+  printf (" !        invalidate properties\n");
+  exit (0);
+}
+
+int
+main (int argc, char **argv)
+{
+  mu_property_t prop;
+  mu_iterator_t itr;
+  int i, j, rc;
+  char *filename = NULL;
+  int dumpit = 0;
+  mu_stream_t str = NULL;
+
+  if (argc == 1)
+    help (argv[0]);
+  
+  for (i = 1; i < argc; i++)
+    {
+      if (!(argv[i][0] == '-' && argv[i][1] == '-'))
+       break;
+      if (strcmp (argv[i], "--help") == 0)
+       help (argv[0]);
+      else if (strncmp (argv[i], "--file=", 7) == 0)
+       filename = argv[i] + 7;
+      else if (strcmp (argv[i], "--dump") == 0)
+       dumpit = 1;
+      else
+       {
+         mu_error ("unknown switch: %s", argv[i]);
+         return 1;
+       }
+    }
+
+  if (filename)
+    {
+      MU_ASSERT (mu_file_stream_create (&str, filename,
+                                       MU_STREAM_RDWR|MU_STREAM_CREAT));
+      if (i == argc)
+       dumpit = 1;
+    }
+
+  MU_ASSERT (mu_property_create_init (&prop, mu_assoc_property_init, str));
+
+  for (j = 0; i < argc; i++, j++)
+    {
+      char *key = argv[i];
+      char *p = strchr (key, '=');
+
+      if (p)
+       {
+         int override;
+         if (p > key && p[-1] == ':')
+           {
+             override = 0;
+             p[-1] = 0;
+           }
+         else
+           {
+             override = 1;
+             *p = 0;
+           }
+         p++;
+         rc = mu_property_set_value (prop, key, p, override);
+         printf ("%d: %s=%s: %s\n",
+                 j, key, p, mu_strerror (rc));
+       }
+      else if (key[0] == '?')
+       {
+         key++;
+         rc = mu_property_is_set (prop, key);
+         printf ("%d: %s is %s\n", j, key, rc ? "set" : "not set");
+       }
+      else if (key[0] == '-')
+       {
+         key++;
+         rc = mu_property_unset (prop, key);
+         printf ("%d: unset %s: %s\n", j, key, mu_strerror (rc));
+       }
+      else if (key[0] == '+')
+       {
+         const char *val;
+         
+         key++;
+         rc = mu_property_sget_value (prop, key, &val);
+         if (rc)
+           printf ("%d: cannot get %s: %s\n", j, key, mu_strerror (rc));
+         else
+           printf ("%d: %s=%s\n", j, key, val);
+       }
+      else if (key[0] == '0' && key[1] == 0)
+       {
+         rc = mu_property_clear (prop);
+         printf ("%d: clear: %s\n", j, mu_strerror (rc));
+       }
+      else if (key[0] == '!' && key[1] == 0)
+       {
+         rc = mu_property_invalidate (prop);
+         printf ("%d: invalidate: %s\n", j, mu_strerror (rc));
+       }      
+      else
+       {
+         mu_error ("%d: unrecognized command", i);
+       }
+    }
+
+  if (dumpit)
+    {
+      if (mu_property_get_iterator (prop, &itr) == 0)
+       {
+         printf ("Property dump:\n");
+         for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
+              mu_iterator_next (itr))
+           {
+             const char *name, *val;
+             
+             mu_iterator_current_kv (itr, (const void **)&name, (void**)&val);
+             printf ("%s=%s\n", name, val);
+           }
+         mu_iterator_destroy (&itr);
+       }
+    }
+  
+  mu_property_destroy (&prop);
+  return 0;
+}
diff --git a/libmailutils/tests/testsuite.at b/libmailutils/tests/testsuite.at
index 78fb693..43806c7 100644
--- a/libmailutils/tests/testsuite.at
+++ b/libmailutils/tests/testsuite.at
@@ -65,4 +65,5 @@ m4_include([decode2047.at])
 m4_include([encode2047.at])
 m4_include([fromflt.at])
 m4_include([wicket.at])
+m4_include([prop.at])
 
diff --git a/libproto/mh/Makefile.am b/libproto/mh/Makefile.am
index 322d657..f39cbc9 100644
--- a/libproto/mh/Makefile.am
+++ b/libproto/mh/Makefile.am
@@ -22,6 +22,7 @@ libmu_mh_la_LDFLAGS=-version-info 
@VI_CURRENT@:@VI_REVISION@:@VI_AGE@
 libmu_mh_la_LIBADD = ${MU_LIB_MAILUTILS}
 libmu_mh_la_SOURCES = \
  folder.c\
- mbox.c
+ mbox.c\
+ profile.c
 
 
diff --git a/libproto/mh/mbox.c b/libproto/mh/mbox.c
index c3e550a..9dbcce2 100644
--- a/libproto/mh/mbox.c
+++ b/libproto/mh/mbox.c
@@ -22,8 +22,6 @@
 # include <config.h>
 #endif
 
-#ifdef ENABLE_MH
-
 #include <sys/types.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -63,6 +61,7 @@
 #include <mailutils/observer.h>
 #include <mailutils/io.h>
 #include <mailutils/cctype.h>
+#include <mailutils/mh.h>
 #include <mailutils/sys/mailbox.h>
 #include <mailutils/sys/registrar.h>
 #include <mailutils/sys/amd.h>
@@ -359,6 +358,30 @@ mh_remove (struct _amd_data *amd)
 }
 
 
+static int
+mh_get_property (mu_mailbox_t mailbox, mu_property_t *pprop)
+{
+  struct _amd_data *amd = mailbox->data;
+  mu_property_t property = NULL;
+  struct mu_mh_prop *mhprop;
+  const char *p;
+  
+  mhprop = calloc (1, sizeof (mhprop[0]));
+  if (!mhprop)
+    return ENOMEM;
+  p = mu_mhprop_get_value (mu_mh_profile, "mh-sequences",
+                          MU_MH_SEQUENCES_FILE);
+  mhprop->filename = mu_make_file_name (amd->name, p);
+  mu_property_create_init (&property, mu_mh_property_init, mhprop);
+  mu_mailbox_set_property (mailbox, property);
+      
+  /*FIXME mu_property_set_value (property, "TYPE", "MH", 1);*/
+  *pprop = property;
+  return 0;
+}
+
+
+
 
 int
 _mailbox_mh_init (mu_mailbox_t mailbox)
@@ -383,14 +406,9 @@ _mailbox_mh_init (mu_mailbox_t mailbox)
   amd->next_uid = _mh_next_seq;
   amd->remove = mh_remove;
 
-  /* Set our properties.  */
-  {
-    mu_property_t property = NULL;
-    mu_mailbox_get_property (mailbox, &property);
-    mu_property_set_value (property, "TYPE", "MH", 1);
-  }
-
+  mailbox->_get_property = mh_get_property;
+  
   return 0;
 }
 
-#endif
+
diff --git a/libproto/mh/profile.c b/libproto/mh/profile.c
new file mode 100644
index 0000000..6e9ce55
--- /dev/null
+++ b/libproto/mh/profile.c
@@ -0,0 +1,60 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <mailutils/property.h>
+#include <mailutils/iterator.h>
+#include <mailutils/errno.h>
+#include <mailutils/mh.h>
+
+mu_property_t mu_mh_profile;
+mu_property_t mu_mh_context;
+
+const char *
+mu_mhprop_get_value (mu_property_t prop, const char *name, const char *defval)
+{
+  const char *p;
+
+  if (!prop || mu_property_sget_value (prop, name, &p))
+    p = defval; 
+  return p;
+}
+
+int
+mu_mhprop_iterate (mu_property_t prop, mu_mhprop_iterator_t fp, void *data)
+{
+  mu_iterator_t itr;
+  int rc;
+
+  if (!prop)
+    return EINVAL;
+  rc = mu_property_get_iterator (prop, &itr);
+  if (rc)
+    return rc;
+  for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
+       mu_iterator_next (itr))
+    {
+      const char *name, *val;
+      mu_iterator_current_kv (itr, (const void **)&name, (void**)&val);
+      rc = fp (name, val, data);
+      if (rc)
+       break;
+    }
+  mu_iterator_destroy (&itr);
+  return rc;
+}
diff --git a/mh/.gitignore b/mh/.gitignore
index df37d55..e1a9c51 100644
--- a/mh/.gitignore
+++ b/mh/.gitignore
@@ -28,6 +28,7 @@ mhpath
 pick
 pick-gram.c
 pick-gram.h
+prompter
 refile
 repl
 rmf
diff --git a/mh/Makefile.am b/mh/Makefile.am
index 08218b2..5ddf5fd 100644
--- a/mh/Makefile.am
+++ b/mh/Makefile.am
@@ -64,6 +64,7 @@ noinst_LIBRARIES = libmh.a
 
 libmh_a_SOURCES= \
  compcommon.c\
+ mboxprop.c\
  mh_alias_gram.c\
  mh_alias_lex.c\
  mh_argp.c\
diff --git a/mh/folder.c b/mh/folder.c
index 57a9179..0df51c3 100644
--- a/mh/folder.c
+++ b/mh/folder.c
@@ -740,6 +740,7 @@ roll_back (const char *folder_name, struct pack_tab 
*pack_tab, size_t i)
 
 struct fixup_data
 {
+  mu_mailbox_t mbox;
   const char *folder_dir;
   struct pack_tab *pack_tab;
   size_t count;
@@ -797,12 +798,12 @@ _fixup (const char *name, const char *value, struct 
fixup_data *fd, int flags)
 
   mu_wordsplit_free (&ws);
   
-  mh_seq_add (name, &msgset, flags | SEQ_ZERO);
+  mh_seq_add (fd->mbox, name, &msgset, flags | SEQ_ZERO);
   free (msgset.list);
 
   if (verbose)
     {
-      const char *p = mh_seq_read (name, flags);
+      const char *p = mh_seq_read (fd->mbox, name, flags);
       fprintf (stderr, "Sequence %s: %s\n", name, p);
     }
   
@@ -917,18 +918,23 @@ action_pack ()
     fprintf (stderr, _("Finished packing messages.\n"));
 
   /* Fix-up sequences */
-  fd.folder_dir = folder_dir;
-  fd.pack_tab = pack_tab;
-  fd.count = count;
-  if (verbose)
-    fprintf (stderr, _("Fixing global sequences\n"));
-  mh_global_sequences_iterate (fixup_global, &fd);
-  if (verbose)
-    fprintf (stderr, _("Fixing private sequences\n"));
-  mh_global_context_iterate (fixup_private, &fd);
-
   if (!dry_run)
-    mh_global_save_state ();
+    {
+      mbox = mh_open_folder (mh_current_folder (), 0);
+      fd.mbox = mbox;
+      fd.folder_dir = folder_dir;
+      fd.pack_tab = pack_tab;
+      fd.count = count;
+      if (verbose)
+       fprintf (stderr, _("Fixing global sequences\n"));
+      mh_global_sequences_iterate (mbox, fixup_global, &fd);
+      if (verbose)
+       fprintf (stderr, _("Fixing private sequences\n"));
+      mh_global_context_iterate (fixup_private, &fd);
+      mu_mailbox_close (mbox);
+      mu_mailbox_destroy (&mbox);
+      mh_global_save_state ();
+    }
   
   return 0;
 }
diff --git a/mh/inc.c b/mh/inc.c
index dde43fe..76a38b2 100644
--- a/mh/inc.c
+++ b/mh/inc.c
@@ -175,6 +175,8 @@ main (int argc, char **argv)
   mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, NULL);
+  /* Inc sets missing cur to 1 */
+  mh_mailbox_cur_default = 1;
 
   if (!quiet && mh_format_parse (format_str, &format))
     {
@@ -256,9 +258,11 @@ main (int argc, char **argv)
       if (n == 1 && changecur)
        {
          mu_message_t msg = NULL;
-      
-         mu_mailbox_get_message (output, lastmsg+1, &msg);
-         mh_message_number (msg, &current_message);
+         size_t cur;
+         
+         mu_mailbox_get_message (output, lastmsg + 1, &msg);
+         mh_message_number (msg, &cur);
+         mh_mailbox_set_cur (output, cur);
        }
          
       if (!quiet)
@@ -272,8 +276,12 @@ main (int argc, char **argv)
        }
     }
 
-  if (changecur)
-    mh_global_save_state ();
+  if (!changecur)
+    {
+      mu_property_t prop = mh_mailbox_get_property (output);
+      mu_property_invalidate (prop);
+    }
+  mh_global_save_state ();
   
   mu_mailbox_close (output);
   mu_mailbox_destroy (&output);
diff --git a/mh/mark.c b/mh/mark.c
index 03588bf..78ed6c3 100644
--- a/mh/mark.c
+++ b/mh/mark.c
@@ -116,31 +116,41 @@ opt_handler (int key, char *arg, struct argp_state *state)
     }
   return 0;
 }
+
+
+struct mark_closure
+{
+  mu_mailbox_t mbox;
+  mh_msgset_t *msgset;
+};
 
 static int
 action_add (void *item, void *data)
 {
-  mh_seq_add ((char *)item, (mh_msgset_t *)data, seq_flags);
+  struct mark_closure *clos = data;
+  mh_seq_add (clos->mbox, (char *)item, clos->msgset, seq_flags);
   return 0;
 }
 
 static int
 action_delete (void *item, void *data)
 {
-  mh_seq_delete ((char *)item, (mh_msgset_t *)data, seq_flags);
+  struct mark_closure *clos = data;
+  mh_seq_delete (clos->mbox, (char *)item, clos->msgset, seq_flags);
   return 0;
 }
 
 static int
 action_list (void *item, void *data)
 {
+  struct mark_closure *clos = data;
   char *name = item;
   const char *val;
   
-  val = mh_seq_read (name, 0);
+  val = mh_seq_read (clos->mbox, name, 0);
   if (val)
     printf ("%s: %s\n", name, val);
-  else if ((val = mh_seq_read (name, SEQ_PRIVATE)))
+  else if ((val = mh_seq_read (clos->mbox, name, SEQ_PRIVATE)))
     printf ("%s (%s): %s\n", name, _("private"), val);
   return 0;
 }
@@ -171,9 +181,9 @@ list_public (const char *name, const char *value, void 
*data)
 }
 
 static void
-list_all ()
+list_all (mu_mailbox_t mbox)
 {
-  mh_global_sequences_iterate (list_public, NULL);
+  mh_global_sequences_iterate (mbox, list_public, NULL);
   mh_global_context_iterate (list_private, NULL);
 }
 
@@ -184,6 +194,7 @@ main (int argc, char **argv)
   mh_msgset_t msgset;
   mu_mailbox_t mbox;
   mu_url_t url;
+  struct mark_closure clos;
   
   MU_APP_INIT_NLS ();
   mh_argp_init ();
@@ -201,6 +212,8 @@ main (int argc, char **argv)
   mh_msgset_parse (mbox, &msgset, argc, argv, "cur");
   mh_msgset_uids (mbox, &msgset);
   
+  clos.mbox = mbox;
+  clos.msgset = &msgset;
   switch (action)
     {
     case ARG_ADD:
@@ -209,7 +222,7 @@ main (int argc, char **argv)
          mu_error (_("--add requires at least one --sequence argument"));
          return 1;
        }
-      mu_list_do (seq_list, action_add, (void *) &msgset);
+      mu_list_do (seq_list, action_add, (void *) &clos);
       mh_global_save_state ();
       break;
       
@@ -219,17 +232,18 @@ main (int argc, char **argv)
          mu_error (_("--delete requires at least one --sequence argument"));
          return 1;
        }
-      mu_list_do (seq_list, action_delete, (void *) &msgset);
+      mu_list_do (seq_list, action_delete, (void *) &clos);
       mh_global_save_state ();
       break;
       
     case ARG_LIST:
       if (!seq_list)
-       list_all ();
+       list_all (mbox);
       else
-       mu_list_do (seq_list, action_list, NULL);
+       mu_list_do (seq_list, action_list, &clos);
       break;
     }
-
+  mu_mailbox_close (mbox);
+  mu_mailbox_destroy (&mbox);
   return 0;
 }
diff --git a/mh/mboxprop.c b/mh/mboxprop.c
new file mode 100644
index 0000000..bba10e7
--- /dev/null
+++ b/mh/mboxprop.c
@@ -0,0 +1,74 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+   Copyright (C) 1999, 2000, 2001, 2005, 2006, 2007, 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.
+
+   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/>. */
+
+/* MH message sets. */
+
+#include <mh.h>
+
+/* Default value for missing "cur".  Valid values are 0 and 1. */
+int mh_mailbox_cur_default = 0;
+
+void
+mh_mailbox_get_cur (mu_mailbox_t mbox, size_t *pcur)
+{
+  mu_property_t prop = NULL;
+  const char *s;
+  int rc = mu_mailbox_get_property (mbox, &prop);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_get_property", NULL, rc);
+      exit (1);
+    }
+  rc = mu_property_sget_value (prop, "cur", &s);
+  if (rc == MU_ERR_NOENT)
+    *pcur = mh_mailbox_cur_default;
+  else if (rc == 0)
+    {
+      char *p;
+      *pcur = strtoul (s, &p, 10);
+      if (*p)
+       {
+         mu_error (_("invalid \"cur\" value (%s)"), s);
+         *pcur = 1;
+       }
+    }
+  else
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_property_sget_value", NULL, rc);
+      exit (1);
+    }
+}
+      
+void
+mh_mailbox_set_cur (mu_mailbox_t mbox, size_t cur)
+{
+  mu_property_t prop = NULL;
+  int rc = mu_mailbox_get_property (mbox, &prop);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_get_property", NULL, rc);
+      exit (1);
+    }      
+  rc = mu_property_set_value (prop, "cur", mu_umaxtostr (0, cur), 1);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_property_set_value", NULL, rc);
+      exit (1);
+    }
+}
+
+    
diff --git a/mh/mh.h b/mh/mh.h
index 17289c0..b9b89ef 100644
--- a/mh/mh.h
+++ b/mh/mh.h
@@ -55,6 +55,7 @@
 #include <mailutils/envelope.h>
 #include <mailutils/mime.h>
 #include <mailutils/io.h>
+#include <mailutils/property.h>
 
 #include <mu_umaxtostr.h>
 
@@ -233,9 +234,9 @@ typedef int (*mh_context_iterator) (const char *field, 
const char *value,
 #define SEQ_PRIVATE 1
 #define SEQ_ZERO    2
 
-extern size_t current_message;
 extern char mh_list_format[];
 extern int rcpt_mask;
+extern int mh_mailbox_cur_default;
 
 void mh_init (void);
 void mh_init2 (void);
@@ -251,13 +252,19 @@ const char *mh_global_context_get (const char *name, 
const char *defval);
 int mh_global_context_set (const char *name, const char *value);
 const char *mh_set_current_folder (const char *val);
 const char *mh_current_folder (void);
-const char *mh_global_sequences_get (const char *name, const char *defval);
-int mh_global_sequences_set (const char *name, const char *value);
+
+mu_property_t mh_mailbox_get_property (mu_mailbox_t mbox);
+const char *mh_global_sequences_get (mu_mailbox_t mbox,
+                                    const char *name, const char *defval);
+void mh_global_sequences_set (mu_mailbox_t mbox,
+                             const char *name, const char *value);
+void mh_global_sequences_iterate (mu_mailbox_t mbox,
+                                 mh_context_iterator fp, void *data);
+void mh_global_sequences_drop (mu_mailbox_t mbox);
+
 void mh_global_save_state (void);
 int mh_global_profile_iterate (mh_context_iterator fp, void *data);
 int mh_global_context_iterate (mh_context_iterator fp, void *data);
-int mh_global_sequences_iterate (mh_context_iterator fp, void *data);
-void mh_global_sequences_drop (void);
 
 int mh_interactive_mode_p (void);
 int mh_getyn (const char *fmt, ...) MU_PRINTFLIKE(1,2);
@@ -300,7 +307,7 @@ int mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset,
 int mh_msgset_member (mh_msgset_t *msgset, size_t num);
 void mh_msgset_reverse (mh_msgset_t *msgset);
 void mh_msgset_negate (mu_mailbox_t mbox, mh_msgset_t *msgset);
-int mh_msgset_current (mu_mailbox_t mbox, mh_msgset_t *msgset, int index);
+void mh_msgset_current (mu_mailbox_t mbox, mh_msgset_t *msgset, int index);
 void mh_msgset_free (mh_msgset_t *msgset);
 void mh_msgset_uids (mu_mailbox_t mbox, mh_msgset_t *msgset);
 
@@ -358,9 +365,11 @@ int mhl_format_run (mu_list_t fmt, int width, int length, 
int flags,
                    mu_message_t msg, mu_stream_t output);
 void mhl_format_destroy (mu_list_t *fmt);
 
-void mh_seq_add (const char *name, mh_msgset_t *mset, int flags);
-int mh_seq_delete (const char *name, mh_msgset_t *mset, int flags);
-const char *mh_seq_read (const char *name, int flags);
+void mh_seq_add (mu_mailbox_t mbox, const char *name, mh_msgset_t *mset,
+                int flags);
+int mh_seq_delete (mu_mailbox_t mbox, const char *name, mh_msgset_t *mset,
+                  int flags);
+const char *mh_seq_read (mu_mailbox_t mbox, const char *name, int flags);
 
 void mh_comp_draft (const char *formfile, const char *defformfile,
                    const char *draftfile);
@@ -371,3 +380,6 @@ void ali_verbatim (int enable);
 
 char *mh_safe_make_file_name (const char *dir, const char *file);
   
+void mh_mailbox_get_cur (mu_mailbox_t mbox, size_t *pcur);
+void mh_mailbox_set_cur (mu_mailbox_t mbox, size_t cur);
+
diff --git a/mh/mh_format.c b/mh/mh_format.c
index 60b8d7b..523d943 100644
--- a/mh/mh_format.c
+++ b/mh/mh_format.c
@@ -913,8 +913,19 @@ static void
 builtin_cur (struct mh_machine *mach)
 {
   size_t msgno = mach->msgno;
+  size_t cur;
+  int rc;
+  mu_mailbox_t mbox;
+  
+  rc = mu_message_get_mailbox (mach->message, &mbox);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_message_get_mailbox", NULL, rc);
+      exit (1);
+    }
   mh_message_number (mach->message, &msgno);
-  mach->arg_num = msgno == current_message;
+  mh_mailbox_get_cur (mbox, &cur); /* FIXME: Cache this */
+  mach->arg_num = msgno == cur;
 }
 
 static void
diff --git a/mh/mh_format.h b/mh/mh_format.h
index 64c1a66..0149fbc 100644
--- a/mh/mh_format.h
+++ b/mh/mh_format.h
@@ -49,7 +49,7 @@ struct mh_machine
 
   mu_list_t addrlist;       /* The list of email addresses output this far */
   int fmtflags;             /* Current formatting flags */
-  
+
   mu_message_t message;     /* Current message */
   size_t msgno;             /* Its number */
 };
diff --git a/mh/mh_global.c b/mh/mh_global.c
index 25873dd..2294477 100644
--- a/mh/mh_global.c
+++ b/mh/mh_global.c
@@ -20,10 +20,8 @@
 #include <mh.h>
 
 static const char *current_folder = NULL;
-size_t current_message = 0;
 mh_context_t *context;
 mh_context_t *profile;
-mh_context_t *sequences;
 int rcpt_mask = RCPT_DEFAULT;
 int mh_auto_install = 1;
 
@@ -137,54 +135,88 @@ mh_set_current_folder (const char *val)
   current_folder = mh_current_folder ();
   return current_folder;
 }
-
+
 /* Global sequences */
-
-void
-_mh_init_global_sequences ()
+mu_property_t
+mh_mailbox_get_property (mu_mailbox_t mbox)
 {
-  const char *name;
-  char *p, *seq_name;
-
-  if (sequences)
-    return;
-  
-  _mh_init_global_context ();
-  name = mh_global_profile_get ("mh-sequences", MH_SEQUENCES_FILE);
-  p = mh_expand_name (NULL, current_folder, 0);
-  seq_name = mh_safe_make_file_name (p, name);
-  free (p);
-  sequences = mh_context_create (seq_name, 1);
-  if (mh_context_read (sequences) == 0)
-    current_message = strtoul (mh_context_get_value (sequences, "cur", "0"),
-                              NULL, 10);
+  mu_property_t prop;
+  int rc = mu_mailbox_get_property (mbox, &prop);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_get_property", NULL, rc);
+      exit (1);
+    }
+  return prop;
 }
-
+  
 void
-mh_global_sequences_drop ()
+mh_global_sequences_drop (mu_mailbox_t mbox)
 {
-  mh_context_destroy (&sequences);
+  mu_property_t prop = mh_mailbox_get_property (mbox);
+  int rc = mu_property_clear (prop);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_property_clear", NULL, rc);
+      exit (1);
+    }
 }
 
 const char *
-mh_global_sequences_get (const char *name, const char *defval)
-{
-  _mh_init_global_sequences ();
-  return mh_context_get_value (sequences, name, defval);
+mh_global_sequences_get (mu_mailbox_t mbox, const char *name,
+                        const char *defval)
+{
+  mu_property_t prop = mh_mailbox_get_property (mbox);
+  const char *s;
+  int rc = mu_property_sget_value (prop, name, &s);
+  if (rc == MU_ERR_NOENT)
+    s = defval;
+  else if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_property_sget_value", name, rc);
+      exit (1);
+    }
+  return s;
 }
 
-int
-mh_global_sequences_set (const char *name, const char *value)
+void
+mh_global_sequences_set (mu_mailbox_t mbox, const char *name,
+                        const char *value)
 {
-  _mh_init_global_sequences ();
-  return mh_context_set_value (sequences, name, value);
+  mu_property_t prop = mh_mailbox_get_property (mbox);
+  int rc = mu_property_set_value (prop, name, value, 1);
+  if (rc && !(!value && rc == MU_ERR_NOENT))
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_property_set_value", name, rc);
+      exit (1);
+    }
 }
 
-int
-mh_global_sequences_iterate (mh_context_iterator fp, void *data)
+/* FIXME: Rewrite using mu_mhprop_iterate */
+void
+mh_global_sequences_iterate (mu_mailbox_t mbox,
+                            mh_context_iterator fp, void *data)
 {
-  _mh_init_global_context ();
-  return mh_context_iterate (sequences, fp, data);
+  int rc;
+  mu_iterator_t itr;
+  mu_property_t prop = mh_mailbox_get_property (mbox);
+
+  rc = mu_property_get_iterator (prop, &itr);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_property_get_iterator", NULL, rc);
+      exit (1);
+    }
+  for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
+       mu_iterator_next (itr))
+    {
+      const char *name, *val;
+      
+      mu_iterator_current_kv (itr, (const void **)&name, (void**)&val);
+      if (fp (name, val, data))
+       break;
+    }
+  mu_iterator_destroy (&itr);
 }
 
 /* Global state */
@@ -192,9 +224,6 @@ mh_global_sequences_iterate (mh_context_iterator fp, void 
*data)
 void
 mh_global_save_state ()
 {
-  mh_context_set_value (sequences, "cur", mu_umaxtostr (0, current_message));
-  mh_context_write (sequences);
-
   mh_context_set_value (context, "Current-Folder", current_folder);
   mh_context_write (context);
 }
diff --git a/mh/mh_init.c b/mh/mh_init.c
index 9f37b86..f35c08f 100644
--- a/mh/mh_init.c
+++ b/mh/mh_init.c
@@ -67,7 +67,6 @@ void
 mh_init2 ()
 {
   mh_current_folder ();
-  mh_global_sequences_get ("cur", NULL);
 }
 
 int
diff --git a/mh/mh_msgset.c b/mh/mh_msgset.c
index 41eb036..6e058a2 100644
--- a/mh/mh_msgset.c
+++ b/mh/mh_msgset.c
@@ -18,7 +18,6 @@
 /* MH message sets. */
 
 #include <mh.h>
-#include <mailutils/argcv.h>
 
 /* Expand a message set (msgcnt;msglist) to accomodate `inc' more
    elements */
@@ -72,13 +71,16 @@ msgset_cur (mu_mailbox_t mbox, size_t *pnum)
 {
   size_t i, count = 0;
   static int cached_n = 0;
+  size_t cur;
 
+  mh_mailbox_get_cur (mbox, &cur);
+  
   if (cached_n)
     {
       *pnum = cached_n;
       return 0;
     }
-  
+
   mu_mailbox_messages_count (mbox, &count);
   for (i = 1; i <= count; i++)
     {
@@ -87,7 +89,7 @@ msgset_cur (mu_mailbox_t mbox, size_t *pnum)
       
       mu_mailbox_get_message (mbox, i, &msg);
       mh_message_number (msg, &uid);
-      if (uid == current_message)
+      if (uid == cur)
        {
          *pnum = cached_n = i;
          return 0;
@@ -244,7 +246,7 @@ expand_user_seq (mu_mailbox_t mbox, mh_msgset_t *msgset, 
char *arg)
   p = strchr (arg, ':');
   if (p)
     *p++ = 0;
-  listp = mh_global_sequences_get (arg, NULL);
+  listp = mh_global_sequences_get (mbox, arg, NULL);
   if (!listp)
     {
       int len;
@@ -255,7 +257,7 @@ expand_user_seq (mu_mailbox_t mbox, mh_msgset_t *msgset, 
char *arg)
       if (strncmp (arg, neg, len))
        return 1;
       negate = 1;
-      listp = mh_global_sequences_get (arg + len, NULL);
+      listp = mh_global_sequences_get (mbox, arg + len, NULL);
       if (!listp)
        return 1;
     }
@@ -569,13 +571,21 @@ mh_msgset_reverse (mh_msgset_t *msgset)
 
 /* Set the current message to that contained at position `index'
    in the given message set */
-int
+void
 mh_msgset_current (mu_mailbox_t mbox, mh_msgset_t *msgset, int index)
 {
   mu_message_t msg = NULL;
-  if (mu_mailbox_get_message (mbox, msgset->list[index], &msg))
-    return 1;
-  return mh_message_number (msg, &current_message);
+  int rc;
+  size_t cur;
+  
+  rc = mu_mailbox_get_message (mbox, msgset->list[index], &msg);
+  if (rc)
+    {
+      mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_get_message", NULL, rc);
+      exit (1);
+    }
+  mh_message_number (msg, &cur);
+  mh_mailbox_set_cur (mbox, cur);
 }
 
 /* Free memory allocated for the message set. Note, that the msgset
diff --git a/mh/mh_sequence.c b/mh/mh_sequence.c
index f80b855..df459bd 100644
--- a/mh/mh_sequence.c
+++ b/mh/mh_sequence.c
@@ -28,7 +28,7 @@ private_sequence_name (const char *name)
 }
 
 const char *
-mh_seq_read (const char *name, int flags)
+mh_seq_read (mu_mailbox_t mbox, const char *name, int flags)
 {
   const char *value;
 
@@ -39,12 +39,12 @@ mh_seq_read (const char *name, int flags)
       free (p);
     }
   else
-    value = mh_global_sequences_get (name, NULL);
+    value = mh_global_sequences_get (mbox, name, NULL);
   return value;
 }
 
 static void
-write_sequence (const char *name, char *value, int private)
+write_sequence (mu_mailbox_t mbox, const char *name, char *value, int private)
 {
   if (private)
     {
@@ -53,24 +53,24 @@ write_sequence (const char *name, char *value, int private)
       free (p);
     }
   else
-    mh_global_sequences_set (name, value);
+    mh_global_sequences_set (mbox, name, value);
 }
 
 static void
-delete_sequence (const char *name, int private)
+delete_sequence (mu_mailbox_t mbox, const char *name, int private)
 {
-  write_sequence (name, NULL, private);
+  write_sequence (mbox, name, NULL, private);
 }
 
 void
-mh_seq_add (const char *name, mh_msgset_t *mset, int flags)
+mh_seq_add (mu_mailbox_t mbox, const char *name, mh_msgset_t *mset, int flags)
 {
-  const char *value = mh_seq_read (name, flags);
+  const char *value = mh_seq_read (mbox, name, flags);
   char *new_value, *p;
   const char *buf;
   size_t i, len;
 
-  delete_sequence (name, !(flags & SEQ_PRIVATE));
+  delete_sequence (mbox, name, !(flags & SEQ_PRIVATE));
 
   if (flags & SEQ_ZERO)
     value = NULL;
@@ -99,9 +99,11 @@ mh_seq_add (const char *name, mh_msgset_t *mset, int flags)
       *p++ = ' ';
     }
   *p = 0;
-  write_sequence (name, new_value, flags & SEQ_PRIVATE);
+  write_sequence (mbox, name, new_value, flags & SEQ_PRIVATE);
+  /* FIXME
   if (mu_c_strcasecmp (name, "cur") == 0)
     current_message = strtoul (new_value, NULL, 0);
+  */
   free (new_value);
 }
 
@@ -119,9 +121,10 @@ cmp_msgnum (const void *a, const void *b)
 }
 
 int
-mh_seq_delete (const char *name, mh_msgset_t *mset, int flags)
+mh_seq_delete (mu_mailbox_t mbox, const char *name,
+              mh_msgset_t *mset, int flags)
 {
-  const char *value = mh_seq_read (name, flags);
+  const char *value = mh_seq_read (mbox, name, flags);
   char *new_val;
   char *p;
   size_t i, count;
@@ -167,7 +170,7 @@ mh_seq_delete (const char *name, mh_msgset_t *mset, int 
flags)
        }
     }
   *p = 0;
-  write_sequence (name, count > 0 ? new_val : NULL, flags & SEQ_PRIVATE);
+  write_sequence (mbox, name, count > 0 ? new_val : NULL, flags & SEQ_PRIVATE);
   mu_wordsplit_free (&ws);
   free (new_val);
   
diff --git a/mh/pick.c b/mh/pick.c
index 0bbf3ba..d9677cc 100644
--- a/mh/pick.c
+++ b/mh/pick.c
@@ -298,10 +298,18 @@ pick_message (mu_mailbox_t mbox, mu_message_t msg, size_t 
num, void *data)
     }
 }
 
+
+struct pick_closure
+{
+  mu_mailbox_t mbox;
+  mh_msgset_t *msgset;
+};
+
 static int
 action_add (void *item, void *data)
 {
-  mh_seq_add ((char *)item, (mh_msgset_t *)data, seq_flags);
+  struct pick_closure *clos = data;
+  mh_seq_add (clos->mbox, (char *)item, clos->msgset, seq_flags);
   return 0;
 }
 
@@ -395,13 +403,18 @@ main (int argc, char **argv)
 
   if (seq_list)
     {
+      struct pick_closure clos;
       mh_msgset_t msgset;
       msgset.count = msgno_count;
       msgset.list = obstack_finish (&msgno_stk);
-      mu_list_do (seq_list, action_add, (void*) &msgset);
+      clos.mbox = mbox;
+      clos.msgset = &msgset;
+      mu_list_do (seq_list, action_add, &clos);
     }
 
   mh_global_save_state ();
+  mu_mailbox_close (mbox);
+  mu_mailbox_destroy (&mbox);
   return status;
 }
   
diff --git a/mh/prompter.c b/mh/prompter.c
index 7de7a43..062bd9c 100644
--- a/mh/prompter.c
+++ b/mh/prompter.c
@@ -255,6 +255,7 @@ main (int argc, char **argv)
          mu_opool_destroy (&opool);
        }
     }
+  mu_iterator_destroy (&itr);
   mu_stream_printf (strout, "--------\n");
   mu_stream_write (tmp, "\n", 1, NULL);
 
@@ -263,7 +264,7 @@ main (int argc, char **argv)
   if (prepend_option)
     {
       mu_stream_printf (strout, "\n--------%s\n\n", _("Enter initial text"));
-      while (newval = prompter_get_line ())
+      while ((newval = prompter_get_line ()))
        {
          mu_stream_write (tmp, newval, strlen (newval), NULL);
          free (newval);
@@ -286,7 +287,7 @@ main (int argc, char **argv)
   if (!prepend_option && !rapid_option)
     {
       printf ("\n--------%s\n\n", _("Enter additional text"));
-      while (newval = prompter_get_line ())
+      while ((newval = prompter_get_line ()))
        {
          mu_stream_write (tmp, newval, strlen (newval), NULL);
          free (newval);
diff --git a/mh/rmf.c b/mh/rmf.c
index bf07fe4..656c9fc 100644
--- a/mh/rmf.c
+++ b/mh/rmf.c
@@ -53,7 +53,7 @@ struct mh_option mh_option[] = {
 
 int explicit_folder; /* Was the folder explicitly given */
 int interactive; /* Ask for confirmation before deleting */
-int recurse;     /* Recursively process all the sub-directories */
+int recursive;     /* Recursively process all the sub-directories */
 
 static char *cur_folder_path; /* Full pathname of the current folder */
 static char *folder_name;     /* Name of the (topmost) folder to be
@@ -78,11 +78,11 @@ opt_handler (int key, char *arg, struct argp_state *state)
       break;
        
     case ARG_RECURSIVE:
-      recurse = is_true (arg);
+      recursive = is_true (arg);
       break;
       
     case ARG_NORECURSIVE:
-      recurse = 0;
+      recursive = 0;
       break;
 
     default:
@@ -107,6 +107,31 @@ current_folder_path ()
 static int
 rmf (const char *name)
 {
+  mu_mailbox_t mbox = NULL;
+  int rc;
+  
+  rc = mu_mailbox_create_default (&mbox, name);
+  if (rc)
+    {
+      mu_error (_("cannot create mailbox %s: %s"),
+               name, strerror (rc));
+      return 1;
+    }
+
+  rc = mu_mailbox_remove (mbox);
+  mu_mailbox_destroy (&mbox);
+  if (rc)
+    {
+      mu_error (_("cannot remove %s: %s"), name, mu_strerror (rc));
+      return 1;
+    }
+  return 0;
+}
+
+/* Recursive rmf */
+static int
+recrmf (const char *name)
+{
   DIR *dir;
   struct dirent *entry;
   int failures = 0;
@@ -137,50 +162,24 @@ rmf (const char *name)
          mu_diag_funcall (MU_DIAG_ERROR, "stat", p, errno);
        }
       else if (S_ISDIR (st.st_mode))
-       {
-         if (recurse)
-           failures += rmf (p);
-         else
-           {
-             printf ("%s: file `%s' not deleted, continuing...\n",
-                     mu_program_name, p);
-             failures++;
-           }
-       }
-      else
-       {
-         if (unlink (p))
-           {
-             mu_diag_funcall (MU_DIAG_ERROR, "unlink", p, errno);
-             failures++;
-           }
-       }
+       failures += recrmf (p);
       free (p);
     }
   closedir (dir);
 
   if (failures == 0)
-    failures += rmdir (name);
+    failures += rmf (name);
   else
     printf ("%s: folder `%s' not removed\n",
            mu_program_name, name);
 
-  if (failures == 0)
-    {
-      if (cur_folder_path && strcmp (name, cur_folder_path) == 0)
-       {
-         mh_set_current_folder ("inbox");
-         mh_global_sequences_drop ();
-         mh_global_save_state ();
-         printf ("[+inbox now current]\n");
-       }
-    }
   return failures;
 }
 
 int
 main (int argc, char **argv)
 {
+  int status;
   char *name;
 
   /* Native Language Support */
@@ -199,6 +198,23 @@ main (int argc, char **argv)
     }
   else
     name = mh_expand_name (NULL, folder_name, 0);
-  rmf (name);
-  return 0;
+  if (recursive)
+    status = recrmf (name);
+  else
+    {
+      if (interactive && !mh_getyn (_("Remove folder %s"), name))
+       exit (0);
+      status = rmf (name);
+    }
+  if (status == 0)
+    {
+      if (cur_folder_path && strcmp (name, cur_folder_path) == 0)
+       {
+         mh_set_current_folder ("inbox");
+         mh_global_save_state ();
+         printf ("[+inbox now current]\n");
+       }
+      return 0;
+    }      
+  return 1;
 }
diff --git a/mh/scan.c b/mh/scan.c
index 0fe0ee4..05ec180 100644
--- a/mh/scan.c
+++ b/mh/scan.c
@@ -219,7 +219,8 @@ main (int argc, char **argv)
 
   clear_screen ();
   mh_global_save_state ();
-  
+  mu_mailbox_close (mbox);
+  mu_mailbox_destroy (&mbox);
   return status;
 }
 
diff --git a/mh/tests/folder.at b/mh/tests/folder.at
index e7d0204..cd1b9b9 100644
--- a/mh/tests/folder.at
+++ b/mh/tests/folder.at
@@ -96,7 +96,6 @@ Mail/inbox/2
 Mail/inbox/3
 Mail/inbox/4
 Mail/inbox/5
-Mail/inbox/.mh_sequences
 ])
 
 MH_CHECK([folder --pack=N],[folder06 folder--pack=N],[
@@ -115,7 +114,6 @@ Mail/inbox/2
 Mail/inbox/3
 Mail/inbox/4
 Mail/inbox/5
-Mail/inbox/.mh_sequences
 ])
 
 MH_CHECK([folder -push/-pop],[folder07 folder-push folder-pop folder-push-pop],
diff --git a/mh/tests/inc.at b/mh/tests/inc.at
index 64bcedb..e2150c8 100644
--- a/mh/tests/inc.at
+++ b/mh/tests/inc.at
@@ -22,7 +22,7 @@ inc -notruncate -file ./mbox1 | sed 's/ *$//'
 cmp $abs_top_srcdir/testsuite/spool/mbox1 mbox1
 ],
 [0],
-[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+[   1+ 12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
    2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
    3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
    4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
@@ -36,7 +36,7 @@ echo "Next"
 inc -truncate -file ./mbox1 | sed 's/ *$//'
 ],
 [0],
-[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+[   1+ 12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
    2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
    3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
    4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
@@ -50,12 +50,42 @@ mkdir Mail/new
 inc +new -file ./mbox1 | sed 's/ *$//'
 ],
 [0],
-[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+[   1+ 12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
    2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
    3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
    4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
    5  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
 ])
 
+MH_CHECK([inc -changecur],[inc03 inc-changecur],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY([$abs_top_srcdir/testsuite/spool/mbox1])
+inc -changecur -file ./mbox1 | sed 's/ *$//'
+],
+[0],
+[   6+ 12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+   7  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   8  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   9  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+  10  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
+])
+
+MH_CHECK([inc -nochangecur],[inc04 inc-nochangecur],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo "cur: 1" > Mail/inbox/.mh_sequences
+MUT_MBCOPY([$abs_top_srcdir/testsuite/spool/mbox1])
+inc -nochangecur -file ./mbox1 | sed 's/ *$//'
+grep ^cur: Mail/inbox/.mh_sequences
+],
+[0],
+[   6  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+   7  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   8  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   9  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+  10  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
+cur: 1  
+])
+
+
 m4_popdef[MH_KEYWORDS])
 # End of inc.at
diff --git a/mu/Makefile.am b/mu/Makefile.am
index 7684892..a4eb398 100644
--- a/mu/Makefile.am
+++ b/mu/Makefile.am
@@ -78,7 +78,7 @@ AM_CPPFLAGS = \
   -DPYTHON_LIBS="\"$(PYTHON_LIBS)\"" \
   -DI18NLIBS="\"$(LIBINTL)\""
 
-BUILD_SOURCES=mu-setup.c mu-setup.h
+BUILT_SOURCES=mu-setup.c mu-setup.h
 EXTRA_DIST=mu-setup.c mu-setup.h
 
 mu-setup.h: Makefile.am $(MODULES) $(IDLE_MODULES) 


hooks/post-receive
-- 
GNU Mailutils



reply via email to

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