Commit b60a5698 b60a56980c2a728618f65aaa72a84b5c5d018938 by Sergey Poznyakoff Committed by Sergey Poznyakoff

Version 2.99.99

* configure.ac: Version 2.99.99
* NEWS: Update.
* libmu_argp/mailutils.c: New file.
* libmu_argp/Makefile.am: Add mailutils.c
* libmu_argp/cmdline.c (all_cmdline_capa): Add mu_mailutils_cmdline.
(mu_libargp_init): Register modflags function.
* libmu_argp/mu_argp.c (mu_build_argp): Retain negative group numbers.
(argp_capa): New member: modflags.
(mu_register_argp_capa): Take pointer to modflags function as 3rd
parameter.
(mu_build_argp): Use modflags member to alter argp flags.
(mu_argp_build): Take pointer to flags as its third argument.
* libmu_argp/muinit.c (mu_app_init): Pass pointer to flags to mu_argp_build.
* libmu_cfg/init.c (mu_libcfg_init): Silently ignore unknown groups

* include/mailutils/libargp.h (mu_mailutils_cmdline): New extern.
(mu_cmdline_capa): New member: modflags.
(mu_argp_build): Change signature.
(mu_register_argp_capa): Change signature.
* libmailutils/cfg/gocs.c (std_gocs_table): Add dummy entry for "mailutils"

* mu/Makefile.am (bin_PROGRAMS): Rename to "mailutils".
* mu/dispatch.c (dispatch_docstring): Use mu_program_name instead of
the hardcoded name.
* mu/mu.c: Use "mailutils" capability.
* mu/mailutils-config.in: Rename to mu/mailutils-config

* comsat/comsat.c: Use "mailutils" capability.
* dotlock/dotlock.c: Likewise.
* examples/muauth.c: Likewise.
* examples/muemail.c: Likewise.
* frm/frm.c: Likewise.
* frm/from.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.
1 parent df44a479
GNU mailutils NEWS -- history of user-visible changes. 2013-04-12
GNU mailutils NEWS -- history of user-visible changes. 2015-07-02
Copyright (C) 2002-2015 Free Software Foundation, Inc.
See the end of file for copying conditions.
Please send mailutils bug reports to <bug-mailutils@gnu.org>.
Version 2.99.98 (Git)
Version 2.99.99 (Git)
This version is a major rewrite of GNU Mailutils. Quite a few parts
of the basic framework were rewritten from scratch, while some others
......@@ -60,9 +60,9 @@ example, "gdbm:///etc/mail/aliases.db" refers to a GDBM database.
See <http://mailutils.org/wiki/libmu_dbm>.
** New utility `mu'
** New utility `mailutils'
`Mu' is a multi-purpose tool which can be of use to users, programmers
Multi-purpose tool which can be of use to users, programmers
and system administrators. It allows you to retrieve information
about Mailutils configuration, check ACLs and authentication tickets,
list, create or modify DBM files, construct filters of arbitrary
......@@ -100,7 +100,7 @@ pipes the message (or any part thereof) to it.
See <http://mailutils.org/wiki/Pipe>.
A similar test uses the program exit code to decide what to do with
the message
the message.
See <http://mailutils.org/wiki/Pipe_test>.
......@@ -252,7 +252,32 @@ the "mail" utility:
** The --with-mailbindir option
This option changes installation directory for the "mail" utility.
The following command will configure Mailutils to build only a
statically-linked copy of the "mail" utility and install it to
/bin:
./configure \
LDFLAGS=-static\
--enable-build-mail\
--with-mailbindir='/bin'\
--disable-shared\
--disable-virtual-domains\
--disable-python\
--disable-pam\
--disable-cxx\
--disable-build-servers\
--disable-build-clients\
--without-gsasl\
--without-tcp-wrappers\
--without-fribidi\
--without-mysql\
--without-postgres\
--without-odbc\
--without-ldap\
--without-guile\
--without-dbm
** DBM options
It is normally not needed to specify --with-gdbm, --with-berkeley-db
......
......@@ -89,6 +89,7 @@ static struct argp argp = {
};
static const char *comsat_argp_capa[] = {
"mailutils",
"common",
"debug",
"logging",
......
......@@ -16,7 +16,8 @@ dnl You should have received a copy of the GNU General Public License along
dnl with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.63)
AC_INIT([GNU Mailutils], [2.99.98], [bug-mailutils@gnu.org], [mailutils])
AC_INIT([GNU Mailutils], [2.99.99], [bug-mailutils@gnu.org], [mailutils],
[http://mailutils.org])
AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 dist-xz std-options silent-rules])
......
......@@ -134,6 +134,7 @@ struct mu_cfg_param dotlock_cfg_param[] = {
const char *dotlock_capa[] = {
"mailutils",
"common",
"debug",
NULL
......
......@@ -31,6 +31,7 @@ static char doc[] =
static char args_doc[] = "key";
static const char *capa[] = {
"mailutils",
"auth",
"common",
"debug",
......
......@@ -24,6 +24,7 @@
#include "mailutils/libargp.h"
const char *capa[] = {
"mailutils",
"address",
NULL
};
......
......@@ -201,6 +201,7 @@ static struct argp argp = {
};
static const char *frm_argp_capa[] = {
"mailutils",
"common",
"debug",
"mailbox",
......
......@@ -68,6 +68,7 @@ static struct argp argp = {
};
static const char *capa[] = {
"mailutils",
"common",
"debug",
"mailbox",
......
......@@ -89,6 +89,7 @@ static struct argp argp = {
};
static const char *imap4d_capa[] = {
"mailutils",
"auth",
"common",
"debug",
......
......@@ -39,12 +39,14 @@ struct mu_cmdline_capa
{
char *name;
struct argp_child *child;
void (*modflags) (int *);
};
extern int mu_help_config_mode;
extern int mu_rcfile_lint;
extern int (*mu_app_cfg_verifier) (void);
extern struct mu_cmdline_capa mu_mailutils_cmdline;
extern struct mu_cmdline_capa mu_common_cmdline;
extern struct mu_cmdline_capa mu_logging_cmdline;
extern struct mu_cmdline_capa mu_mailbox_cmdline;
......@@ -62,10 +64,12 @@ extern struct mu_cmdline_capa mu_virtdomain_cmdline;
extern void mu_libargp_init (void);
extern struct argp *mu_argp_build (const struct argp *argp, char ***pcapa);
extern struct argp *mu_argp_build (const struct argp *argp, char ***pcapa,
int *flags);
extern void mu_argp_done (struct argp *argp);
extern int mu_register_argp_capa (const char *name, struct argp_child *child);
extern int mu_register_argp_capa (const char *name, struct argp_child *child,
void (*modflags) (int*));
void mu_argp_init (const char *vers, const char *bugaddr);
int mu_app_init (struct argp *myargp, const char **capa,
......
......@@ -285,6 +285,7 @@ find_init_function (struct mu_gocs_entry *tab, const char *capa)
}
static struct mu_gocs_entry std_gocs_table[] = {
{ "mailutils", mu_gocs_dummy },
{ "common", mu_gocs_dummy },
{ "mailbox", mu_gocs_mailbox_init },
{ "locking", mu_gocs_locking_init },
......
......@@ -29,6 +29,7 @@ libmu_argp_la_SOURCES =\
cmdline.c\
cmdline.h\
common.c\
mailutils.c\
mu_argp.c\
muinit.c\
sieve.c
......
......@@ -22,6 +22,7 @@
#include "cmdline.h"
static struct mu_cmdline_capa *all_cmdline_capa[] = {
&mu_mailutils_cmdline,
&mu_common_cmdline,
&mu_logging_cmdline,
&mu_mailer_cmdline,
......@@ -42,7 +43,7 @@ mu_libargp_init ()
for (cpp = all_cmdline_capa; *cpp; cpp++)
{
struct mu_cmdline_capa *cp = *cpp;
if (mu_register_argp_capa (cp->name, cp->child))
if (mu_register_argp_capa (cp->name, cp->child, cp->modflags))
{
mu_error (_("INTERNAL ERROR: cannot register argp capability `%s'"),
cp->name);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2007-2012, 2014-2015 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 "cmdline.h"
#include <unistd.h>
#include <stdlib.h>
/* ************************************************************************* */
/* GNU Mailutils help and version output */
/* ************************************************************************* */
#define OPT_PROGNAME -2
#define OPT_USAGE -3
#define OPT_HANG -4
static struct argp_option mu_mailutils_argp_options[] =
{
{"help", '?', 0, 0, N_("give this help list"), -1},
{"usage", OPT_USAGE, 0, 0, N_("give a short usage message"), 0},
{"version", 'V', 0, 0, N_("print program version"), -1},
{"program-name",OPT_PROGNAME,N_("NAME"), OPTION_HIDDEN, N_("set the program name"), 0},
{"HANG", OPT_HANG, N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
N_("hang for SECS seconds (default 3600)"), 0},
{ NULL }
};
static error_t
mu_mailutils_argp_parser (int key, char *arg, struct argp_state *state)
{
switch (key)
{
case '?':
argp_state_help (state, state->out_stream,
ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_DOC);
/* TRANSLATORS: The placeholder indicates the bug-reporting address
for this package. Please add _another line_ saying
"Report translation bugs to <...>\n" with the address for translation
bugs (typically your translation team's web or email address). */
printf (_("\nReport bugs to: %s\n"), "<" PACKAGE_BUGREPORT ">");
#ifdef PACKAGE_PACKAGER_BUG_REPORTS
printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
PACKAGE_PACKAGER_BUG_REPORTS);
#endif
#ifdef PACKAGE_URL
printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
#endif
fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"),
stdout);
exit (0);
case OPT_USAGE:
argp_state_help (state, state->out_stream,
ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
break;
case 'V':
if (argp_program_version_hook)
(*argp_program_version_hook) (state->out_stream, state);
else if (argp_program_version)
fprintf (state->out_stream, "%s\n", argp_program_version);
else
argp_error (state, "%s",
dgettext (state->root_argp->argp_domain,
"(PROGRAM ERROR) No version known!?"));
exit(0);
case OPT_PROGNAME: /* Set the program name. */
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
program_invocation_name = arg;
#endif
/* Update what we use for messages. */
state->name = __argp_base_name (arg);
#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
program_invocation_short_name = state->name;
#endif
if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS))
== ARGP_PARSE_ARGV0)
/* Update what getopt uses too. */
state->argv[0] = arg;
break;
case OPT_HANG:
{
int hang = atoi (arg ? arg : "3600");
while (hang-- > 0)
sleep (1);
break;
}
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
struct argp mu_mailutils_argp = {
mu_mailutils_argp_options,
mu_mailutils_argp_parser,
};
struct argp_child mu_mailutils_argp_child = {
&mu_mailutils_argp,
0,
NULL,
-1,
};
static void
mu_mailutils_modflags(int *flags)
{
*flags |= ARGP_NO_HELP;
}
struct mu_cmdline_capa mu_mailutils_cmdline = {
"mailutils", &mu_mailutils_argp_child, mu_mailutils_modflags
};
......@@ -41,12 +41,14 @@
struct argp_capa {
char *capability;
struct argp_child *child;
void (*modflags)(int*);
} mu_argp_capa[MU_MAX_CAPA] = {
{NULL,}
};
int
mu_register_argp_capa (const char *name, struct argp_child *child)
mu_register_argp_capa (const char *name, struct argp_child *child,
void (*modflags)(int*))
{
int i;
......@@ -56,6 +58,7 @@ mu_register_argp_capa (const char *name, struct argp_child *child)
if ((mu_argp_capa[i].capability = strdup (name)) == NULL)
return ENOMEM;
mu_argp_capa[i].child = child;
mu_argp_capa[i].modflags = modflags;
return 0;
}
return 1;
......@@ -72,7 +75,7 @@ find_capa (const char *name)
}
static struct argp *
mu_build_argp (const struct argp *template, char **capa)
mu_build_argp (const struct argp *template, char **capa, int *flags)
{
int n;
int nchild;
......@@ -115,9 +118,17 @@ mu_build_argp (const struct argp *template, char **capa)
struct argp_capa *cp = find_capa (capa[n]);
if (cp)
{
ap[nchild] = *cp->child;
ap[nchild].group = group++;
nchild++;
if (cp->modflags)
cp->modflags (flags);
if (cp->child)
{
ap[nchild] = *cp->child;
if (ap[nchild].group < 0)
ap[nchild].group = 0;
else
ap[nchild].group = group++;
nchild++;
}
}
}
ap[nchild].argp = NULL;
......@@ -191,7 +202,7 @@ argp_reg_action (void *item, void *data)
}
struct argp *
mu_argp_build (const struct argp *init_argp, char ***pcapa)
mu_argp_build (const struct argp *init_argp, char ***pcapa, int *flags)
{
struct cap_buf cb;
struct argp *argp;
......@@ -200,7 +211,7 @@ mu_argp_build (const struct argp *init_argp, char ***pcapa)
mu_gocs_enumerate (argp_reg_action, &cb);
cap_buf_add (&cb, NULL);
mu_libargp_init ();
argp = mu_build_argp (init_argp, cb.capa);
argp = mu_build_argp (init_argp, cb.capa, flags);
if (pcapa)
*pcapa = cb.capa;
else
......
......@@ -35,7 +35,7 @@ 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 2007-2014 Free Software Foundation, inc.";
"Copyright %s 2007-2015 Free Software Foundation, inc.";
void
mu_program_version_hook (FILE *stream, struct argp_state *state)
......@@ -116,7 +116,7 @@ mu_app_init (struct argp *myargp, const char **capa,
mu_gocs_register_std (capa[i]); /*FIXME*/
if (!myargp)
myargp = &argpnull;
argp = mu_argp_build (myargp, &excapa);
argp = mu_argp_build (myargp, &excapa, &flags);
mu_cfg_tree_create (&mu_argp_tree);
rc = argp_parse (argp, argc, argv, flags, pindex, data);
......
......@@ -210,3 +210,4 @@ static struct mu_cfg_param mu_debug_param[] = {
};
DCL_CFG_CAPA (debug);
......
......@@ -90,12 +90,14 @@ mu_libcfg_init (char **cnames)
if (!reserved_name (cnames[i]))
{
struct mu_cfg_capa *cp = find_cfg_capa (cnames[i]);
if (!cp)
mu_error (_("unknown configuration group requested `%s'"),
cnames[i]);
else
if (cp)
mu_config_root_register_section (NULL, cp->name, NULL,
cp->parser, cp->cfgparam);
#if 0
else
mu_error (_("unknown configuration group requested `%s'"),
cnames[i]);
#endif
}
}
}
......
......@@ -133,6 +133,7 @@ static struct argp argp = {
};
static const char *maidag_argp_capa[] = {
"mailutils",
"auth",
"common",
"debug",
......
......@@ -229,6 +229,7 @@ static struct argp argp = {
};
static const char *mail_capa[] = {
"mailutils",
"common",
"debug",
"mailbox",
......
......@@ -42,6 +42,7 @@ static struct argp_option options[] = {
};
static const char *argp_capa[] = {
"mailutils",
"common",
"debug",
"mailbox",
......
......@@ -176,6 +176,7 @@ struct mu_cfg_param mimeview_cfg_param[] = {
static const char *capa[] = {
"mailutils",
"common",
"debug",
NULL
......
......@@ -409,6 +409,7 @@ struct mu_cfg_param movemail_cfg_param[] = {
static const char *movemail_capa[] = {
"mailutils",
"common",
"debug",
"locking",
......
mu
mailutils
mu-setup.c
mu-setup.h
mailutils-config
......
......@@ -15,18 +15,9 @@
## You should have received a copy of the GNU General Public License
## along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
bin_PROGRAMS = mu
bin_PROGRAMS = mailutils
bin_SCRIPTS = mailutils-config
CLEANFILES=mailutils-config
mailutils-config: $(top_srcdir)/mu/mailutils-config.in
$(AM_V_GEN)muname=mu; \
test -n "$(transform)" && \
muname=`echo $$muname | \
sed -e 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
sed 's/MUNAME/'$$muname'/g' $(top_srcdir)/mu/mailutils-config.in > mailutils-config
IDLE_MODULES=
if MU_COND_SUPPORT_POP
......@@ -71,7 +62,7 @@ MODULES = \
$(SMTP_C)\
wicket.c
mu_SOURCES = \
mailutils_SOURCES = \
dispatch.c\
getans.c\
getarg.c\
......@@ -83,7 +74,7 @@ mu_SOURCES = \
verbose.c\
$(MODULES)
mu_LDADD = \
mailutils_LDADD = \
${MU_APP_LIBRARIES}\
${MU_LIB_MBOX}\
${MU_LIB_IMAP}\
......@@ -110,12 +101,12 @@ AM_CPPFLAGS = \
-DDBMLIBS="\"$(DBMLIBS)\""
BUILT_SOURCES=mu-setup.c mu-setup.h
EXTRA_DIST=mu-setup.awk mu-setup.c mu-setup.h template.c mailutils-config.in
EXTRA_DIST=mu-setup.awk mu-setup.c mu-setup.h template.c mailutils-config
mu-setup.h: Makefile.am $(MODULES) $(IDLE_MODULES)
$(AM_V_GEN)$(AWK) -f $(top_srcdir)/mu/mu-setup.awk -v mode=h \
$(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=h \
$(MODULES) $(IDLE_MODULES) > mu-setup.h
mu-setup.c: Makefile.am $(MODULES)
$(AM_V_GEN)$(AWK) -f $(top_srcdir)/mu/mu-setup.awk -v mode=c \
$(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=c \
$(MODULES) $(IDLE_MODULES) > mu-setup.c
......
......@@ -21,6 +21,7 @@
#include <string.h>
#include <mailutils/alloc.h>
#include <mailutils/stream.h>
#include <mailutils/stdstream.h>
#include <mailutils/nls.h>
#include "mu.h"
#include "mu-setup.h"
......@@ -60,11 +61,13 @@ dispatch_docstring (const char *text)
mu_memory_stream_create (&str, MU_STREAM_RDWR);
mu_stream_printf (str, "%s\n%s\n\n", text, _("Commands are:"));
for (p = mutool_action_tab; p->name; p++)
mu_stream_printf (str, " mu %-16s - %s\n",
mu_stream_printf (str, " %s %-16s - %s\n",
mu_program_name,
p->name, gettext (p->docstring));
mu_stream_printf (str, "\n%s\n\n",
_("Try `mu COMMAND --help' to get help on a particular "
"COMMAND."));
mu_stream_printf (str,
_("\nTry `%s COMMAND --help' to get help on a particular "
"COMMAND.\n\n"),
mu_program_name);
mu_stream_printf (str, "%s\n", _("Options are:"));
mu_stream_flush (str);
mu_stream_size (str, &size);
......
......@@ -23,7 +23,7 @@
mode=
file=
dir=`expr "$0" : '\(.*\)/.*'`
muname=MUNAME
muname=mailutils
test -n "$dir" && PATH=$PATH:$dir
......@@ -94,7 +94,7 @@ do
usage
;;
-V|--version|--versio|--versi|--vers|--ver|--ve|--v)
$muname --version | sed -n '1{s/^MUNAME/mailutils-config/;s/(\(GNU Mailutils\)) \([0-9][0-9.]*\).*/(\1 \2)/;p}'
$muname --version | sed -n '1{s/^mailutils/mailutils-config/;s/(\(GNU Mailutils\)) \([0-9][0-9.]*\).*/(\1 \2)/;p}'
exit 0
;;
*)
......
......@@ -25,7 +25,7 @@
#include "mu.h"
static char args_doc[] = N_("COMMAND [CMDOPTS]");
static char doc[] = N_("mu -- GNU Mailutils multi-purpose tool.");
static char doc[] = N_("GNU Mailutils multi-purpose tool.");
static struct argp_option options[] = {
{ NULL }
......@@ -52,7 +52,7 @@ mu_help_filter (int key, const char *text, void *input)
case ARGP_KEY_HELP_PRE_DOC:
s = dispatch_docstring (text);
break;
default:
s = (char*) text;
}
......@@ -71,6 +71,7 @@ static struct argp argp = {
};
static const char *mu_tool_capa[] = {
"mailutils",
"common",
"debug",
"locking",
......
......@@ -281,6 +281,7 @@ static struct argp argp = {
};
static const char *pop3d_argp_capa[] = {
"mailutils",
"auth",
"common",
"debug",
......
......@@ -96,6 +96,7 @@ static struct argp argp = {
};
static const char *popauth_argp_capa[] = {
"mailutils",
"common",
NULL
};
......
......@@ -57,6 +57,7 @@ static struct argp argp = {
};
static const char *readmsg_argp_capa[] = {
"mailutils",
"common",
"debug",
"mailbox",
......
......@@ -309,6 +309,7 @@ static struct mu_cfg_param sieve_cfg_param[] = {
static const char *sieve_argp_capa[] =
{
"mailutils",
"common",
"debug",
"mailbox",
......