commit-mailutils
[Top][All Lists]
Advanced

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

[SCM] GNU Mailutils branch, stream-cleanup, updated. rel-2_1-92-gb000617


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, stream-cleanup, updated. rel-2_1-92-gb000617
Date: Sun, 02 May 2010 15:00:51 +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=b000617bad12dc7d3b0ea5f4541cc66b64e2fb02

The branch, stream-cleanup has been updated
       via  b000617bad12dc7d3b0ea5f4541cc66b64e2fb02 (commit)
       via  55e8650184dc3f03e98cd41714115dc9803610cc (commit)
       via  a5721d4bc037b7288722650cf8d6685d18c6cdfd (commit)
       via  82917550244d2e4d06f4450d58af7beaae51a0a7 (commit)
       via  14af0505bcf691efbeb8fb60ab5ea99b9836f061 (commit)
       via  7262235cbe6dc9426ad6e37c5fe0f4b023b324a9 (commit)
      from  62db89e3dca29f9b931c62b25014955a4ede36c0 (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 b000617bad12dc7d3b0ea5f4541cc66b64e2fb02
Author: Sergey Poznyakoff <address@hidden>
Date:   Sun May 2 17:58:01 2010 +0300

    Implement seek on filters in read-only mode.
    
    * include/mailutils/stream.h (mu_stream_skip_input_bytes): New proto.
    * mailbox/stream.c (mu_stream_skip_input_bytes): New function.
    * mailbox/fltstream.c (filter_seek): Re-implement on top of
    mu_stream_skip_input_bytes.
    (mu_filter_stream_create): Fix flag validity checking.
    
    * examples/base64.c: Add new option (-s) for testing seek operations
    on filters.

commit 55e8650184dc3f03e98cd41714115dc9803610cc
Author: Sergey Poznyakoff <address@hidden>
Date:   Sun May 2 17:00:23 2010 +0300

    Make version output of the MH utilities more informative.
    
    * mh/mh_argp.c [MU_ALPHA_RELEASE}: Include git-describe.h
    (mh_program_version_hook): New function.
    (mh_argp_init): Take no arguments. Set argp_program_version_hook.
    * mh/mh_getopt.h (ARG_LICENSE): Remove.
    (mh_argp_init): Change proto.
    
    All sources: Fix calls to mh_argp_init, remove --license option.

commit a5721d4bc037b7288722650cf8d6685d18c6cdfd
Author: Sergey Poznyakoff <address@hidden>
Date:   Sun May 2 16:16:44 2010 +0300

    For alpha version, include git tag info in the version output.
    
    * include/mailutils/libargp.h (mu_program_version_hook): New proto.
    * libmu_argp/Makefile.am (libmu_argp_a_SOURCES): Remove mu_argp.h.
    * libmu_argp/mu_argp.h: Remove.
    * libmu_argp/muinit.c [MU_ALPHA_RELEASE]: Include git-describe.h
    (mu_program_version_hook): New function.
    (mu_argp_init): Set mu_program_version_hook, unless vers is given.
    
    * comsat/comsat.c (main): Call mu_argp_init with NULL arguments.
    * config/mailutils-config.c: Likewise.
    * dotlock/dotlock.c: Likewise.
    * examples/muauth.c: Likewise.
    * frm/frm.c: Likewise.
    * frm/from.c: Likewise.
    * guimb/main.c: Likewise.
    * imap4d/imap4d.c: Likewise.
    * maidag/maidag.c: Likewise.
    * mail/mail.c: Likewise.
    * messages/messages.c: Likewise.
    * mimeview/mimeview.c: Likewise.
    * movemail/movemail.c: Likewise.
    * pop3d/pop3d.c: Likewise.
    * pop3d/popauth.c: Likewise.
    * readmsg/readmsg.c: Likewise.
    * sieve/sieve.c: Likewise.

commit 82917550244d2e4d06f4450d58af7beaae51a0a7
Author: Sergey Poznyakoff <address@hidden>
Date:   Sun May 2 15:40:02 2010 +0300

    Fix conditional compilation.
    
    * .gitignore: Add git-describe and git-describe.h.
    * Makefile.am (MU_COND_LIBMU_CPP): Replaced with MU_COND_SUPPORT_CXX
    (SUBDIRS): Begin with .
    (EXTRA_DIST, BUILT_SOURCES): Add git-describe and git-describe.h.
    (git-describe, git-describe.h): New rules.
    (alpha, alphacheck): Use git-describe to produce additional suffix.
    * enable.m4 (MU_ENABLE_SUPPORT): Create an Automake condition.
    * configure.ac: Fix MU_ENABLE_SUPPORT calls.
    (--without-python): Replace with --disable-python.
    * examples/Makefile.am: Disable components based on MU_COND conditions.
    * libproto/Makefile.am: Likewise.
    * include/mailutils/Makefile.am (MU_COND_LIBMU_CPP): Replace with
    MU_COND_SUPPORT_CXX.
    
    * mailbox/nullrec.c: New file.
    * mailbox/Makefile.am (libmailutils_la_SOURCES): Add nullrec.c.
    
    * mail/decode.c: Remove unused variable.
    * mailbox/streamref.c: Likewise.

commit 14af0505bcf691efbeb8fb60ab5ea99b9836f061
Author: Sergey Poznyakoff <address@hidden>
Date:   Sun May 2 14:20:32 2010 +0300

    Simplify stream->seek.
    
    * include/mailutils/sys/stream.h (_mu_stream) <seek>: Remove the
    `whence' parameter.
    * mailbox/stream.c (mu_stream_seek): Update the seek method call.
    
    * mailbox/streamref.c (_streamref_seek): Fix the signature. Remove
    unnecessary code.
    * mailbox/amd.c (amd_body_stream_seek): Likewise.
    * mailbox/body.c (_body_seek): Likewise.
    * mailbox/file_stream.c (fd_seek): Likewise.
    * mailbox/filter_iconv.c (_icvt_seek): Likewise.
    * mailbox/fltstream.c (filter_seek): Likewise.
    * mailbox/header.c (header_seek): Likewise.
    * mailbox/mapfile_stream.c (_mapfile_seek): Likewise.
    * mailbox/memory_stream.c (_memory_seek): Likewise.
    * mailbox/message.c (_message_stream_seek): Likewise.
    * mailbox/message_stream.c (_message_stream_seek): Likewise.
    * mailbox/mime.c (_mime_body_seek): Likewise.
    * mailbox/stdio_stream.c (stdio_seek): Likewise.

commit 7262235cbe6dc9426ad6e37c5fe0f4b023b324a9
Author: Sergey Poznyakoff <address@hidden>
Date:   Sun May 2 13:57:06 2010 +0300

    Improve CRLF filter.
    
    * include/mailutils/filter.h (mu_filter_new_data_t): Change prototype.
    * mailbox/filter.c (mu_filter_create): Reflect the above.
    * mailbox/crlfflt.c (crlf_state): New enum.
    (_crlf_encoder): Keep state info in xd. Do not modify eventual input
    CRLFs.
    (alloc_state): New function.
    (_rfc822_filter,_crlf_filter): Provide the `newdata' method.

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

Summary of changes:
 .gitignore                              |    2 +
 Makefile.am                             |   53 ++++++++++++++++++++-----
 am/enable.m4                            |    6 ++-
 comsat/comsat.c                         |    2 +-
 config/mailutils-config.c               |    3 +-
 configure.ac                            |   51 +++++++++++++----------
 dotlock/dotlock.c                       |    3 +-
 examples/Makefile.am                    |   20 ++++++++-
 examples/base64.c                       |   18 ++++++--
 examples/muauth.c                       |    3 +-
 frm/frm.c                               |    3 +-
 frm/from.c                              |    3 +-
 guimb/main.c                            |    3 +-
 imap4d/imap4d.c                         |    2 +-
 include/mailutils/Makefile.am           |    2 +-
 include/mailutils/filter.h              |    2 +-
 include/mailutils/libargp.h             |    1 +
 include/mailutils/stream.h              |    3 +
 include/mailutils/sys/stream.h          |    2 +-
 libmu_argp/Makefile.am                  |    1 -
 libmu_argp/mu_argp.h                    |   46 ---------------------
 libmu_argp/muinit.c                     |   39 +++++++++++++++++-
 libproto/Makefile.am                    |   22 ++++++++++-
 maidag/maidag.c                         |    2 +-
 mail/decode.c                           |    1 -
 mail/mail.c                             |    2 +-
 mailbox/Makefile.am                     |    1 +
 mailbox/amd.c                           |   19 +--------
 mailbox/body.c                          |    6 +-
 mailbox/crlfflt.c                       |   60 ++++++++++++++++++++++------
 mailbox/file_stream.c                   |    4 +-
 mailbox/filter.c                        |    6 ++-
 mailbox/filter_iconv.c                  |    7 ++-
 mailbox/fltstream.c                     |   13 ++++--
 mailbox/header.c                        |   16 +-------
 mailbox/mapfile_stream.c                |   17 +-------
 mailbox/memory_stream.c                 |   17 +-------
 mailbox/message.c                       |   22 +----------
 mailbox/message_stream.c                |   17 +-------
 mailbox/mime.c                          |   15 +------
 mailbox/{stream_vprintf.c => nullrec.c} |   51 +++++++++++++----------
 mailbox/stdio_stream.c                  |   16 +-------
 mailbox/stream.c                        |   67 ++++++++++++++++++++++++++++++-
 mailbox/streamref.c                     |   23 +----------
 messages/messages.c                     |    3 +-
 mh/ali.c                                |    9 +----
 mh/anno.c                               |    9 +----
 mh/burst.c                              |    9 +----
 mh/comp.c                               |    9 +----
 mh/fmtcheck.c                           |    9 +----
 mh/folder.c                             |   10 +----
 mh/forw.c                               |   10 +----
 mh/inc.c                                |    9 +----
 mh/install-mh.c                         |    9 +----
 mh/mark.c                               |    9 +----
 mh/mh_argp.c                            |   45 ++++++++++++++++++++-
 mh/mh_getopt.h                          |    3 +-
 mh/mhl.c                                |    9 +----
 mh/mhn.c                                |    9 +----
 mh/mhparam.c                            |    9 +----
 mh/mhpath.c                             |    9 +----
 mh/pick.c                               |    9 +----
 mh/refile.c                             |    9 +----
 mh/repl.c                               |    9 +----
 mh/rmf.c                                |    9 +----
 mh/rmm.c                                |    9 +----
 mh/scan.c                               |   10 +----
 mh/send.c                               |    9 +----
 mh/sortm.c                              |   10 +----
 mh/whatnow.c                            |   10 +----
 mh/whom.c                               |   10 +----
 mimeview/mimeview.c                     |    3 +-
 movemail/movemail.c                     |    3 +-
 pop3d/pop3d.c                           |    2 +-
 pop3d/popauth.c                         |    8 +--
 readmsg/readmsg.c                       |    3 +-
 sieve/sieve.c                           |    4 +-
 77 files changed, 439 insertions(+), 529 deletions(-)
 delete mode 100644 libmu_argp/mu_argp.h
 copy mailbox/{stream_vprintf.c => nullrec.c} (54%)

diff --git a/.gitignore b/.gitignore
index 3f3f74e..a142bc9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,8 @@ config.h.in
 config.log
 config.status
 configure
+git-describe
+git-describe.h
 libtool
 m4
 pathdefs.h
diff --git a/Makefile.am b/Makefile.am
index f6f53a9..81aefd2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -85,11 +85,11 @@ if MU_COND_LIBMU_SCM
   LIBMU_SCM_DIR = libmu_scm
 endif
 
-if MU_COND_LIBMU_CPP
+if MU_COND_SUPPORT_CXX
   LIBMU_CPP_DIR = libmu_cpp
 endif
 
-SUBDIRS = \
+SUBDIRS = . \
  mu-aux\
  include\
  po\
@@ -124,8 +124,8 @@ SUBDIRS = \
  $(MOVEMAIL_DIR)\
  $(MIMEVIEW_DIR)
 
-EXTRA_DIST = COPYING.LESSER paths
-
+EXTRA_DIST = COPYING.LESSER paths git-describe git-describe.h
+BUILT_SOURCES = git-describe git-describe.h
 DISTCLEANFILES = pathdefs.h
 
 gen_start_date = "2008-12-08"
@@ -155,12 +155,45 @@ ChangeLog:
          mv cl-t ChangeLog;                                               \
        fi
 
-alpha:
-       $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"`
+.PHONY: git-describe
+git-describe:
+       $(AM_V_GEN)if test -d .git; then \
+               dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\
+               test -n "$$dirty" && dirty="-dirty"; \
+               descr=`git describe`; \
+               echo $${descr}$$dirty > git-describe; \
+       fi
 
-alphacheck:
-       $(MAKE) distcheck distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"`
+dist-hook: ChangeLog git-describe
+       @PATCHLEV=`echo "$(PACKAGE_VERSION)" | \
+                   sed -r "s/[0-9]+\.[0-9]+\.?//"`; \
+       if test $${PATCHLEV:-0} -lt 50; then \
+               if grep -q FIXME NEWS; then \
+                       echo >&2 "NEWS file contains FIXMEs"; \
+                       exit 1; \
+               fi; \
+       fi
+
+git-describe.h: git-describe
+       $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \
+         sed '1s/.*/#define GIT_DESCRIBE "&"/' $(srcdir)/git-describe; \
+       else \
+          echo "/* No git tag */"; \
+       fi > git-describe.h
+
+alpha: git-describe
+       $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \
+         tag=`head -n 1 $(srcdir)/git-describe`; \
+       else \
+         tag=`date +"%Y%m%d"`; \
+       fi; \
+       $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-$$tag
 
-rpm: dist
-       rpm -ta --clean mailutils-$(VERSION).tar.gz
+alphacheck:
+       $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \
+         tag=`head -n 1 $(srcdir)/git-describe`; \
+       else \
+         tag=`date +"%Y%m%d"`; \
+       fi; \
+       $(MAKE) distcheck distdir=$(PACKAGE)-$(VERSION)-$$tag
 
diff --git a/am/enable.m4 b/am/enable.m4
index faf3a31..e531c98 100644
--- a/am/enable.m4
+++ b/am/enable.m4
@@ -23,6 +23,7 @@ dnl                   [default-value])
 AC_DEFUN([MU_ENABLE_SUPPORT], [
        pushdef([mu_upcase],translit($1,[a-z+-],[A-ZX_]))
        pushdef([mu_cache_var],[mu_cv_enable_]translit($1,[+-],[x_]))
+       pushdef([mu_cond],[MU_COND_SUPPORT_]mu_upcase)
 
        AC_ARG_ENABLE($1, 
                      AC_HELP_STRING([--disable-]$1,
@@ -43,8 +44,11 @@ AC_DEFUN([MU_ENABLE_SUPPORT], [
        if test x"[$]mu_cache_var" = x"yes"; then
                AC_DEFINE([ENABLE_]mu_upcase,1,[Define this if you enable $1 
support])
         fi
-       popdef([mu_upcase])
+       AM_CONDITIONAL(mu_cond,
+                      [test x"[$]mu_cache_var" = x"yes" ifelse($4,,,[&& $4])])
+       popdef([mu_cond])
        popdef([mu_cache_var])
+       popdef([mu_upcase])
 ])
 
 dnl MU_ENABLE_BUILD(feature, [action-if-true], [action-if-false],
diff --git a/comsat/comsat.c b/comsat/comsat.c
index 82e8056..ca11efe 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -570,7 +570,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   comsat_init ();
   mu_acl_cfg_init ();
   mu_m_server_cfg_init ();
diff --git a/config/mailutils-config.c b/config/mailutils-config.c
index a5aeb4f..ccf55ab 100644
--- a/config/mailutils-config.c
+++ b/config/mailutils-config.c
@@ -25,7 +25,6 @@
 #include <mu_asprintf.h>
 #include "mailutils/libargp.h"
 
-const char *program_version = "mailutils-config (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU mailutils-config -- display compiler and loader 
options needed for building a program with mailutils.");
 static char args_doc[] = N_("[arg...]");
 
@@ -188,7 +187,7 @@ main (int argc, char **argv)
   mu_stream_t stream;
   int fmtflags = 0;
   
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
 
   mu_set_program_name (argv[0]);
   mu_libargp_init ();
diff --git a/configure.ac b/configure.ac
index ad31075..832b332 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,16 +40,16 @@ dnl Library paths
 AC_SUBST(MU_LIB_AUTH,'${top_builddir}/libmu_auth/libmu_auth.la')
 AC_SUBST(MU_LIB_MAILUTILS,'${top_builddir}/mailbox/libmailutils.la')
 AC_SUBST(MU_LIB_SQL,'${top_builddir}/sql/libsql.la')
-AC_SUBST(MU_LIB_IMAP,'${top_builddir}/libproto/imap/libmu_imap.la')
-AC_SUBST(MU_LIB_MAILDIR,'${top_builddir}/libproto/maildir/libmu_maildir.la')
+AC_SUBST(MU_LIB_IMAP)
+AC_SUBST(MU_LIB_MAILDIR)
 AC_SUBST(MU_LIB_MAILER,'${top_builddir}/libproto/mailer/libmu_mailer.la')
 AC_SUBST(MU_LIB_MBOX,'${top_builddir}/libproto/mbox/libmu_mbox.la')
-AC_SUBST(MU_LIB_MH,'${top_builddir}/libproto/mh/libmu_mh.la')
-AC_SUBST(MU_LIB_NNTP,'${top_builddir}/libproto/nntp/libmu_nntp.la')
-AC_SUBST(MU_LIB_POP,'${top_builddir}/libproto/pop/libmu_pop.la')
+AC_SUBST(MU_LIB_MH)
+AC_SUBST(MU_LIB_NNTP)
+AC_SUBST(MU_LIB_POP)
 AC_SUBST(MU_LIB_SIEVE,'${top_builddir}/libmu_sieve/libmu_sieve.la')
-AC_SUBST(MU_LIB_SCM,'${top_builddir}/libmu_scm/libmu_scm.la')
-AC_SUBST(MU_LIB_CPP,'${top_builddir}/libmu_cpp/libmu_cpp.la')
+AC_SUBST(MU_LIB_SCM)
+AC_SUBST(MU_LIB_CPP)
 AC_SUBST(MU_LIB_ARGP,'${top_builddir}/libmu_argp/libmu_argp.la')
 AC_SUBST(MU_LIB_PY)
 
@@ -815,9 +815,17 @@ AC_ARG_WITH([virtual-pwddir],
                *)  SITE_VIRTUAL_PWDDIR="\$(sysconfdir)/${withval}";;
             esac],
              [SITE_VIRTUAL_PWDDIR="\$(sysconfdir)/domain"])
-MU_ENABLE_SUPPORT(imap)
-MU_ENABLE_SUPPORT(pop)
-MU_ENABLE_SUPPORT(nntp)
+            
+MU_ENABLE_SUPPORT([imap],
+         [MU_LIB_IMAP='${top_builddir}/libproto/imap/libmu_imap.la'])
+MU_ENABLE_SUPPORT([pop],
+         [MU_LIB_POP='${top_builddir}/libproto/pop/libmu_pop.la'])
+MU_ENABLE_SUPPORT([nntp],
+         [MU_LIB_NNTP='${top_builddir}/libproto/nntp/libmu_nntp.la'])
+MU_ENABLE_SUPPORT([mh],
+         [MU_LIB_MH='${top_builddir}/libproto/mh/libmu_mh.la'])
+MU_ENABLE_SUPPORT([maildir],
+         [MU_LIB_MAILDIR='${top_builddir}/libproto/maildir/libmu_maildir.la'])
 
 AC_SUBST(MU_SMTP_PROGRAMS_BUILD)
 AC_SUBST(MU_SMTP_DEJATOOL)
@@ -829,9 +837,6 @@ MU_ENABLE_SUPPORT(sendmail)
 
 MU_ENABLE_SUPPORT(prog)
 
-MU_ENABLE_SUPPORT(mh)
-
-MU_ENABLE_SUPPORT(maildir)
 
 # FIXME: Should be --with-radius 
 MU_ENABLE_SUPPORT(radius,
@@ -1083,6 +1088,7 @@ if test "$useguile" != "no"; then
            [useguile=yes
             AC_DEFINE([WITH_GUILE],1,[Enable Guile support])
              GUILE_BINDIR=`guile-config info bindir`
+            MU_LIB_SCM='${top_builddir}/libmu_scm/libmu_scm.la'
              LIBMU_SCM=../libmu_scm/libmu_scm.la
              LIBMU_SCM_DEPS='${MU_LIB_MBOX} ${MU_LIB_IMAP} ${MU_LIB_POP} 
${MU_LIB_MH} ${MU_LIB_MAILDIR} ${MU_LIB_MAILER}'
              MU_GUILE_SIEVE_MOD_DIR='$(GUILE_SITE)/$(PACKAGE)/sieve-modules'
@@ -1103,14 +1109,14 @@ fi
 AC_SUBST(lisp_LISP)
 
 # Check for Python
-AC_ARG_WITH([python],
-            AC_HELP_STRING([--without-python],
-                           [do not build Python interface]),
-            [
-case "${withval}" in
+AC_ARG_ENABLE([python],
+              AC_HELP_STRING([--disable-python],
+                             [do not build Python interface]),
+              [
+case "${enableval}" in
   yes) status_python=yes ;;
   no)  status_python=no ;;
-  *)   AC_MSG_ERROR(bad value ${withval} for --without-python) ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
 esac],[status_python=yes])
 
 AC_SUBST(PYTHON_LIBS)
@@ -1150,8 +1156,8 @@ AM_CONDITIONAL([MU_COND_PYTHON], [test "$status_python" = 
yes])
 
 AC_SUBST(MU_CXX_EXAMPLES_BUILD)
 MU_ENABLE_SUPPORT(cxx,
-                 [MU_CXX_EXAMPLES_BUILD='$(MU_CXX_EXAMPLES_LIST)'])
-AM_CONDITIONAL([MU_COND_LIBMU_CPP], [test "$mu_cv_enable_cxx" = yes])
+                 [MU_CXX_EXAMPLES_BUILD='$(MU_CXX_EXAMPLES_LIST)'
+                   MU_LIB_CPP='${top_builddir}/libmu_cpp/libmu_cpp.la'])
 
 # Default mailbox record
 # Note: 1. Support for mbox type is always enabled.
@@ -1236,12 +1242,13 @@ case `echo $VERSION|sed  's/[[^.]]//g'` in
 "..")  if test `echo $VERSION | sed  's/.*\.//'` -lt 50; then
         RENDITION=DISTRIB
        else
+         AC_DEFINE_UNQUOTED([MU_ALPHA_RELEASE], 1,
+                           [Define if this is an alpha release])
          RENDITION=PROOF
        fi;;
 *)     RENDITION=PROOF;;
 esac
 
-
 AC_CONFIG_COMMANDS([status],[
 cat <<EOF
 
diff --git a/dotlock/dotlock.c b/dotlock/dotlock.c
index 6315b2d..d561d18 100644
--- a/dotlock/dotlock.c
+++ b/dotlock/dotlock.c
@@ -33,7 +33,6 @@
 
 #include "mailutils/libargp.h"
 
-const char *program_version = "GNU dotlock (" PACKAGE_STRING ")";
 static char doc[] =
 N_("GNU dotlock -- lock mail spool files.")
 "\v"
@@ -161,7 +160,7 @@ main (int argc, char *argv[])
 
   argp_err_exit_status = MU_DL_EX_ERROR;
   
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, dotlock_capa, dotlock_cfg_param, 
                   argc, argv, 0, NULL, NULL))
     exit (1);
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 1e189a1..1ba0b87 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -18,7 +18,19 @@
 ##   Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
 ##   02110-1301 USA
 
-SUBDIRS = config cpp python scheme
+if MU_COND_SUPPORT_POP
+  POP3CLIENT = pop3client
+endif
+
+if MU_COND_SUPPORT_NNTP
+  NNTPCLIENT = nntpclient
+endif
+
+if MU_COND_SUPPORT_CXX
+  CPP_DIR = cpp
+endif
+
+SUBDIRS = config $(CPP_DIR) python scheme
 
 noinst_PROGRAMS = \
  aclck\
@@ -40,11 +52,13 @@ noinst_PROGRAMS = \
  muauth\
  muemail\
  murun\
- nntpclient\
- pop3client \
+ $(NNTPCLIENT)\
+ $(POP3CLIENT)\
  sfrom\
  url-parse
 
+EXTRA_PROGRAMS = pop3client nntpclient
+
 ## NOTE: Numaddr must be an installable target, otherwise libtool
 ## will not create a shared library and `make check' will fail in
 ## sieve. Pity.
diff --git a/examples/base64.c b/examples/base64.c
index 26e8795..3785a6a 100644
--- a/examples/base64.c
+++ b/examples/base64.c
@@ -53,8 +53,9 @@ main (int argc, char * argv [])
   int flags = MU_STREAM_READ;
   char *input = NULL, *output = NULL;
   char *encoding = "base64";
-    
-  while ((c = getopt (argc, argv, "deE:hi:o:pvw")) != EOF)
+  mu_off_t shift = 0;
+  
+  while ((c = getopt (argc, argv, "deE:hi:o:ps:vw")) != EOF)
     switch (c)
       {
       case 'i':
@@ -80,6 +81,10 @@ main (int argc, char * argv [])
       case 'p':
        printable = 1; /* FIXME: Not implemented */
        break;
+
+      case 's':
+       shift = strtoul (optarg, NULL, 0); 
+       break;
        
       case 'v':
        verbose = 1;
@@ -98,7 +103,7 @@ main (int argc, char * argv [])
       }
 
   if (input)
-    MU_ASSERT (mu_file_stream_create (&in, input, MU_STREAM_READ));
+    MU_ASSERT (mu_file_stream_create (&in, input, 
MU_STREAM_READ|MU_STREAM_SEEK));
   else
     MU_ASSERT (mu_stdio_stream_create (&in, MU_STDIN_FD, 0));
   MU_ASSERT (mu_stream_open (in));
@@ -112,13 +117,18 @@ main (int argc, char * argv [])
 
   if (flags == MU_STREAM_READ)
     {
-      MU_ASSERT (mu_filter_create (&flt, in, encoding, mode, MU_STREAM_READ));
+      MU_ASSERT (mu_filter_create (&flt, in, encoding, mode,
+                                  MU_STREAM_READ|MU_STREAM_SEEK));
+      if (shift)
+       MU_ASSERT (mu_stream_seek (flt, shift, MU_SEEK_SET, NULL));
       c_copy (out, flt);
     }
   else
     {
       MU_ASSERT (mu_filter_create (&flt, out, encoding, mode,
                                   MU_STREAM_WRITE));
+      if (shift)
+       MU_ASSERT (mu_stream_seek (in, shift, MU_SEEK_SET, NULL));
       c_copy (flt, in);
     }
       
diff --git a/examples/muauth.c b/examples/muauth.c
index 23ba521..c771ebf 100644
--- a/examples/muauth.c
+++ b/examples/muauth.c
@@ -27,7 +27,6 @@
 #include <mailutils/mailutils.h>
 #include "mailutils/libargp.h"
 
-const char *program_version = "muauth (" PACKAGE_STRING ")";
 static char doc[] =
 "muauth -- test mailutils authentication and authorization schemes";
 static char args_doc[] = "key";
@@ -91,7 +90,7 @@ main (int argc, char * argv [])
   uid_t uid;
   
   MU_AUTH_REGISTER_ALL_MODULES ();
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, capa, NULL, argc, argv, 0, &index, NULL))
     exit (1);
 
diff --git a/frm/frm.c b/frm/frm.c
index b56bff2..f978560 100644
--- a/frm/frm.c
+++ b/frm/frm.c
@@ -31,7 +31,6 @@ static int align = 0;      /* Tidy mode. -t option. */
 #define IS_NEW  0x100
 static int select_attribute;
 
-const char *program_version = "frm (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU frm -- display From: lines.");
 
 static struct attr_tab {
@@ -358,7 +357,7 @@ main (int argc, char **argv)
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif
   
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, frm_argp_capa, NULL, argc, argv, 0, &c, NULL))
     exit (1);
 
diff --git a/frm/from.c b/frm/from.c
index 080b548..6b9fdf8 100644
--- a/frm/from.c
+++ b/frm/from.c
@@ -23,7 +23,6 @@ int count_only;
 char *sender_option;
 char *mailbox_name;
 
-const char *program_version = "from (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU from -- display from and subject.");
 
 static struct argp_option options[] = {
@@ -120,7 +119,7 @@ main (int argc, char **argv)
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif
 
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, capa, NULL, argc, argv, 0, &c, NULL))
     exit (1);
 
diff --git a/guimb/main.c b/guimb/main.c
index 460c6bd..f08d450 100644
--- a/guimb/main.c
+++ b/guimb/main.c
@@ -122,7 +122,6 @@ parse_opt (int key, char *arg, struct argp_state *state)
   return 0;
 }
 
-const char *program_version = "guimb (" PACKAGE_STRING ")";
 static char doc[] =
 N_("GNU guimb -- process contents of the specified mailboxes "
 "using a Scheme program or expression.");
@@ -161,7 +160,7 @@ main (int argc, char *argv[])
   /* Register the desired formats. */
   mu_register_all_formats ();
 
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, guimb_argp_capa, NULL, argc, argv, 0, &index, &c))
     exit (1);
 
diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c
index 195c4af..b180206 100644
--- a/imap4d/imap4d.c
+++ b/imap4d/imap4d.c
@@ -503,7 +503,7 @@ main (int argc, char **argv)
   mu_acl_cfg_init ();
   mu_m_server_cfg_init ();
   
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
 
   mu_m_server_create (&server, program_version);
   mu_m_server_set_conn (server, imap4d_connection);
diff --git a/include/mailutils/Makefile.am b/include/mailutils/Makefile.am
index d1261d2..098a9fa 100644
--- a/include/mailutils/Makefile.am
+++ b/include/mailutils/Makefile.am
@@ -98,7 +98,7 @@ pkginclude_HEADERS = \
  vartab.h\
  version.h
 
-if MU_COND_LIBMU_CPP
+if MU_COND_SUPPORT_CXX
   CPP_DIR = cpp
 endif
 
diff --git a/include/mailutils/filter.h b/include/mailutils/filter.h
index 01a80cd..03c43c2 100644
--- a/include/mailutils/filter.h
+++ b/include/mailutils/filter.h
@@ -60,7 +60,7 @@ enum mu_filter_result
     mu_filter_moreoutput,
   };
   
-typedef void *(*mu_filter_new_data_t) (void *);
+typedef int (*mu_filter_new_data_t) (void **, int, void *);
 typedef enum mu_filter_result (*mu_filter_xcode_t) (void *data,
                                                    enum mu_filter_command cmd,
                                                    struct mu_filter_io *iobuf);
diff --git a/include/mailutils/libargp.h b/include/mailutils/libargp.h
index e96df3a..c0317be 100644
--- a/include/mailutils/libargp.h
+++ b/include/mailutils/libargp.h
@@ -75,6 +75,7 @@ void mu_argp_init (const char *vers, const char *bugaddr);
 int mu_app_init (struct argp *myargp, const char **capa,
                 struct mu_cfg_param *cfg_param, 
                 int argc, char **argv, int flags, int *pindex, void *data);
+extern void mu_program_version_hook (FILE *stream, struct argp_state *state);
 
 error_t mu_argp_parse (const struct argp *myargp, 
                       int *pargc, char **pargv[],  
diff --git a/include/mailutils/stream.h b/include/mailutils/stream.h
index cdc55e7..1aee884 100644
--- a/include/mailutils/stream.h
+++ b/include/mailutils/stream.h
@@ -71,6 +71,9 @@ void mu_stream_clearerr (mu_stream_t stream);
 int mu_stream_eof (mu_stream_t stream);
 int mu_stream_seek (mu_stream_t stream, mu_off_t offset, int whence,
                    mu_off_t *pres);
+int mu_stream_skip_input_bytes (mu_stream_t stream, mu_off_t count,
+                               mu_off_t *pres);
+
 int mu_stream_set_buffer (mu_stream_t stream, enum mu_buffer_type type,
                          size_t size);
 int mu_stream_read (mu_stream_t stream, void *buf, size_t size, size_t *pread);
diff --git a/include/mailutils/sys/stream.h b/include/mailutils/sys/stream.h
index e63d60d..90de02f 100644
--- a/include/mailutils/sys/stream.h
+++ b/include/mailutils/sys/stream.h
@@ -47,7 +47,7 @@ struct _mu_stream
   int (*open) (struct _mu_stream *);
   int (*close) (struct _mu_stream *);
   void (*done) (struct _mu_stream *);
-  int (*seek) (struct _mu_stream *, mu_off_t, int, mu_off_t *);
+  int (*seek) (struct _mu_stream *, mu_off_t, mu_off_t *);
   int (*size) (struct _mu_stream *, mu_off_t *);
   int (*ctl) (struct _mu_stream *, int, void *);
   int (*wait) (struct _mu_stream *, int *, struct timeval *);
diff --git a/libmu_argp/Makefile.am b/libmu_argp/Makefile.am
index 3106f5c..87fd420 100644
--- a/libmu_argp/Makefile.am
+++ b/libmu_argp/Makefile.am
@@ -32,7 +32,6 @@ libmu_argp_a_SOURCES =\
  cmdline.h\
  common.c\
  compat.c\
- mu_argp.h\
  mu_argp.c\
  muinit.c\
  sieve.c\
diff --git a/libmu_argp/mu_argp.h b/libmu_argp/mu_argp.h
deleted file mode 100644
index 804f46c..0000000
--- a/libmu_argp/mu_argp.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* GNU Mailutils -- a suite of utilities for electronic mail
-   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009, 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, write to the
-   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301 USA */
-
-#ifndef _MAILUTILS_ARGP_H
-#define _MAILUTILS_ARGP_H
-
-#include <mailutils/types.h>
-#include <argp.h>
-#include <errno.h> /* May declare program_invocation_name */
-
-extern char *mu_license_text;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void mu_argp_init (struct argp *argp, const char *vers,
-                         const char *bugaddr, const char *capa[]);
-extern void mu_argp_done (struct argp *argp);
-  
-extern int mu_register_argp_capa (const char *name, struct argp_child *child);
-
-extern void mu_print_options (void);
-  
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/libmu_argp/muinit.c b/libmu_argp/muinit.c
index 6ed95d5..805fc30 100644
--- a/libmu_argp/muinit.c
+++ b/libmu_argp/muinit.c
@@ -25,13 +25,48 @@
 #include <mailutils/stream.h>
 #include "xalloc.h"
 #include <string.h>
-
+#ifdef MU_ALPHA_RELEASE
+# include <git-describe.h>
+#endif
 struct mu_cfg_tree *mu_argp_tree;
 
+const char version_etc_copyright[] =
+  /* Do *not* mark this string for translation.  %s is a copyright
+     symbol suitable for this locale, and %d is the copyright
+     year.  */
+  "Copyright %s 2010 Free Software Foundation, inc.";
+
+void
+mu_program_version_hook (FILE *stream, struct argp_state *state)
+{
+#ifdef GIT_DESCRIBE
+  fprintf (stream, "%s (%s) %s [%s]\n",
+          mu_program_name, PACKAGE_NAME, PACKAGE_VERSION, GIT_DESCRIBE);
+#else
+  fprintf (stream, "%s (%s) %s\n", mu_program_name,
+          PACKAGE_NAME, PACKAGE_VERSION);
+#endif
+  /* TRANSLATORS: Translate "(C)" to the copyright symbol
+     (C-in-a-circle), if this symbol is available in the user's
+     locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
+  fprintf (stream, version_etc_copyright, _("(C)"));
+
+  fputs (_("\
+\n\
+License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to 
change and redistribute it.\n\
+There is NO WARRANTY, to the extent permitted by law.\n\
+\n\
+"),
+        stream);
+}
+
 void
 mu_argp_init (const char *vers, const char *bugaddr)
 {
-  argp_program_version = vers ? vers : PACKAGE_STRING;
+  if (vers)
+    argp_program_version = vers;
+  else
+    argp_program_version_hook = mu_program_version_hook;
   argp_program_bug_address = bugaddr ? bugaddr : "<" PACKAGE_BUGREPORT ">";
 }
 
diff --git a/libproto/Makefile.am b/libproto/Makefile.am
index 314cfb7..30a423d 100644
--- a/libproto/Makefile.am
+++ b/libproto/Makefile.am
@@ -17,5 +17,25 @@
 ##   Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
 ##   02110-1301 USA
 
-SUBDIRS = include mbox pop nntp imap mh maildir mailer
+if MU_COND_SUPPORT_POP
+  POP_DIR = pop
+endif
+
+if MU_COND_SUPPORT_IMAP
+  IMAP_DIR = imap
+endif
+
+if MU_COND_SUPPORT_NNTP
+  NNTP_DIR = nntp
+endif
+
+if MU_COND_SUPPORT_MH
+  MH_DIR = mh
+endif
+
+if MU_COND_SUPPORT_MAILDIR
+  MAILDIR_DIR = maildir
+endif
+
+SUBDIRS = include mbox $(POP_DIR) $(NNTP_DIR) $(IMAP_DIR) $(MH_DIR) 
$(MAILDIR_DIR) mailer
 
diff --git a/maidag/maidag.c b/maidag/maidag.c
index ea04f07..894fa61 100644
--- a/maidag/maidag.c
+++ b/maidag/maidag.c
@@ -518,7 +518,7 @@ main (int argc, char *argv[])
   maidag_cfg_init ();
   
   /* Parse command line */
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
 
   mu_m_server_create (&server, program_version);
   mu_m_server_set_conn (server, lmtp_connection);
diff --git a/mail/decode.c b/mail/decode.c
index f0212cd..0acceaf 100644
--- a/mail/decode.c
+++ b/mail/decode.c
@@ -318,7 +318,6 @@ print_stream (mu_stream_t stream, FILE *out)
 {
   char buffer[512];
   size_t n = 0;
-  int rc;
   
   while (mu_stream_read (stream, buffer, sizeof (buffer) - 1, &n) == 0
         && n != 0)
diff --git a/mail/mail.c b/mail/mail.c
index afeb4e1..dba26a2 100644
--- a/mail/mail.c
+++ b/mail/mail.c
@@ -394,7 +394,7 @@ main (int argc, char **argv)
 #ifdef WITH_TLS
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, mail_capa, NULL, argc, argv, 0, NULL, &args))
     exit (1);
   
diff --git a/mailbox/Makefile.am b/mailbox/Makefile.am
index 1946fda..0d04930 100644
--- a/mailbox/Makefile.am
+++ b/mailbox/Makefile.am
@@ -114,6 +114,7 @@ libmailutils_la_SOURCES = \
  muerror.c\
  muerrno.c\
  nls.c\
+ nullrec.c\
  observer.c\
  opool.c\
  parse822.c\
diff --git a/mailbox/amd.c b/mailbox/amd.c
index d5ff6d5..450c7c0 100644
--- a/mailbox/amd.c
+++ b/mailbox/amd.c
@@ -122,7 +122,7 @@ static int amd_body_stream_readdelim (mu_stream_t is,
                                      int delim,
                                      size_t *pnread);
 static int amd_body_stream_size (mu_stream_t str, mu_off_t *psize);
-static int amd_body_stream_seek (mu_stream_t str, mu_off_t off, int whence,
+static int amd_body_stream_seek (mu_stream_t str, mu_off_t off, 
                                 mu_off_t *presult);
 
 struct _amd_body_stream
@@ -1703,27 +1703,12 @@ amd_body_stream_readdelim (mu_stream_t is, char 
*buffer, size_t buflen,
 }
 
 static int
-amd_body_stream_seek (mu_stream_t str, mu_off_t off, int whence,
-                     mu_off_t *presult)
+amd_body_stream_seek (mu_stream_t str, mu_off_t off, mu_off_t *presult)
 {
   size_t size;
   struct _amd_body_stream *amdstr = (struct _amd_body_stream *)str;
-  mu_message_t msg = mu_body_get_owner (amdstr->body);
   
   amd_body_size (amdstr->body, &size);
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      off += amdstr->off;
-      break;
-
-    case MU_SEEK_END:
-      off += size;
-      break;
-    }
 
   if (off < 0 || off >= size)
     return ESPIPE;
diff --git a/mailbox/body.c b/mailbox/body.c
index 01f14f0..8c5dba1 100644
--- a/mailbox/body.c
+++ b/mailbox/body.c
@@ -44,7 +44,7 @@ static int _body_truncate (mu_stream_t, mu_off_t);
 static int _body_size     (mu_stream_t, mu_off_t *);
 static int _body_write    (mu_stream_t, const char *, size_t, size_t *);
 static int _body_ioctl    (mu_stream_t, int, void *);
-static int _body_seek     (mu_stream_t, mu_off_t, int, mu_off_t *);
+static int _body_seek     (mu_stream_t, mu_off_t, mu_off_t *);
 static const char *_body_error_string (mu_stream_t, int);
 
 /* Our own defaults for the body.  */
@@ -281,11 +281,11 @@ mu_body_set_size (mu_body_t body, int (*_size)(mu_body_t, 
size_t*) , void *owner
 /* Stub function for the body stream.  */
 
 static int
-_body_seek (mu_stream_t stream, mu_off_t off, int whence, mu_off_t *presult)
+_body_seek (mu_stream_t stream, mu_off_t off, mu_off_t *presult)
 {
   struct _mu_body_stream *str = (struct _mu_body_stream*) stream;
   mu_body_t body = str->body;
-  return mu_stream_seek (body->fstream, off, whence, presult);
+  return mu_stream_seek (body->fstream, off, MU_SEEK_SET, presult);
 }
 
 static const char *
diff --git a/mailbox/crlfflt.c b/mailbox/crlfflt.c
index 3e9bab0..9dc147c 100644
--- a/mailbox/crlfflt.c
+++ b/mailbox/crlfflt.c
@@ -22,11 +22,16 @@
 #include <mailutils/errno.h>
 #include <mailutils/filter.h>
 
+enum crlf_state
+{
+  state_init,
+  state_cr
+};
+  
 /* Move min(isize,osize) bytes from iptr to optr, replacing each \n
-   with \r\n.  Store number of bytes written to optr in *pnbytes.
-   Return number of bytes read from iptr. */
+   with \r\n.  Any input \r\n sequences remain untouched. */
 static enum mu_filter_result
-_crlf_encoder (void *xd MU_ARG_UNUSED,
+_crlf_encoder (void *xd,
               enum mu_filter_command cmd,
               struct mu_filter_io *iobuf)
 {
@@ -35,10 +40,12 @@ _crlf_encoder (void *xd MU_ARG_UNUSED,
   size_t isize;
   char *optr;
   size_t osize;
-
+  enum crlf_state *state = xd;
+  
   switch (cmd)
     {
     case mu_filter_init:
+      *state = state_init;
     case mu_filter_done:
       return mu_filter_ok;
     default:
@@ -55,7 +62,12 @@ _crlf_encoder (void *xd MU_ARG_UNUSED,
       unsigned char c = *iptr++;
       if (c == '\n')
        {
-         if (j + 1 == osize)
+         if (*state == state_cr)
+           {
+             *state = state_init;
+             optr[j++] = c;
+           }
+         else if (j + 1 == osize)
            {
              if (i == 0)
                {
@@ -64,10 +76,17 @@ _crlf_encoder (void *xd MU_ARG_UNUSED,
                }
              break;
            }
-         optr[j++] = '\r';
-         optr[j++] = '\n';
+         else
+           {
+             optr[j++] = '\r';
+             optr[j++] = '\n';
+           }
+       }
+      else if (c == '\r')
+       {
+         *state = state_cr;
+         optr[j++] = c;
        }
-      /*else if (c == '\r')*/
       else
        optr[j++] = c;
     }
@@ -77,8 +96,7 @@ _crlf_encoder (void *xd MU_ARG_UNUSED,
 }
 
 /* Move min(isize,osize) bytes from iptr to optr, replacing each \r\n
-   with \n.  Store number of bytes written to optr in *pnbytes.
-   Return number of bytes read from iptr. */
+   with \n. */
 static enum mu_filter_result
 _crlf_decoder (void *xd MU_ARG_UNUSED,
               enum mu_filter_command cmd,
@@ -121,10 +139,28 @@ _crlf_decoder (void *xd MU_ARG_UNUSED,
   return mu_filter_ok;
 }
 
+static int
+alloc_state (void **pret, int mode, void *data MU_ARG_UNUSED)
+{
+  switch (mode)
+    {
+    case MU_FILTER_ENCODE:
+      *pret = malloc (sizeof (int));
+      if (!*pret)
+       return ENOMEM;
+      break;
+
+    case MU_FILTER_DECODE:
+      *pret = NULL;
+    }
+  return 0;
+}
+  
+
 static struct _mu_filter_record _crlf_filter = {
   "CRLF",
   0,
-  NULL,
+  alloc_state,
   _crlf_encoder,
   _crlf_decoder
 };
@@ -136,7 +172,7 @@ mu_filter_record_t mu_crlf_filter = &_crlf_filter;
 static struct _mu_filter_record _rfc822_filter = {
   "RFC822",
   0,
-  NULL,
+  alloc_state,
   _crlf_encoder,
   _crlf_decoder
 };
diff --git a/mailbox/file_stream.c b/mailbox/file_stream.c
index abf63ac..c97075f 100644
--- a/mailbox/file_stream.c
+++ b/mailbox/file_stream.c
@@ -148,10 +148,10 @@ fd_open (struct _mu_stream *str)
 }
 
 int
-fd_seek (struct _mu_stream *str, mu_off_t off, int whence, mu_off_t *presult)
+fd_seek (struct _mu_stream *str, mu_off_t off, mu_off_t *presult)
 { 
   struct _mu_file_stream *fstr = (struct _mu_file_stream *) str;
-  off = lseek (fstr->fd, off, whence);
+  off = lseek (fstr->fd, off, SEEK_SET);
   if (off < 0)
     return errno;
   *presult = off;
diff --git a/mailbox/filter.c b/mailbox/filter.c
index ddefb95..3a12b56 100644
--- a/mailbox/filter.c
+++ b/mailbox/filter.c
@@ -169,7 +169,11 @@ mu_filter_create (mu_stream_t *pstream, mu_stream_t 
stream, const char *name,
     return status;
 
   if (frec->newdata)
-    xdata = frec->newdata (NULL);
+    {
+      status = frec->newdata (&xdata, mode, NULL);
+      if (status)
+       return status;
+    }
 
   status = ((flags & MU_STREAM_WRITE) ? filter_create_wr : filter_create_rd)
                    (pstream, stream,
diff --git a/mailbox/filter_iconv.c b/mailbox/filter_iconv.c
index 802c35d..8d34285 100644
--- a/mailbox/filter_iconv.c
+++ b/mailbox/filter_iconv.c
@@ -415,11 +415,12 @@ _icvt_wait (mu_stream_t stream, int *pflags, struct 
timeval *tvp)
   return mu_stream_wait (s->transport, pflags, tvp);
 }
 
+/* FIXME: Seeks in the *transport* stream. */
 int
-_icvt_seek (mu_stream_t stream, mu_off_t off, int whence, mu_off_t *presult)
+_icvt_seek (mu_stream_t stream, mu_off_t off, mu_off_t *presult)
 {
   struct icvt_stream *s = (struct icvt_stream *)stream;
-  return mu_stream_seek (s->transport, off, whence, presult);
+  return mu_stream_seek (s->transport, off, MU_SEEK_SET, presult);
 }
 
 int
@@ -462,6 +463,6 @@ mu_filter_iconv_create (mu_stream_t *s, mu_stream_t 
transport,
   iptr->stream.ctl = _icvt_ioctl;
   iptr->stream.wait = _icvt_wait;
   iptr->stream.seek = _icvt_seek;
-  *s = iptr;
+  *s = (mu_stream_t)iptr;
   return 0;
 }
diff --git a/mailbox/fltstream.c b/mailbox/fltstream.c
index 858928b..99b5a47 100644
--- a/mailbox/fltstream.c
+++ b/mailbox/fltstream.c
@@ -314,11 +314,16 @@ filter_wr_flush (mu_stream_t stream)
 }
 
 static int
-filter_seek (struct _mu_stream *stream, mu_off_t off, int whence,
-            mu_off_t *ppos)
+filter_seek (struct _mu_stream *stream, mu_off_t off, mu_off_t *ppos)
 {
   struct _mu_filter_stream *fs = (struct _mu_filter_stream *)stream;
-  return mu_stream_seek (fs->transport, off, whence, ppos);
+  int status;
+
+  status = mu_stream_seek (fs->transport, 0, MU_SEEK_SET, NULL);
+  if (status)
+    return status;
+  stream->offset = 0;
+  return mu_stream_skip_input_bytes (stream, off, ppos);
 }
 
 static int
@@ -392,7 +397,7 @@ mu_filter_stream_create (mu_stream_t *pflt,
 
   if ((flags & MU_STREAM_RDWR) == MU_STREAM_RDWR
       || !(flags & MU_STREAM_RDWR)
-      || (flags & MU_STREAM_SEEK))
+      || (flags & (MU_STREAM_WRITE|MU_STREAM_SEEK)) == 
(MU_STREAM_WRITE|MU_STREAM_SEEK))
     return EINVAL;
  
   fs = (struct _mu_filter_stream *) _mu_stream_create (sizeof (*fs), flags);
diff --git a/mailbox/header.c b/mailbox/header.c
index 4ad57ec..9c8fb9f 100644
--- a/mailbox/header.c
+++ b/mailbox/header.c
@@ -931,24 +931,10 @@ mu_hdrent_unroll_fixup (mu_header_t hdr, struct mu_hdrent 
*ent)
 }
 
 int
-header_seek (mu_stream_t str, mu_off_t off, int whence, mu_off_t *presult)
+header_seek (mu_stream_t str, mu_off_t off, mu_off_t *presult)
 { 
   struct _mu_header_stream *hstr = (struct _mu_header_stream *) str;
 
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      off += hstr->off;
-      break;
-
-    case MU_SEEK_END:
-      off += hstr->hdr->size;
-      break;
-    }
-
   if (off < 0 || off > hstr->hdr->size)
     return ESPIPE;
   hstr->off = off;
diff --git a/mailbox/mapfile_stream.c b/mailbox/mapfile_stream.c
index a54c65c..94d3f52 100644
--- a/mailbox/mapfile_stream.c
+++ b/mailbox/mapfile_stream.c
@@ -312,25 +312,10 @@ _mapfile_open (mu_stream_t stream)
 }
 
 static int
-_mapfile_seek (struct _mu_stream *str, mu_off_t off, int whence, mu_off_t 
*presult)
+_mapfile_seek (struct _mu_stream *str, mu_off_t off, mu_off_t *presult)
 { 
   struct _mu_mapfile_stream *mfs = (struct _mu_mapfile_stream *) str;
   
-  /* FIXME */
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      off += mfs->offset;
-      break;
-
-    case MU_SEEK_END:
-      off += mfs->size;
-      break;
-    }
-
   if (off < 0 || off >= mfs->size)
     return ESPIPE;
   mfs->offset = off;
diff --git a/mailbox/memory_stream.c b/mailbox/memory_stream.c
index 8e93e7b..ecb091f 100644
--- a/mailbox/memory_stream.c
+++ b/mailbox/memory_stream.c
@@ -166,24 +166,9 @@ _memory_ioctl (struct _mu_stream *stream, int code, void 
*ptr)
 }
 
 static int
-_memory_seek (struct _mu_stream *stream, mu_off_t off, int whence,
-             mu_off_t *presult)
+_memory_seek (struct _mu_stream *stream, mu_off_t off, mu_off_t *presult)
 { 
   struct _mu_memory_stream *mfs = (struct _mu_memory_stream *) stream;
-  
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      off += mfs->offset;
-      break;
-
-    case MU_SEEK_END:
-      off += mfs->size;
-      break;
-    }
 
   if (off < 0)
     return ESPIPE;
diff --git a/mailbox/message.c b/mailbox/message.c
index 4f93fa3..8111b48 100644
--- a/mailbox/message.c
+++ b/mailbox/message.c
@@ -149,8 +149,7 @@ _message_stream_size (struct _mu_stream *str, mu_off_t 
*psize)
 }
 
 static int
-_message_stream_seek (struct _mu_stream *str, mu_off_t off, int whence,
-                     mu_off_t *ppos)
+_message_stream_seek (struct _mu_stream *str, mu_off_t off, mu_off_t *ppos)
 {
   struct _mu_message_stream *sp = (struct _mu_message_stream *)str;
   size_t hsize, size;
@@ -163,25 +162,6 @@ _message_stream_seek (struct _mu_stream *str, mu_off_t 
off, int whence,
   mu_body_size (sp->msg->body, &size);
   size += hsize;
   
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      {
-       mu_off_t cur;
-       rc = mu_stream_seek (sp->transport, 0, MU_SEEK_CUR, &cur);
-       if (rc)
-         return rc;
-       off += cur;
-      }
-      break;
-
-    case MU_SEEK_END:
-      off += size;
-      break;
-    }
   if (off < 0 || off >= size)
     return ESPIPE;
 
diff --git a/mailbox/message_stream.c b/mailbox/message_stream.c
index 6b3cb7d..cfcd2dd 100644
--- a/mailbox/message_stream.c
+++ b/mailbox/message_stream.c
@@ -303,27 +303,12 @@ _message_done (mu_stream_t stream)
 }
 
 static int
-_message_seek (struct _mu_stream *stream, mu_off_t off, int whence,
-              mu_off_t *presult)
+_message_seek (struct _mu_stream *stream, mu_off_t off, mu_off_t *presult)
 { 
   struct _mu_message_stream *s = (struct _mu_message_stream*) stream;
   mu_off_t size;
 
   mu_stream_size (stream, &size);
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      off += s->offset;
-      break;
-
-    case MU_SEEK_END:
-      off += size;
-      break;
-    }
-
   if (off < 0 || off >= size)
     return ESPIPE;
   s->offset = off;
diff --git a/mailbox/mime.c b/mailbox/mime.c
index b5db70c..f6f6d75 100644
--- a/mailbox/mime.c
+++ b/mailbox/mime.c
@@ -537,24 +537,11 @@ struct _mime_body_stream
 
 /* FIXME: The seek method is defective */
 static int
-_mime_body_seek (mu_stream_t stream, mu_off_t off, int whence,
-                mu_off_t *presult)
+_mime_body_seek (mu_stream_t stream, mu_off_t off, mu_off_t *presult)
 {
   struct _mime_body_stream *mstr = (struct _mime_body_stream *)stream;
   mu_mime_t mime = mstr->mime;
 
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      off += mime->cur_offset;
-
-    case MU_SEEK_END:
-      return ESPIPE;
-    }
-    
   if (off == 0)
     {                          /* reset message */
       mime->cur_offset = 0;
diff --git a/mailbox/stream_vprintf.c b/mailbox/nullrec.c
similarity index 54%
copy from mailbox/stream_vprintf.c
copy to mailbox/nullrec.c
index db0bff3..9d080cd 100644
--- a/mailbox/stream_vprintf.c
+++ b/mailbox/nullrec.c
@@ -1,5 +1,6 @@
 /* GNU Mailutils -- a suite of utilities for electronic mail
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2004, 
+   2005, 2006, 2007, 2008, 2009, 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
@@ -14,29 +15,35 @@
    You should have received a copy of the GNU Lesser General Public License
    along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>. */
 
+/* This file provides replacement definitions for mu_record_t defined
+   in those MU libraries which are disabled at configure time. */
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
-#include <mailutils/types.h>
-#include <mailutils/stream.h>
-#include <mailutils/io.h>
+
 #include <stdlib.h>
-#include <string.h>
-
-int
-mu_stream_vprintf (mu_stream_t str, const char *fmt, va_list ap)
-{
-  char *buf = NULL;
-  size_t buflen = 0;
-  size_t n;
-  int rc;
-
-  rc = mu_vasnprintf (&buf, &buflen, fmt, ap);
-  if (rc)
-    return rc;
-  n = strlen (buf);
-  rc = mu_stream_write (str, buf, n, NULL);
-  free (buf);
-  return rc == 0 ? n : -1;
-}
+#include <mailutils/types.h>
+#include <mailutils/registrar.h>
+
+#ifndef ENABLE_IMAP
+mu_record_t mu_imap_record = NULL;
+mu_record_t mu_imaps_record = NULL;
+#endif
+
+#ifndef ENABLE_POP
+mu_record_t mu_pop_record = NULL;
+mu_record_t mu_pops_record = NULL;
+#endif
+
+#ifndef ENABLE_NNTP
+mu_record_t mu_nntp_record = NULL;
+#endif
+
+#ifndef ENABLE_MH
+mu_record_t mu_mh_record = NULL;
+#endif
+
+#ifndef ENABLE_MAILDIR
+mu_record_t mu_maildir_record = NULL;
+#endif
 
diff --git a/mailbox/stdio_stream.c b/mailbox/stdio_stream.c
index dac196c..ae77d12 100644
--- a/mailbox/stdio_stream.c
+++ b/mailbox/stdio_stream.c
@@ -128,23 +128,9 @@ stdio_size (struct _mu_stream *str, off_t *psize)
 }
 
 static int
-stdio_seek (struct _mu_stream *str, mu_off_t off, int whence, mu_off_t 
*presult)
+stdio_seek (struct _mu_stream *str, mu_off_t off, mu_off_t *presult)
 { 
   struct _mu_stdio_stream *fs = (struct _mu_stdio_stream *) str;
-  /* FIXME */
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      off += fs->offset;
-      break;
-
-    case MU_SEEK_END:
-      off += fs->size;
-      break;
-    }
 
   if (off < 0)
     return ESPIPE;
diff --git a/mailbox/stream.c b/mailbox/stream.c
index 4e74caf..2bc2117 100644
--- a/mailbox/stream.c
+++ b/mailbox/stream.c
@@ -323,7 +323,7 @@ mu_stream_seek (mu_stream_t stream, mu_off_t offset, int 
whence,
     {
       if ((rc = _stream_flush_buffer (stream, 1)))
        return rc;
-      rc = stream->seek (stream, offset, MU_SEEK_SET, &stream->offset);
+      rc = stream->seek (stream, offset, &stream->offset);
       if (rc)
        return _stream_seterror (stream, rc, 1);
       _stream_cleareof (stream);
@@ -334,6 +334,71 @@ mu_stream_seek (mu_stream_t stream, mu_off_t offset, int 
whence,
   return 0;
 }
 
+/* Skip COUNT bytes from the current position in stream by reading from
+   it.  Return new offset in PRES.
+
+   Return 0 on success, EACCES if STREAM was not opened for reading.
+   Another non-zero exit codes are propagated from the underlying
+   input operations.
+   
+   This function is designed to help implement seek method in otherwise
+   unseekable streams (such as filters).  Do not use it if you absolutely
+   have to.  Using it on an unbuffered stream is a terrible waste of CPU. */
+int
+mu_stream_skip_input_bytes (mu_stream_t stream, mu_off_t count, mu_off_t *pres)
+{
+  mu_off_t pos;
+  int rc;
+
+  if (!(stream->flags & MU_STREAM_READ))
+    return _stream_seterror (stream, EACCES, 1);
+
+  if (stream->buftype == mu_buffer_none)
+    {
+      for (pos = 0; pos < count; pos++)
+       {
+         char c;
+         size_t nrd;
+         rc = mu_stream_read (stream, &c, 1, &nrd);
+         if (nrd == 0)
+           rc = ESPIPE;
+         if (rc)
+           break;
+       }
+    }
+  else
+    {
+      if ((rc = _stream_flush_buffer (stream, 1)))
+       return rc;
+      for (pos = 0;;)
+       {
+         if (stream->level == 0)
+           {
+             rc = _stream_fill_buffer (stream);
+             if (rc)
+               break;
+             if (stream->level == 0)
+               {
+                 rc = ESPIPE;
+                 break;
+               }
+           }
+         if (pos <= count && count < pos + stream->level)
+           {
+             rc = 0;
+             stream->cur = stream->buffer + count - pos;
+             pos = count;
+             break;
+           }
+       }
+    }
+  
+  stream->offset += pos;
+  if (pres)
+    *pres = stream->offset;
+  return rc;
+}
+
 int
 mu_stream_set_buffer (mu_stream_t stream, enum mu_buffer_type type,
                      size_t size)
diff --git a/mailbox/streamref.c b/mailbox/streamref.c
index de5fec8..4949a85 100644
--- a/mailbox/streamref.c
+++ b/mailbox/streamref.c
@@ -153,11 +153,9 @@ _streamref_done (struct _mu_stream *str)
 }
 
 static int
-_streamref_seek (struct _mu_stream *str, mu_off_t off, int whence,
-                mu_off_t *ppos)
+_streamref_seek (struct _mu_stream *str, mu_off_t off, mu_off_t *ppos)
 {
   struct _mu_streamref *sp = (struct _mu_streamref *)str;
-  mu_off_t cur = sp->offset - sp->start;
   mu_off_t size;
   int rc;
   
@@ -171,25 +169,6 @@ _streamref_seek (struct _mu_stream *str, mu_off_t off, int 
whence,
       size -= sp->start;
     }
   
-  switch (whence)
-    {
-    case MU_SEEK_SET:
-      break;
-
-    case MU_SEEK_CUR:
-      if (off == 0)
-       {
-         *ppos = sp->offset - sp->start;
-         return 0;
-       }
-      off += cur;
-      break;
-
-    case MU_SEEK_END:
-      off += size;
-      break;
-    }
-
   if (off < 0 || off >= size)
     return sp->stream.last_err = ESPIPE;
   rc = mu_stream_seek (sp->transport, sp->start + off, MU_SEEK_SET,
diff --git a/messages/messages.c b/messages/messages.c
index 292f59c..62c38b8 100644
--- a/messages/messages.c
+++ b/messages/messages.c
@@ -31,7 +31,6 @@
 
 static int messages_count (const char *);
 
-const char *program_version = "messages (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU messages -- count the number of messages in a 
mailbox");
 static char args_doc[] = N_("[mailbox...]");
 
@@ -112,7 +111,7 @@ main (int argc, char **argv)
 #ifdef WITH_TLS
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, argp_capa, NULL, argc, argv, 0, NULL, &args))
     exit (1);
 
diff --git a/mh/ali.c b/mh/ali.c
index 851ee1a..7c6964a 100644
--- a/mh/ali.c
+++ b/mh/ali.c
@@ -26,7 +26,6 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 
-const char *program_version = "ali (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH ali")"\v"
 N_("Options marked with `*' are not yet implemented.\n"
 "Use -help to obtain the list of traditional MH options.");
@@ -44,8 +43,6 @@ static struct argp_option options[] = {
    N_("try to determine the official hostname for each address") },
   {"user", ARG_USER, N_("BOOL"),  OPTION_ARG_OPTIONAL,
    N_("list the aliases that expand to given addresses") },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -69,10 +66,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
 {
   switch (key)
     {
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     case ARG_ALIAS:
       mh_alias_read (arg, 1);
       break;
@@ -195,7 +188,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/anno.c b/mh/anno.c
index 83119c3..d2870ff 100644
--- a/mh/anno.c
+++ b/mh/anno.c
@@ -21,7 +21,6 @@
 
 #include <mh.h>
 
-const char *program_version = "anno (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH anno")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -41,8 +40,6 @@ static struct argp_option options[] = {
    N_("add this FIELD to the message header") },
   {"text", ARG_TEXT, N_("STRING"), 0,
    N_("field value for the component") },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { NULL }
 };
 
@@ -92,10 +89,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       mh_quote (arg, &anno_text);
       break;
 
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -119,7 +112,7 @@ main (int argc, char **argv)
   
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/burst.c b/mh/burst.c
index 0647baa..670ea79 100644
--- a/mh/burst.c
+++ b/mh/burst.c
@@ -24,7 +24,6 @@
 #define obstack_chunk_free free
 #include <obstack.h>
 
-const char *program_version = "burst (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH burst")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -48,8 +47,6 @@ static struct argp_option options[] = {
   {"norecursive",  ARG_NORECURSIVE,  0, OPTION_HIDDEN, ""},
   {"length",       ARG_LENGTH,       N_("NUMBER"), 0,
    N_("set minimal length of digest encapsulation boundary (default 1)") },
-  {"license",      ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { NULL }
 };
 
@@ -93,10 +90,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
        eb_min_length = 1;
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     case ARG_VERBOSE:
       verbose = is_true (arg);
       break;
@@ -554,7 +547,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/comp.c b/mh/comp.c
index 3ac0a41..71095a6 100644
--- a/mh/comp.c
+++ b/mh/comp.c
@@ -23,7 +23,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-const char *program_version = "comp (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH comp")"\v"
 N_("Options marked with `*' are not yet implemented.\n"
 "Use -help to obtain the list of traditional MH options.");
@@ -56,8 +55,6 @@ static struct argp_option options[] = {
   {"use",           ARG_USE, N_("BOOL"), OPTION_ARG_OPTIONAL,
    N_("use draft file preserved after the last session") },
   {"nouse",         ARG_NOUSE, NULL, OPTION_HIDDEN, ""},
-  {"license",       ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -143,10 +140,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       argp_error (state, _("option is not yet implemented"));
       exit (1);
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -195,7 +188,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/fmtcheck.c b/mh/fmtcheck.c
index 3d50ae8..33c456a 100644
--- a/mh/fmtcheck.c
+++ b/mh/fmtcheck.c
@@ -21,7 +21,6 @@
 
 #include <mh.h>
 
-const char *program_version = "fmtcheck (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH fmtcheck")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = "";
@@ -36,8 +35,6 @@ static struct argp_option options[] = {
    N_("dump the listing of compiled format code")},
   { "debug",  ARG_DEBUG, NULL,     0,
     N_("enable parser debugging output"),},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
 
   { 0 }
 };
@@ -89,10 +86,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       mh_format_debug (1);
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -105,7 +98,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, NULL);
 
diff --git a/mh/folder.c b/mh/folder.c
index b13e373..c2baf4c 100644
--- a/mh/folder.c
+++ b/mh/folder.c
@@ -34,7 +34,6 @@
 #define obstack_chunk_free free
 #include <obstack.h>
 
-const char *program_version = "folder (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH folder")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[action] [msg]");
@@ -81,9 +80,6 @@ static struct argp_option options[] = {
   {"dry-run", ARG_DRY_RUN, NULL, 0,
    N_("do nothing, print what would be done (with --pack)"), 3},
    
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
-
   {NULL},
 };
 
@@ -225,10 +221,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       mh_set_current_folder (arg);
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     case ARG_VERBOSE:
       verbose++;
       break;
@@ -939,7 +931,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/forw.c b/mh/forw.c
index 8ec9fee..7fbaddb 100644
--- a/mh/forw.c
+++ b/mh/forw.c
@@ -21,7 +21,6 @@
 
 #include <mh.h>
 
-const char *program_version = "forw (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH forw")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -70,9 +69,6 @@ static struct argp_option options[] = {
    N_("use draft file preserved after the last session") },
   {"nouse",         ARG_NOUSE,         N_("BOOL"), OPTION_HIDDEN, "" },
 
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
-
   {NULL},
 };
 
@@ -209,10 +205,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       argp_error (state, _("option is not yet implemented"));
       exit (1);
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -426,7 +418,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/inc.c b/mh/inc.c
index 4dc9117..184a056 100644
--- a/mh/inc.c
+++ b/mh/inc.c
@@ -21,7 +21,6 @@
 
 #include <mh.h>
 
-const char *program_version = "inc (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH inc")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[+folder]");
@@ -50,8 +49,6 @@ static struct argp_option options[] = {
    N_("set output width")},
   {"quiet",   ARG_QUIET, 0,        0,
    N_("be quiet")},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -142,10 +139,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       quiet = 1;
       break;
 
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -181,7 +174,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, NULL);
 
diff --git a/mh/install-mh.c b/mh/install-mh.c
index fd88631..a563c5f 100644
--- a/mh/install-mh.c
+++ b/mh/install-mh.c
@@ -19,7 +19,6 @@
 
 #include <mh.h>
 
-const char *program_version = "install-mh (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH install-mh")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = "";
@@ -28,8 +27,6 @@ static char args_doc[] = "";
 static struct argp_option options[] = {
   {"auto",  ARG_AUTO, NULL, 0, N_("do not ask for anything")},
   {"compat", ARG_COMPAT, NULL, OPTION_HIDDEN, ""},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   {NULL}
 };
 
@@ -53,10 +50,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
     case ARG_COMPAT:
       break;
 
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -72,7 +65,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_auto_install = 0;
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, NULL);
diff --git a/mh/mark.c b/mh/mark.c
index f5c6cd3..5f67a63 100644
--- a/mh/mark.c
+++ b/mh/mark.c
@@ -19,7 +19,6 @@
 
 #include <mh.h>
 
-const char *program_version = "mark (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH mark")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = "[msgs...]";
@@ -42,8 +41,6 @@ static struct argp_option options[] = {
   {"zero", ARG_ZERO, N_("BOOL"), OPTION_ARG_OPTIONAL,
    N_("empty the sequence before adding messages")},
   {"nozero", ARG_NOZERO, NULL, OPTION_HIDDEN, "" },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   {NULL}
 };
 
@@ -116,10 +113,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       seq_flags &= ~SEQ_ZERO;
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -195,7 +188,7 @@ main (int argc, char **argv)
   mu_url_t url;
   
   MU_APP_INIT_NLS ();
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/mh_argp.c b/mh/mh_argp.c
index fa5e514..be7ed16 100644
--- a/mh/mh_argp.c
+++ b/mh/mh_argp.c
@@ -28,6 +28,9 @@
 #include <string.h>
 #include <mailutils/argcv.h>
 #include "argp.h"
+#ifdef MU_ALPHA_RELEASE
+# include <git-describe.h>
+#endif
 
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
@@ -93,11 +96,49 @@ my_argp_parse (struct argp *argp, int argc, char **argv, 
int flags,
   return rc;
 }
 
+const char version_etc_copyright[] =
+  /* Do *not* mark this string for translation.  %s is a copyright
+     symbol suitable for this locale, and %d is the copyright
+     year.  */
+  "Copyright %s 2010 Free Software Foundation, inc.";
+
+/* This is almost the same as mu_program_version_hook from muinit.c,
+   except for different formatting of the first line. MH uses:
+
+      progname (GNU Mailutils X.Y.Z)
+
+   where X.Y.Z stands for the version number. Emacs MH-E uses this
+   to determine Mailutils presence and its version number (see
+   lisp/mh-e/mh-e.el, function mh-variant-mu-mh-info). */
+static void
+mh_program_version_hook (FILE *stream, struct argp_state *state)
+{
+#ifdef GIT_DESCRIBE
+  fprintf (stream, "%s (%s %s) [%s]\n",
+          mu_program_name, PACKAGE_NAME, PACKAGE_VERSION, GIT_DESCRIBE);
+#else
+  fprintf (stream, "%s (%s %s)\n", mu_program_name,
+          PACKAGE_NAME, PACKAGE_VERSION);
+#endif
+  /* TRANSLATORS: Translate "(C)" to the copyright symbol
+     (C-in-a-circle), if this symbol is available in the user's
+     locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
+  fprintf (stream, version_etc_copyright, _("(C)"));
+
+  fputs (_("\
+\n\
+License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to 
change and redistribute it.\n\
+There is NO WARRANTY, to the extent permitted by law.\n\
+\n\
+"),
+        stream);
+}
+
 void
-mh_argp_init (const char *vers)
+mh_argp_init ()
 {
-  argp_program_version = vers ? vers : PACKAGE_STRING;
   argp_program_bug_address =  "<" PACKAGE_BUGREPORT ">";
+  argp_program_version_hook = mh_program_version_hook;
 }
 
 
diff --git a/mh/mh_getopt.h b/mh/mh_getopt.h
index bd26f83..767307f 100644
--- a/mh/mh_getopt.h
+++ b/mh/mh_getopt.h
@@ -89,7 +89,6 @@ enum mh_arg {
   ARG_INTERACTIVE,     
   ARG_LBRACE,          
   ARG_LENGTH,          
-  ARG_LICENSE,         
   ARG_LIMIT,           
   ARG_LINK,            
   ARG_LIST,            
@@ -184,7 +183,7 @@ enum mh_arg {
   ARG_ZERO
 };
 
-void mh_argp_init (const char *vers);
+void mh_argp_init (void);
 void mh_argv_preproc (int argc, char **argv, struct mh_argp_data *data);
 int mh_getopt (int argc, char **argv, struct mh_option *mh_opt, const char 
*doc);
 int mh_argp_parse (int *argc, char **argv[],
diff --git a/mh/mhl.c b/mh/mhl.c
index 999a3cb..6a7024d 100644
--- a/mh/mhl.c
+++ b/mh/mhl.c
@@ -23,7 +23,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-const char *program_version = "mhl (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH mhl")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[files]");
@@ -48,8 +47,6 @@ static struct argp_option options[] = {
    N_("use given PROG instead of the default") },
   {"nomoreproc", ARG_NOMOREPROC, NULL, 0,
    N_("disable use of moreproc program") },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { NULL }
 };
    
@@ -133,10 +130,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       nomoreproc = 1;
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -224,7 +217,7 @@ main (int argc, char **argv)
   interactive = isatty (1) && isatty (0);
   
   MU_APP_INIT_NLS ();
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/mhn.c b/mh/mhn.c
index 0824134..29fcd94 100644
--- a/mh/mhn.c
+++ b/mh/mhn.c
@@ -26,7 +26,6 @@
 #define obstack_chunk_free free
 #include <obstack.h>
 
-const char *program_version = "mhn (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH mhn")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -87,8 +86,6 @@ static struct argp_option options[] = {
   {"noverbose",    ARG_NOVERBOSE,   NULL, OPTION_HIDDEN, "", 41 },
   {"quiet",        ARG_QUIET, 0, 0,
    N_("be quiet")},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   {NULL}
 };
 
@@ -397,10 +394,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       mode_options |= OPT_QUIET;
       break;
        
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     case ARG_CHARSET:
       charset = arg;
       break;
@@ -2690,7 +2683,7 @@ main (int argc, char **argv)
   
   MU_APP_INIT_NLS ();
   
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/mhparam.c b/mh/mhparam.c
index 85a28b2..f9b7a23 100644
--- a/mh/mhparam.c
+++ b/mh/mhparam.c
@@ -21,7 +21,6 @@
 
 #include <mh.h>
 
-const char *program_version = "mhparam (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH mhparam")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[components]");
@@ -32,8 +31,6 @@ static struct argp_option options[] = {
    N_("display all components from the MH profile. All other arguments are 
ignored")},
   {"component", ARG_COMPONENT, N_("BOOL"),   OPTION_ARG_OPTIONAL,
    N_("always display the component name") },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -60,10 +57,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       display_comp_name = is_true (arg);
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -126,7 +119,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/mhpath.c b/mh/mhpath.c
index c222fc7..04d58f8 100644
--- a/mh/mhpath.c
+++ b/mh/mhpath.c
@@ -21,7 +21,6 @@
 
 #include <mh.h>
 
-const char *program_version = "mhpath (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH mhpath")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[+folder] [msgs]");
@@ -30,8 +29,6 @@ static char args_doc[] = N_("[+folder] [msgs]");
 static struct argp_option options[] = {
   {"folder",  ARG_FOLDER, N_("FOLDER"), 0,
    N_("specify folder to operate upon")},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -49,10 +46,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       mh_set_current_folder (arg);
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -83,7 +76,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/pick.c b/mh/pick.c
index e88aec0..51c1366 100644
--- a/mh/pick.c
+++ b/mh/pick.c
@@ -27,7 +27,6 @@
 #define obstack_chunk_free free
 #include <obstack.h>
 
-const char *program_version = "pick (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH pick")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -91,8 +90,6 @@ static struct argp_option options[] = {
   {"zero",     ARG_ZERO,     N_("BOOL"), OPTION_ARG_OPTIONAL,
    N_("empty the sequence before adding messages"), 4},
   {"nozero", ARG_NOZERO, NULL, OPTION_HIDDEN, "", 4 },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   {NULL},
 };
 
@@ -286,10 +283,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       pick_add_token (&lexlist, T_STRING, p);
       break;
 
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -349,7 +342,7 @@ main (int argc, char **argv)
 
   flags = mh_interactive_mode_p () ? 0 : ARGP_NO_ERRS;
   MU_APP_INIT_NLS ();
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, flags, options, mh_option,
                 args_doc, doc, opt_handler, NULL, &index);
   if (pick_parse (lexlist))
diff --git a/mh/refile.c b/mh/refile.c
index 9cade4c..8b5e82f 100644
--- a/mh/refile.c
+++ b/mh/refile.c
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <fcntl.h>
 
-const char *program_version = "refile (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH refile")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -47,8 +46,6 @@ static struct argp_option options[] = {
    N_("specify source folder; it will become the current folder after the 
program exits")},
   {"src", 0, NULL, OPTION_ALIAS, NULL},
   {"file", ARG_FILE, N_("FILE"), 0, N_("use FILE as the source message")},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -179,10 +176,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       source_file = arg;
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -232,7 +225,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/repl.c b/mh/repl.c
index de6a125..e17e237 100644
--- a/mh/repl.c
+++ b/mh/repl.c
@@ -24,7 +24,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-const char *program_version = "reply (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH repl")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -68,8 +67,6 @@ static struct argp_option options[] = {
   {"nowhatnowproc", ARG_NOWHATNOWPROC, NULL, 0,
    N_("* ignore whatnowproc variable; use standard `whatnow' shell instead")},
   {"use", ARG_USE, N_("BOOL"), OPTION_ARG_OPTIONAL, N_("use draft file 
preserved after the last session") },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -261,10 +258,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       argp_error (state, _("Option is not yet implemented"));
       exit (1);
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     case ARGP_KEY_FINI:
       if (!format_str)
        format_str = default_format_str;
@@ -406,7 +399,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
 
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
diff --git a/mh/rmf.c b/mh/rmf.c
index 3aa7c80..31fb44e 100644
--- a/mh/rmf.c
+++ b/mh/rmf.c
@@ -30,7 +30,6 @@
 
 #include <dirent.h>
 
-const char *program_version = "rmf (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH rmf")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[+folder]");
@@ -45,8 +44,6 @@ static struct argp_option options[] = {
   {"recursive", ARG_RECURSIVE, NULL, 0,
    N_("recursively delete all subfolders")},
   {"norecursive", ARG_NORECURSIVE, NULL, OPTION_HIDDEN, ""},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -90,10 +87,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       recurse = 0;
       break;
 
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -195,7 +188,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, NULL);
 
diff --git a/mh/rmm.c b/mh/rmm.c
index 68562d6..e82ac79 100644
--- a/mh/rmm.c
+++ b/mh/rmm.c
@@ -21,7 +21,6 @@
 
 #include <mh.h>
 
-const char *program_version = "rmm (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH rmm")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[+folder] [msgs]");
@@ -30,8 +29,6 @@ static char args_doc[] = N_("[+folder] [msgs]");
 static struct argp_option options[] = {
   {"folder",  ARG_FOLDER, N_("FOLDER"), 0,
    N_("specify folder to operate upon")},
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -49,10 +46,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       mh_set_current_folder (arg);
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -78,7 +71,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/scan.c b/mh/scan.c
index cdffca0..5c98a5f 100644
--- a/mh/scan.c
+++ b/mh/scan.c
@@ -28,7 +28,6 @@
 #include <time.h>
 #include <mailutils/observer.h>
 
-const char *program_version = "scan (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH scan")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[+folder] [msgs]");
@@ -54,9 +53,6 @@ static struct argp_option options[] = {
   {"file",    ARG_FILE, N_("FILE"),   0,
    N_("[not yet implemented]")},
   
-  {"license", ARG_LICENSE, 0,        0,
-   N_("display software license"), -1},
-
   { 0 }
 };
 
@@ -137,10 +133,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       argp_error (state, _("Option is not yet implemented"));
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-      
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -178,7 +170,7 @@ main (int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/send.c b/mh/send.c
index 8118d7f..22361b5 100644
--- a/mh/send.c
+++ b/mh/send.c
@@ -25,7 +25,6 @@
 #include <stdarg.h>
 #include <pwd.h>
 
-const char *program_version = "send (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH send")"\v"
 N_("Options marked with `*' are not yet implemented.\n\
 Use -help to obtain the list of traditional MH options.");
@@ -77,8 +76,6 @@ static struct argp_option options[] = {
   {"nowatch",       ARG_NOWATCH,       NULL, OPTION_HIDDEN, "" },
   {"width",         ARG_WIDTH,         N_("NUMBER"), 0,
    N_("* make header fields no longer than NUMBER columns") },
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
   { 0 }
 };
 
@@ -252,10 +249,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
        }
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -747,7 +740,7 @@ main (int argc, char **argv)
   
   MU_APP_INIT_NLS ();
   
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mh/sortm.c b/mh/sortm.c
index 68b95c3..cdea0bd 100644
--- a/mh/sortm.c
+++ b/mh/sortm.c
@@ -24,7 +24,6 @@
 #include <unistd.h>
 #include <signal.h>
 
-const char *program_version = "sortm (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH sortm")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = N_("[msgs]");
@@ -76,9 +75,6 @@ static struct argp_option options[] = {
   {"quicksort", ARG_QUICKSORT,  0, 0,
    N_("use quicksort algorithm (default)"), 40 },
 
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
-
   { NULL },
 };
 
@@ -191,10 +187,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       algorithm = key;
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -558,7 +550,7 @@ main (int argc, char **argv)
   mu_url_t url;
   
   MU_APP_INIT_NLS ();
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option,
                 args_doc, doc, opt_handler, NULL, &index);
   if (!oplist)
diff --git a/mh/whatnow.c b/mh/whatnow.c
index 7b3e666..3075d5a 100644
--- a/mh/whatnow.c
+++ b/mh/whatnow.c
@@ -20,7 +20,6 @@
 
 #include <mh.h>
 
-const char *program_version = "whatnow (" PACKAGE_STRING ")";
 static char doc[] = "GNU MH whatnow";
 static char args_doc[] = N_("[FILE]");
 
@@ -36,9 +35,6 @@ static struct argp_option options[] = {
   {"noedit", ARG_NOEDIT, 0, 0, N_("suppress the initial edit")},
   {"prompt", ARG_PROMPT, N_("STRING"), 0, N_("set the prompt")},
 
-  {"license", ARG_LICENSE, 0,      0,
-   N_("display software license"), -1},
-
   { NULL }
 };
 
@@ -91,10 +87,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       wh_env.prompt = arg;
       break;
       
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -108,7 +100,7 @@ main (int argc, char **argv)
   
   MU_APP_INIT_NLS ();
 
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
   argc -= index;
diff --git a/mh/whom.c b/mh/whom.c
index 893fe8e..9db8446 100644
--- a/mh/whom.c
+++ b/mh/whom.c
@@ -19,7 +19,6 @@
 
 #include <mh.h>
 
-const char *program_version = "whom (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU MH whom")"\v"
 N_("Use -help to obtain the list of traditional MH options.");
 static char args_doc[] = "[file]";
@@ -40,9 +39,6 @@ static struct argp_option options[] = {
    N_("check if addresses are deliverable") },
   {"nocheck",       ARG_NOCHECK,       NULL, OPTION_HIDDEN, "" },
 
-  {"license",       ARG_LICENSE,       0,    0,
-   N_("display software license"), -1},
-
   {NULL}
 };
 
@@ -96,10 +92,6 @@ opt_handler (int key, char *arg, struct argp_state *state)
       check_recipients = 0;
       break;
 
-    case ARG_LICENSE:
-      mh_license (argp_program_version);
-      break;
-
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -114,7 +106,7 @@ main (int argc, char **argv)
   
   MU_APP_INIT_NLS ();
   
-  mh_argp_init (program_version);
+  mh_argp_init ();
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, &index);
 
diff --git a/mimeview/mimeview.c b/mimeview/mimeview.c
index 6192ede..0c359cc 100644
--- a/mimeview/mimeview.c
+++ b/mimeview/mimeview.c
@@ -33,7 +33,6 @@
 
 #include "mailcap.h"
 
-const char *program_version = "mimeview (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU mimeview -- display files, using mailcap 
mechanism.")
 "\v"     
 N_("Default mime.types file is ") DEFAULT_CUPS_CONFDIR "/mime.types"
@@ -281,7 +280,7 @@ main (int argc, char **argv)
   int index;
   
   MU_APP_INIT_NLS ();
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, capa, mimeview_cfg_param, 
                   argc, argv, 0, &index, NULL))
     exit (1);
diff --git a/movemail/movemail.c b/movemail/movemail.c
index a385173..2004c7e 100644
--- a/movemail/movemail.c
+++ b/movemail/movemail.c
@@ -33,7 +33,6 @@
 #include "mailutils/libargp.h"
 #include <muaux.h>
 
-const char *program_version = "movemail (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU movemail -- move messages across mailboxes.");
 static char args_doc[] = N_("inbox-url destfile [POP-password]");
 
@@ -677,7 +676,7 @@ main (int argc, char **argv)
 #ifdef WITH_TLS
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, movemail_capa, movemail_cfg_param, 
                   argc, argv, 0, &index, NULL))
     exit (1);
diff --git a/pop3d/pop3d.c b/pop3d/pop3d.c
index d0e7b60..62c871b 100644
--- a/pop3d/pop3d.c
+++ b/pop3d/pop3d.c
@@ -338,7 +338,7 @@ main (int argc, char **argv)
   mu_acl_cfg_init ();
   mu_m_server_cfg_init ();
   
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
        
   mu_m_server_create (&server, program_version);
   mu_m_server_set_conn (server, pop3d_connection);
diff --git a/pop3d/popauth.c b/pop3d/popauth.c
index bc8c443..9f73d60 100644
--- a/pop3d/popauth.c
+++ b/pop3d/popauth.c
@@ -56,14 +56,11 @@ int (*ftab[]) (struct action_data *) = {
   action_chpass
 };
 
-const char *program_version = "popauth (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU popauth -- manage pop3 authentication database");
 static error_t popauth_parse_opt  (int key, char *arg,
                                   struct argp_state *astate);
 
 void popauth_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) =
-                                   popauth_version;
 
 static struct argp_option options[] = 
 {
@@ -202,7 +199,8 @@ main(int argc, char **argv)
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
+  argp_program_version_hook = popauth_version;
   if (mu_app_init (&argp, popauth_argp_capa, NULL,
                   argc, argv, 0, NULL, &adata))
     exit (EX_USAGE);
@@ -600,7 +598,7 @@ popauth_version (FILE *stream, struct argp_state *state)
 #elif defined(WITH_TOKYOCABINET)
 # define FORMAT "Tokyo Cabinet"
 #endif
-  printf ("%s\n", argp_program_version);
+  mu_program_version_hook (stream, state);
   printf (_("Database format: %s\n"), FORMAT);
   printf (_("Database location: %s\n"), APOP_PASSFILE);
   exit (EX_OK);
diff --git a/readmsg/readmsg.c b/readmsg/readmsg.c
index 0ea377e..52c7512 100644
--- a/readmsg/readmsg.c
+++ b/readmsg/readmsg.c
@@ -33,7 +33,6 @@ static void print_header (mu_message_t, int, int, char **);
 static void print_body (mu_message_t);
 static int  string_starts_with (const char * s1, const char *s2);
 
-const char *program_version = "readmsg (" PACKAGE_STRING ")";
 static char doc[] = N_("GNU readmsg -- print messages.");
 static error_t readmsg_parse_opt  (int key, char *arg, struct argp_state 
*astate);
 
@@ -301,7 +300,7 @@ main (int argc, char **argv)
 #ifdef WITH_TLS
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
   if (mu_app_init (&argp, readmsg_argp_capa, readmsg_cfg_param, 
                   argc, argv, 0, &index, NULL))
     exit (1);
diff --git a/sieve/sieve.c b/sieve/sieve.c
index 814be65..1e1d395 100644
--- a/sieve/sieve.c
+++ b/sieve/sieve.c
@@ -48,8 +48,6 @@
 
 #include "mailutils/libargp.h"
 
-const char *program_version = "sieve (" PACKAGE_STRING ")";
-
 static char doc[] =
 N_("GNU sieve -- a mail filtering tool.")
 "\v"
@@ -480,7 +478,7 @@ main (int argc, char *argv[])
   /* Native Language Support */
   MU_APP_INIT_NLS ();
 
-  mu_argp_init (program_version, NULL);
+  mu_argp_init (NULL, NULL);
 #ifdef WITH_TLS
   mu_gocs_register ("tls", mu_tls_module_init);
 #endif


hooks/post-receive
-- 
GNU Mailutils




reply via email to

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