mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-22 18:07:41 +00:00
postfix-2.10-20121227
This commit is contained in:
parent
e3c22452c5
commit
d51bc76f05
@ -18185,9 +18185,16 @@ Apologies for any names omitted.
|
||||
|
||||
20121226
|
||||
|
||||
Miscellaneous cleanups of postconf internal APIs,
|
||||
identifiers and comments. No changes in behavior.
|
||||
Miscellaneous cleanups of postconf internal APIs, identifiers
|
||||
and comments. No changes in behavior.
|
||||
|
||||
Bugfix (omission in feature 20111203): the SMTP server
|
||||
Bugfix (omission in feature 20111203): the SMTP server only
|
||||
supported time-dependent address-verification sender addresses
|
||||
only with RCPT TO but not with MAIL FROM. File: smtpd/smtpd.c.
|
||||
with RCPT TO but not with MAIL FROM. File: smtpd/smtpd.c.
|
||||
|
||||
20121227
|
||||
|
||||
Feature: "postconf -o name=value" support to override main.cf
|
||||
settings (for example, "postconf -x -o stress=whatever"
|
||||
shows effective settings under overload). Files:
|
||||
postconf/postconf.c, postconf/postconf_main.c.
|
||||
|
@ -36,8 +36,8 @@ expanded parameter values.
|
||||
- "postconf -x" now expands $name in main.cf and master.cf parameter
|
||||
values.
|
||||
|
||||
- "postconf -Mn" now shows only master.cf entries with "-o name=value"
|
||||
parameter settings.
|
||||
- "postconf -Mn" now shows services that have "-o name=value"
|
||||
parameter settings in master.cf.
|
||||
|
||||
- postconf warns about attempts to modify a read-only parameter
|
||||
(process_name, process_id) in main.cf or master.cf.
|
||||
@ -46,6 +46,12 @@ expanded parameter values.
|
||||
main.cf or master.cf (except for backwards-compatibility parameters
|
||||
such as $virtual_maps).
|
||||
|
||||
Added with snapshot 20121227:
|
||||
|
||||
- "postconf -o name=value" overrides main.cf parameter settings.
|
||||
This can be used, for example, to examine stress-dependent settings
|
||||
with "postconf -x -o stress=yes".
|
||||
|
||||
Incompatible changes with snapshot 20121123
|
||||
===========================================
|
||||
|
||||
|
@ -11,6 +11,8 @@ Wish list:
|
||||
Don't forget Apple's code donation for fetching mail from
|
||||
IMAP server.
|
||||
|
||||
Should postconf -o refuse to work without the -x option?
|
||||
|
||||
Make errno white/blacklist for getpwnam_r etc. and mailbox
|
||||
write errors.
|
||||
|
||||
|
@ -12,8 +12,8 @@ POSTCONF(1) POSTCONF(1)
|
||||
<b>SYNOPSIS</b>
|
||||
<b>Managing <a href="postconf.5.html">main.cf</a>:</b>
|
||||
|
||||
<b>postconf</b> [<b>-dfhnvx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-C</b> <i>class,...</i>] [<i>parame-</i>
|
||||
<i>ter ...</i>]
|
||||
<b>postconf</b> [<b>-dfhnovx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-C</b> <i>class,...</i>] [<i>param-</i>
|
||||
<i>eter ...</i>]
|
||||
|
||||
<b>postconf</b> [<b>-ev</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>parameter=value ...</i>]
|
||||
|
||||
@ -21,7 +21,7 @@ POSTCONF(1) POSTCONF(1)
|
||||
|
||||
<b>Managing <a href="master.5.html">master.cf</a>:</b>
|
||||
|
||||
<b>postconf</b> [<b>-fMnvx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>service ...</i>]
|
||||
<b>postconf</b> [<b>-fMnovx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>service ...</i>]
|
||||
|
||||
<b>Managing bounce message templates:</b>
|
||||
|
||||
@ -115,7 +115,7 @@ POSTCONF(1) POSTCONF(1)
|
||||
for human readability (Postfix 2.9 and later).
|
||||
|
||||
<b>-e</b> Edit the <a href="postconf.5.html"><b>main.cf</b></a> configuration file, and update
|
||||
parameter settings with the "<i>name</i>=<i>value</i>" pairs on
|
||||
parameter settings with the "<i>name=value</i>" pairs on
|
||||
the <a href="postconf.1.html"><b>postconf</b>(1)</a> command line. The file is copied to
|
||||
a temporary file then renamed into place. Specify
|
||||
quotes to protect special characters and whitespace
|
||||
@ -295,12 +295,19 @@ POSTCONF(1) POSTCONF(1)
|
||||
This feature is available with Postfix 2.9 and
|
||||
later.
|
||||
|
||||
<b>-n</b> Print only <i>name</i>=<i>value</i> parameter settings that are
|
||||
explicitly specified in <a href="postconf.5.html"><b>main.cf</b></a>. When specified
|
||||
with <b>-M</b>, print only <a href="master.5.html"><b>master.cf</b></a> entries that have "-o
|
||||
<i>name</i>=<i>value</i>" parameter settings (Postfix 2.10 and
|
||||
later). Specify <b>-nf</b> to fold long lines for human
|
||||
readability (Postfix 2.9 and later).
|
||||
<b>-n</b> Show only configuration parameters that have
|
||||
explicit <i>name=value</i> settings in <a href="postconf.5.html"><b>main.cf</b></a>. When
|
||||
specified with <b>-M</b>, show only services that have
|
||||
explicit "-o <i>name=value</i>" settings in <a href="master.5.html"><b>master.cf</b></a>
|
||||
(Postfix 2.10 and later). Specify <b>-nf</b> to fold long
|
||||
lines for human readability (Postfix 2.9 and
|
||||
later).
|
||||
|
||||
<b>-o</b> <i>name=value</i>
|
||||
Override <a href="postconf.5.html"><b>main.cf</b></a> parameter settings.
|
||||
|
||||
This feature is available with Postfix 2.10 and
|
||||
later.
|
||||
|
||||
<b>-t</b> [<i>template</i><b>_</b><i>file</i>]
|
||||
Display the templates for text that appears at the
|
||||
@ -333,7 +340,7 @@ POSTCONF(1) POSTCONF(1)
|
||||
parameters named on the <a href="postconf.1.html"><b>postconf</b>(1)</a> command line.
|
||||
The file is copied to a temporary file then renamed
|
||||
into place. Specify a list of parameter names, not
|
||||
"<i>name</i>=<i>value</i>" pairs. There is no <a href="postconf.1.html"><b>postconf</b>(1)</a> com-
|
||||
"<i>name=value</i>" pairs. There is no <a href="postconf.1.html"><b>postconf</b>(1)</a> com-
|
||||
mand to perform the reverse operation.
|
||||
|
||||
This feature is available with Postfix 2.10 and
|
||||
@ -344,7 +351,7 @@ POSTCONF(1) POSTCONF(1)
|
||||
line, so that those parameters revert to their
|
||||
default values. The file is copied to a temporary
|
||||
file then renamed into place. Specify a list of
|
||||
parameter names, not "<i>name</i>=<i>value</i>" pairs. There is
|
||||
parameter names, not "<i>name=value</i>" pairs. There is
|
||||
no <a href="postconf.1.html"><b>postconf</b>(1)</a> command to perform the reverse oper-
|
||||
ation.
|
||||
|
||||
|
@ -11,7 +11,7 @@ Postfix configuration utility
|
||||
.fi
|
||||
\fBManaging main.cf:\fR
|
||||
|
||||
\fBpostconf\fR [\fB-dfhnvx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
\fBpostconf\fR [\fB-dfhnovx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
[\fB-C \fIclass,...\fR] [\fIparameter ...\fR]
|
||||
|
||||
\fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
|
||||
@ -22,7 +22,7 @@ Postfix configuration utility
|
||||
|
||||
\fBManaging master.cf:\fR
|
||||
|
||||
\fBpostconf\fR [\fB-fMnvx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
\fBpostconf\fR [\fB-fMnovx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
[\fIservice ...\fR]
|
||||
|
||||
\fBManaging bounce message templates:\fR
|
||||
@ -114,7 +114,7 @@ Specify \fB-df\fR to fold long lines for human readability
|
||||
(Postfix 2.9 and later).
|
||||
.IP \fB-e\fR
|
||||
Edit the \fBmain.cf\fR configuration file, and update
|
||||
parameter settings with the "\fIname\fR=\fIvalue\fR" pairs
|
||||
parameter settings with the "\fIname=value\fR" pairs
|
||||
on the \fBpostconf\fR(1) command line. The file is copied
|
||||
to a temporary file then renamed into place.
|
||||
Specify quotes to protect special characters and whitespace
|
||||
@ -259,13 +259,17 @@ or with a \fIservice-name.service-type\fR pair, where
|
||||
|
||||
This feature is available with Postfix 2.9 and later.
|
||||
.IP \fB-n\fR
|
||||
Print only \fIname\fR=\fIvalue\fR parameter settings that
|
||||
are explicitly specified in \fBmain.cf\fR. When specified
|
||||
with \fB-M\fR, print only \fBmaster.cf\fR entries that have
|
||||
"-o \fIname\fR=\fIvalue\fR" parameter settings (Postfix
|
||||
2.10 and later).
|
||||
Show only configuration parameters that have explicit
|
||||
\fIname=value\fR settings in \fBmain.cf\fR.
|
||||
When specified with \fB-M\fR, show only services that have
|
||||
explicit "-o \fIname=value\fR" settings in \fBmaster.cf\fR
|
||||
(Postfix 2.10 and later).
|
||||
Specify \fB-nf\fR to fold long lines for human readability
|
||||
(Postfix 2.9 and later).
|
||||
.IP "\fB-o \fIname=value\fR"
|
||||
Override \fBmain.cf\fR parameter settings.
|
||||
|
||||
This feature is available with Postfix 2.10 and later.
|
||||
.IP "\fB-t\fR [\fItemplate_file\fR]"
|
||||
Display the templates for text that appears at the beginning
|
||||
of delivery status notification (DSN) messages, without
|
||||
@ -294,7 +298,7 @@ Edit the \fBmain.cf\fR configuration file, and remove
|
||||
the parameters named on the \fBpostconf\fR(1) command line.
|
||||
The file is copied to a temporary file then renamed into
|
||||
place.
|
||||
Specify a list of parameter names, not "\fIname\fR=\fIvalue\fR"
|
||||
Specify a list of parameter names, not "\fIname=value\fR"
|
||||
pairs. There is no \fBpostconf\fR(1) command to perform
|
||||
the reverse operation.
|
||||
|
||||
@ -305,7 +309,7 @@ the parameters named on the \fBpostconf\fR(1) command line,
|
||||
so that those parameters revert to their default values.
|
||||
The file is copied to a temporary file then renamed into
|
||||
place.
|
||||
Specify a list of parameter names, not "\fIname\fR=\fIvalue\fR"
|
||||
Specify a list of parameter names, not "\fIname=value\fR"
|
||||
pairs. There is no \fBpostconf\fR(1) command to perform
|
||||
the reverse operation.
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
* Patches change both the patchlevel and the release date. Snapshots have no
|
||||
* patchlevel; they change the release date only.
|
||||
*/
|
||||
#define MAIL_RELEASE_DATE "20121226"
|
||||
#define MAIL_RELEASE_DATE "20121227"
|
||||
#define MAIL_VERSION_NUMBER "2.10"
|
||||
|
||||
#ifdef SNAPSHOT
|
||||
|
@ -7,7 +7,7 @@
|
||||
/* .fi
|
||||
/* \fBManaging main.cf:\fR
|
||||
/*
|
||||
/* \fBpostconf\fR [\fB-dfhnvx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
/* \fBpostconf\fR [\fB-dfhnovx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
/* [\fB-C \fIclass,...\fR] [\fIparameter ...\fR]
|
||||
/*
|
||||
/* \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
|
||||
@ -18,7 +18,7 @@
|
||||
/*
|
||||
/* \fBManaging master.cf:\fR
|
||||
/*
|
||||
/* \fBpostconf\fR [\fB-fMnvx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
/* \fBpostconf\fR [\fB-fMnovx\fR] [\fB-c \fIconfig_dir\fR]
|
||||
/* [\fIservice ...\fR]
|
||||
/*
|
||||
/* \fBManaging bounce message templates:\fR
|
||||
@ -108,7 +108,7 @@
|
||||
/* (Postfix 2.9 and later).
|
||||
/* .IP \fB-e\fR
|
||||
/* Edit the \fBmain.cf\fR configuration file, and update
|
||||
/* parameter settings with the "\fIname\fR=\fIvalue\fR" pairs
|
||||
/* parameter settings with the "\fIname=value\fR" pairs
|
||||
/* on the \fBpostconf\fR(1) command line. The file is copied
|
||||
/* to a temporary file then renamed into place.
|
||||
/* Specify quotes to protect special characters and whitespace
|
||||
@ -253,13 +253,17 @@
|
||||
/*
|
||||
/* This feature is available with Postfix 2.9 and later.
|
||||
/* .IP \fB-n\fR
|
||||
/* Print only \fIname\fR=\fIvalue\fR parameter settings that
|
||||
/* are explicitly specified in \fBmain.cf\fR. When specified
|
||||
/* with \fB-M\fR, print only \fBmaster.cf\fR entries that have
|
||||
/* "-o \fIname\fR=\fIvalue\fR" parameter settings (Postfix
|
||||
/* 2.10 and later).
|
||||
/* Show only configuration parameters that have explicit
|
||||
/* \fIname=value\fR settings in \fBmain.cf\fR.
|
||||
/* When specified with \fB-M\fR, show only services that have
|
||||
/* explicit "-o \fIname=value\fR" settings in \fBmaster.cf\fR
|
||||
/* (Postfix 2.10 and later).
|
||||
/* Specify \fB-nf\fR to fold long lines for human readability
|
||||
/* (Postfix 2.9 and later).
|
||||
/* .IP "\fB-o \fIname=value\fR"
|
||||
/* Override \fBmain.cf\fR parameter settings.
|
||||
/*
|
||||
/* This feature is available with Postfix 2.10 and later.
|
||||
/* .IP "\fB-t\fR [\fItemplate_file\fR]"
|
||||
/* Display the templates for text that appears at the beginning
|
||||
/* of delivery status notification (DSN) messages, without
|
||||
@ -288,7 +292,7 @@
|
||||
/* the parameters named on the \fBpostconf\fR(1) command line.
|
||||
/* The file is copied to a temporary file then renamed into
|
||||
/* place.
|
||||
/* Specify a list of parameter names, not "\fIname\fR=\fIvalue\fR"
|
||||
/* Specify a list of parameter names, not "\fIname=value\fR"
|
||||
/* pairs. There is no \fBpostconf\fR(1) command to perform
|
||||
/* the reverse operation.
|
||||
/*
|
||||
@ -299,7 +303,7 @@
|
||||
/* so that those parameters revert to their default values.
|
||||
/* The file is copied to a temporary file then renamed into
|
||||
/* place.
|
||||
/* Specify a list of parameter names, not "\fIname\fR=\fIvalue\fR"
|
||||
/* Specify a list of parameter names, not "\fIname=value\fR"
|
||||
/* pairs. There is no \fBpostconf\fR(1) command to perform
|
||||
/* the reverse operation.
|
||||
/*
|
||||
@ -367,6 +371,7 @@
|
||||
#include <stringops.h>
|
||||
#include <name_mask.h>
|
||||
#include <warn_stat.h>
|
||||
#include <mymalloc.h>
|
||||
|
||||
/* Global library. */
|
||||
|
||||
@ -409,6 +414,7 @@ int main(int argc, char **argv)
|
||||
"all", PC_PARAM_MASK_CLASS,
|
||||
0,
|
||||
};
|
||||
ARGV *override_params = 0;
|
||||
|
||||
/*
|
||||
* Fingerprint executables and core dumps.
|
||||
@ -438,7 +444,7 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
* Parse JCL.
|
||||
*/
|
||||
while ((ch = GETOPT(argc, argv, "aAbc:C:deEf#hlmMntvxX")) > 0) {
|
||||
while ((ch = GETOPT(argc, argv, "aAbc:C:deEf#hlmMno:tvxX")) > 0) {
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
cmd_mode |= SHOW_SASL_SERV;
|
||||
@ -469,11 +475,9 @@ int main(int argc, char **argv)
|
||||
case 'f':
|
||||
cmd_mode |= FOLD_LINE;
|
||||
break;
|
||||
|
||||
case '#':
|
||||
cmd_mode = COMMENT_OUT;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
cmd_mode &= ~SHOW_NAME;
|
||||
break;
|
||||
@ -489,6 +493,11 @@ int main(int argc, char **argv)
|
||||
case 'n':
|
||||
cmd_mode |= SHOW_NONDEF;
|
||||
break;
|
||||
case 'o':
|
||||
if (override_params == 0)
|
||||
override_params = argv_alloc(2);
|
||||
argv_add(override_params, optarg, (char *) 0);
|
||||
break;
|
||||
case 't':
|
||||
if (ext_argv)
|
||||
msg_fatal("specify one of -b and -t");
|
||||
@ -525,6 +534,8 @@ int main(int argc, char **argv)
|
||||
msg_fatal("do not specify -x with -a, -A, -b, -e, -#, -l, -m, or -X");
|
||||
if ((cmd_mode & SHOW_NONDEF) != 0 && junk != 0 && junk != SHOW_MASTER)
|
||||
msg_fatal("do not specify -n with -a, -A, -b, -d, -e, -#, -l, -m, or -X");
|
||||
if (override_params != 0 && junk != 0 && junk != SHOW_MASTER)
|
||||
msg_fatal("do not specify -o with -a, -A, -b, -d, -e, -#, -l, -m, or -X");
|
||||
|
||||
/*
|
||||
* Display bounce template information and exit.
|
||||
@ -568,6 +579,8 @@ int main(int argc, char **argv)
|
||||
else if (cmd_mode & SHOW_MASTER) {
|
||||
read_master(FAIL_ON_OPEN_ERROR);
|
||||
read_parameters();
|
||||
if (override_params)
|
||||
set_parameters(override_params->argv);
|
||||
register_builtin_parameters(basename(argv[0]), getpid());
|
||||
register_service_parameters();
|
||||
register_user_parameters();
|
||||
@ -599,6 +612,8 @@ int main(int argc, char **argv)
|
||||
else {
|
||||
if ((cmd_mode & SHOW_DEFS) == 0) {
|
||||
read_parameters();
|
||||
if (override_params)
|
||||
set_parameters(override_params->argv);
|
||||
}
|
||||
register_builtin_parameters(basename(argv[0]), getpid());
|
||||
|
||||
|
@ -141,7 +141,7 @@ extern void set_config_dir(void);
|
||||
* postconf_main.c
|
||||
*/
|
||||
extern void read_parameters(void);
|
||||
extern void set_parameters(void);
|
||||
extern void set_parameters(char **);
|
||||
extern void show_parameters(int, int, char **);
|
||||
|
||||
/*
|
||||
|
@ -15,6 +15,9 @@
|
||||
/* DESCRIPTION
|
||||
/* read_parameters() reads parameters from main.cf.
|
||||
/*
|
||||
/* set_parameters() takes an array of \fIname=value\fR pairs
|
||||
/* and overrides settings read with read_parameters().
|
||||
/*
|
||||
/* show_parameters() writes main.cf parameters to the standard
|
||||
/* output stream.
|
||||
/*
|
||||
@ -106,6 +109,23 @@ void read_parameters(void)
|
||||
myfree(path);
|
||||
}
|
||||
|
||||
/* set_parameters - add or override name=value pairs */
|
||||
|
||||
void set_parameters(char **name_val_array)
|
||||
{
|
||||
char *name, *value, *junk;
|
||||
const char *err;
|
||||
char **cpp;
|
||||
|
||||
for (cpp = name_val_array; *cpp; cpp++) {
|
||||
junk = mystrdup(*cpp);
|
||||
if ((err = split_nameval(junk, &name, &value)) != 0)
|
||||
msg_fatal("invalid parameter override: %s: %s", *cpp, err);
|
||||
mail_conf_update(name, value);
|
||||
myfree(junk);
|
||||
}
|
||||
}
|
||||
|
||||
/* print_line - show line possibly folded, and with normalized whitespace */
|
||||
|
||||
static void print_line(int mode, const char *fmt,...)
|
||||
|
Loading…
x
Reference in New Issue
Block a user