Commit 75072662 750726626abf132dd2e24ae352d165d6a5445dcb by Sergey Poznyakoff

* configure.ac: Define LOG_FACILITY_STRING, a string

representation of syslog facility.
* mailbox/cfg_lexer.l: Re-introduce pragmatic comment
#debug=, for setting debugging level in config module.
* mailbox/cfg_parser.y: Likewise.
* mailbox/gdebug.c (mu_debug_level_from_string): Ignore trailing
newline.
* mailbox/version.c (mu_conf_option): Add SYSCONFDIR, MAILSPOOLDIR
and LOG_FACILITY.

* mh/mh_init.c (mh_list_format): Reformat to make it more
readable. Use decode primitive on header fields that may be
encoded.

* doc/texinfo/mailutils.texi: Further update.
* doc/texinfo/programs.texi: Likewise.
1 parent e6135ba6
2008-09-22 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac: Define LOG_FACILITY_STRING, a string
representation of syslog facility.
* mailbox/cfg_lexer.l: Re-introduce pragmatic comment
#debug=, for setting debugging level in config module.
* mailbox/cfg_parser.y: Likewise.
* mailbox/gdebug.c (mu_debug_level_from_string): Ignore trailing
newline.
* mailbox/version.c (mu_conf_option): Add SYSCONFDIR, MAILSPOOLDIR
and LOG_FACILITY.
* mh/mh_init.c (mh_list_format): Reformat to make it more
readable. Use decode primitive on header fields that may be
encoded.
* doc/texinfo/mailutils.texi: Further update.
* doc/texinfo/programs.texi: Likewise.
2008-09-21 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac: Configure doc hints.
......
......@@ -296,7 +296,7 @@ esac])
if test "x$MU_CONF_MAILDIR" != x; then
AC_DEFINE_UNQUOTED(MU_CONF_MAILDIR,$MU_CONF_MAILDIR,
[Pathname of the configuration directory])
[Pathname of the mail spool directory])
fi
AH_BOTTOM([
#ifdef HAVE_PATHS_H
......@@ -363,7 +363,11 @@ AC_ARG_WITH([log-facility],
[AC_TRY_COMPILE([#include <syslog.h>], int lf = $withval,
log_facility=$withval)])
AC_DEFINE_UNQUOTED(LOG_FACILITY, $log_facility,
[Default syslog facility to use])
[Default syslog facility])
fstr=`echo "$log_facility" | tr A-Z a-z | sed 's/log_//'`
AC_DEFINE_UNQUOTED(LOG_FACILITY_STRING, "$fstr",
[String representation of the default syslog facility])
AC_MSG_RESULT($log_facility)
dnl Check for headers
......
......@@ -10,10 +10,18 @@
@include macros.texi
@include rendition.texi
@c Combine indices.
@c Define indices
@defcodeindex op
@defcodeindex fl
@c Same as ky, but used for configuration keywords.
@defcodeindex kw
@c Combine indices.
@syncodeindex op fn
@syncodeindex tp fn
@syncodeindex fl cp
@c FIXME: Should kw be separate?
@syncodeindex kw ky
@ifinfo
@dircategory Email
......
......@@ -41,6 +41,14 @@ void _mu_line_begin (void);
void _mu_line_add (char *text, size_t len);
char *_mu_line_finish (void);
extern void mu_cfg_set_debug (void);
static void
mu_cfg_set_lex_debug (void)
{
yy_flex_debug = mu_debug_check_level (mu_cfg_get_debug (),
MU_DEBUG_TRACE2);
}
static void _mu_line_add_unescape_last (char *text, size_t len);
static void multiline_begin (char *p);
static char *multiline_strip_tabs (char *text);
......@@ -72,6 +80,16 @@ P [1-9][0-9]*
<COMMENT>\n ++mu_cfg_locus.line;
<COMMENT>"*"+"/" BEGIN (INITIAL);
/* End-of-line comments */
#debug=.*\n {
mu_log_level_t lev;
mu_debug_t dbg = mu_cfg_get_debug ();
if (mu_debug_level_from_string (yytext + 7, &lev, dbg) == 0)
{
mu_debug_set_level (dbg, lev);
mu_cfg_set_debug ();
mu_cfg_set_lex_debug ();
}
}
#.*\n { mu_cfg_locus.line++; }
#.* /* end-of-file comment */;
"//".*\n { mu_cfg_locus.line++; }
......@@ -317,7 +335,7 @@ mu_get_config (const char *file, const char *progname,
if (flags & MU_PARSE_CONFIG_VERBOSE)
mu_error (_("Info: parsing file `%s'"), file);
yy_flex_debug = mu_debug_check_level (mu_cfg_get_debug (), MU_DEBUG_TRACE2);
mu_cfg_set_lex_debug ();
/* Parse configuration */
mu_cfg_locus.file = (char*) file;
......
......@@ -392,19 +392,25 @@ mu_cfg_get_debug ()
{
mu_debug_create (&_mu_cfg_debug, NULL);
mu_debug_set_print (_mu_cfg_debug, _cfg_default_printer, NULL);
mu_debug_set_level (_mu_cfg_debug, mu_global_debug_level ("config"));
}
mu_debug_set_level (_mu_cfg_debug, mu_global_debug_level ("config"));
return _mu_cfg_debug;
}
void
mu_cfg_set_debug ()
{
if (mu_debug_check_level (mu_cfg_get_debug (), MU_DEBUG_TRACE7))
yydebug = 1;
}
int
mu_cfg_parse (mu_cfg_tree_t **ptree)
{
int rc;
mu_cfg_tree_t *tree;
if (mu_debug_check_level (mu_cfg_get_debug (), MU_DEBUG_TRACE7))
yydebug = 1;
mu_cfg_set_debug ();
_mu_cfg_errcnt = 0;
rc = yyparse ();
......
......@@ -121,7 +121,9 @@ mu_debug_level_from_string (const char *string, mu_log_level_t *plev,
else
{
char *p = strdup (string);
size_t len = strlen (p);
if (len > 0 && p[len-1] == '\n')
p[len-1] = 0;
for (q = strtok (p, ","); q; q = strtok (NULL, ","))
{
int flag;
......
......@@ -45,6 +45,9 @@ char *mu_license_text =
static struct mu_conf_option mu_conf_option[] = {
{ "VERSION=" VERSION, N_("Version of this package") },
{ "SYSCONFDIR=" SYSCONFDIR, N_("System configuration directory") },
{ "MAILSPOOLDIR=" MU_PATH_MAILDIR, N_("Default mail spool directory") },
{ "LOG_FACILITY=" LOG_FACILITY_STRING, N_("Default syslog facility") },
#ifdef USE_LIBPAM
{ "USE_LIBPAM", N_("PAM support") },
#endif
......
......@@ -32,12 +32,14 @@
#include <fnmatch.h>
char mh_list_format[] =
"%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>"
"%02(mon{date})/%02(mday{date})"
"%<{date} %|*%>"
"%<(mymbox{from})%<{to}To:%14(friendly{to})%>%>"
"%<(zero)%17(friendly{from})%>"
" %{subject}%<{body}<<%{body}>>%>";
"%4(msg)"
"%<(cur)+%| %>"
"%<{replied}-%?{encrypted}E%| %>"
"%02(mon{date})/%02(mday{date})"
"%<{date} %|*%>"
"%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>"
"%<(zero)%17(decode(friendly{from}))%>"
" %(decode{subject})%<{body}<<%{body}>>%>";
void
mh_init ()
......