-TDICT_PCRE_EXPAND_CONTEXT
-TDICT_PCRE_IF_RULE
-TDICT_PCRE_MATCH_RULE
+-TDICT_PCRE_PRESCAN_CONTEXT
-TDICT_PCRE_REGEXP
-TDICT_PCRE_RULE
-TDICT_REGEXP
postmap and postalias only) to remove some hurdles for
Michael Tokarev's CDB support. Files: global/mkmap*.[hc].
+20021105
+
+ Postalias now produces YP_LAST_MODIFIED and YP_MASTER_NAME
+ records only when NIS support is compiled in. File:
+ postalias.c.
+
+20021106
+
+ Postalias now puts $myhostname in the YP_MASTER_NAME record,
+ instead of the possibly bogus gethostname() result. File:
+ postalias.c.
+
+ The PCRE map code did not reject non-numeric replacement
+ indices in replacement text, and silently treated $text as
+ $0. Found by Michael Tokarev. File: dict_pcre.c.
+
Open problems:
Low: revise other local delivery agent duplicate filters.
Low: sendmail does not store null command-line recipients.
+ Low: sendmail, not cleanup, should extract recipients from
+ message headers.
+
Low: have a configurable list of errno values for mailbox
or maildir delivery that result in deferral rather than
bouncing mail.
postsuper - Postfix superintendent
<b>SYNOPSIS</b>
- <b>postsuper</b> [<b>-cpsv</b>] [<b>-d</b> <i>queue_id</i>] [<b>-h</b> <i>queue_id</i>] [<b>-H</b>
- <i>queue_id</i>] [<b>-r</b> <i>queue_id</i>] [<i>directory</i> <i>...</i>]
+ <b>postsuper</b> [<b>-psv</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>queue_id</i>] [<b>-h</b>
+ <i>queue_id</i>] [<b>-H</b> <i>queue_id</i>] [<b>-r</b> <i>queue_id</i>] [<i>directory</i> <i>...</i>]
<b>DESCRIPTION</b>
The <b>postsuper</b> command does maintenance jobs on the Postfix
.na
.nf
.fi
-\fBpostsuper\fR [\fB-cpsv\fR] [\fB-d \fIqueue_id\fR]
+\fBpostsuper\fR [\fB-psv\fR]
+[\fB-c \fIconfig_dir\fR] [\fB-d \fIqueue_id\fR]
[\fB-h \fIqueue_id\fR] [\fB-H \fIqueue_id\fR]
[\fB-r \fIqueue_id\fR] [\fIdirectory ...\fR]
.SH DESCRIPTION
* Patches change the patchlevel and the release date. Snapshots change the
* release date only, unless they include the same bugfix as a patch release.
*/
-#define MAIL_RELEASE_DATE "20021104"
+#define MAIL_RELEASE_DATE "20021106"
#define VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
#include <readlline.h>
#include <stringops.h>
#include <split_at.h>
-#include <get_hostname.h>
#include <vstring_vstream.h>
#include <set_eugid.h>
mkmap->dict->flags &= ~DICT_FLAG_TRY1NULL;
mkmap->dict->flags |= DICT_FLAG_TRY0NULL;
vstring_sprintf(value_buffer, "%010ld", (long) time((time_t *) 0));
+#if (defined(HAS_NIS) || defined(HAS_NISPLUS))
mkmap_append(mkmap, "YP_LAST_MODIFIED", STR(value_buffer));
- mkmap_append(mkmap, "YP_MASTER_NAME", get_hostname());
+ mkmap_append(mkmap, "YP_MASTER_NAME", var_myhostname);
+#endif
/*
* Close the alias database, and release the lock.
/* Postfix superintendent
/* SYNOPSIS
/* .fi
-/* \fBpostsuper\fR [\fB-cpsv\fR] [\fB-d \fIqueue_id\fR]
+/* \fBpostsuper\fR [\fB-psv\fR]
+/* [\fB-c \fIconfig_dir\fR] [\fB-d \fIqueue_id\fR]
/* [\fB-h \fIqueue_id\fR] [\fB-H \fIqueue_id\fR]
/* [\fB-r \fIqueue_id\fR] [\fIdirectory ...\fR]
/* DESCRIPTION
int matches; /* Count of cuts */
} DICT_PCRE_EXPAND_CONTEXT;
+ /*
+ * Context for $number pre-scan callback.
+ */
+typedef struct {
+ const char *mapname; /* name of regexp map */
+ int lineno; /* where in file */
+} DICT_PCRE_PRESCAN_CONTEXT;
+
/*
* Compatibility.
*/
return (1);
}
+/* dict_pcre_prescan - sanity check $number instances in replacement text */
+
+static int dict_pcre_prescan(int type, VSTRING *buf, char *context)
+{
+ DICT_PCRE_PRESCAN_CONTEXT *ctxt = (DICT_PCRE_PRESCAN_CONTEXT *) context;
+ size_t n;
+
+ if (type == MAC_PARSE_VARNAME) {
+ if (!alldig(vstring_str(buf))) {
+ msg_warn("pcre map %s, line %d: non-numeric replacement index \"%s\"",
+ ctxt->mapname, ctxt->lineno, vstring_str(buf));
+ return (MAC_PARSE_ERROR);
+ }
+ n = atoi(vstring_str(buf));
+ if (n < 1) {
+ msg_warn("pcre map %s, line %d: out of range replacement index \"%s\"",
+ ctxt->mapname, ctxt->lineno, vstring_str(buf));
+ return (MAC_PARSE_ERROR);
+ }
+ }
+ return (MAC_PARSE_OK);
+}
+
/* dict_pcre_compile - compile pattern */
static int dict_pcre_compile(const char *mapname, int lineno,
if (!ISALNUM(*p)) {
DICT_PCRE_REGEXP regexp;
DICT_PCRE_ENGINE engine;
+ DICT_PCRE_PRESCAN_CONTEXT prescan_context;
DICT_PCRE_MATCH_RULE *match_rule;
/*
msg_warn("%s, line %d: no replacement text: using empty string",
mapname, lineno);
+ /*
+ * Sanity check the $number instances in the replacement text.
+ */
+ prescan_context.mapname = mapname;
+ prescan_context.lineno = lineno;
+
+ if (mac_parse(p, dict_pcre_prescan, (char *) &prescan_context)
+ & MAC_PARSE_ERROR) {
+ msg_warn("pcre map %s, line %d: bad replacement syntax: "
+ "skipping this rule", mapname, lineno);
+ return (0);
+ }
+
/*
* Compile the pattern.
*/
}
if (nesting)
- msg_warn("pcre map %s, line %d: more IFs than ENDIFs",
- mapname, lineno);
+ msg_warn("pcre map %s, line %d: more IFs than ENDIFs",
+ mapname, lineno);
vstring_free(line_buffer);
vstream_fclose(map_fp);
return (0);
if (**p == '!') {
#if 0
- msg_warn("regexp file %s, line %d: /pattern1/!/pattern2/ goes away, "
- "use \"if !/pattern2/ ... /pattern1/ ... endif\" instead",
- mapname, lineno);
+ static int bitrot_warned = 0;
+
+ if (bitrot_warned == 0) {
+ msg_warn("regexp file %s, line %d: /pattern1/!/pattern2/ goes away,"
+ " use \"if !/pattern2/ ... /pattern1/ ... endif\" instead",
+ mapname, lineno);
+ bitrot_warned = 1;
+ }
#endif
if (dict_regexp_get_pat(mapname, lineno, p, second_pat) == 0)
return (0);
if (type == MAC_PARSE_VARNAME) {
if (!alldig(vstring_str(buf))) {
- msg_warn("regexp map %s, line %d: non-numeric replacement macro name \"%s\"",
+ msg_warn("regexp map %s, line %d: non-numeric replacement index \"%s\"",
ctxt->mapname, ctxt->lineno, vstring_str(buf));
return (MAC_PARSE_ERROR);
}