mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-23 10:28:06 +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
|
20121226
|
||||||
|
|
||||||
Miscellaneous cleanups of postconf internal APIs,
|
Miscellaneous cleanups of postconf internal APIs, identifiers
|
||||||
identifiers and comments. No changes in behavior.
|
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
|
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
|
- "postconf -x" now expands $name in main.cf and master.cf parameter
|
||||||
values.
|
values.
|
||||||
|
|
||||||
- "postconf -Mn" now shows only master.cf entries with "-o name=value"
|
- "postconf -Mn" now shows services that have "-o name=value"
|
||||||
parameter settings.
|
parameter settings in master.cf.
|
||||||
|
|
||||||
- postconf warns about attempts to modify a read-only parameter
|
- postconf warns about attempts to modify a read-only parameter
|
||||||
(process_name, process_id) in main.cf or master.cf.
|
(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
|
main.cf or master.cf (except for backwards-compatibility parameters
|
||||||
such as $virtual_maps).
|
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
|
Incompatible changes with snapshot 20121123
|
||||||
===========================================
|
===========================================
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ Wish list:
|
|||||||
Don't forget Apple's code donation for fetching mail from
|
Don't forget Apple's code donation for fetching mail from
|
||||||
IMAP server.
|
IMAP server.
|
||||||
|
|
||||||
|
Should postconf -o refuse to work without the -x option?
|
||||||
|
|
||||||
Make errno white/blacklist for getpwnam_r etc. and mailbox
|
Make errno white/blacklist for getpwnam_r etc. and mailbox
|
||||||
write errors.
|
write errors.
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ POSTCONF(1) POSTCONF(1)
|
|||||||
<b>SYNOPSIS</b>
|
<b>SYNOPSIS</b>
|
||||||
<b>Managing <a href="postconf.5.html">main.cf</a>:</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>
|
<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>ter ...</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>]
|
<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>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>
|
<b>Managing bounce message templates:</b>
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ POSTCONF(1) POSTCONF(1)
|
|||||||
for human readability (Postfix 2.9 and later).
|
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
|
<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
|
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 temporary file then renamed into place. Specify
|
||||||
quotes to protect special characters and whitespace
|
quotes to protect special characters and whitespace
|
||||||
@ -295,12 +295,19 @@ POSTCONF(1) POSTCONF(1)
|
|||||||
This feature is available with Postfix 2.9 and
|
This feature is available with Postfix 2.9 and
|
||||||
later.
|
later.
|
||||||
|
|
||||||
<b>-n</b> Print only <i>name</i>=<i>value</i> parameter settings that are
|
<b>-n</b> Show only configuration parameters that have
|
||||||
explicitly specified in <a href="postconf.5.html"><b>main.cf</b></a>. When specified
|
explicit <i>name=value</i> settings in <a href="postconf.5.html"><b>main.cf</b></a>. When
|
||||||
with <b>-M</b>, print only <a href="master.5.html"><b>master.cf</b></a> entries that have "-o
|
specified with <b>-M</b>, show only services that have
|
||||||
<i>name</i>=<i>value</i>" parameter settings (Postfix 2.10 and
|
explicit "-o <i>name=value</i>" settings in <a href="master.5.html"><b>master.cf</b></a>
|
||||||
later). Specify <b>-nf</b> to fold long lines for human
|
(Postfix 2.10 and later). Specify <b>-nf</b> to fold long
|
||||||
readability (Postfix 2.9 and later).
|
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>]
|
<b>-t</b> [<i>template</i><b>_</b><i>file</i>]
|
||||||
Display the templates for text that appears at the
|
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.
|
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
|
The file is copied to a temporary file then renamed
|
||||||
into place. Specify a list of parameter names, not
|
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.
|
mand to perform the reverse operation.
|
||||||
|
|
||||||
This feature is available with Postfix 2.10 and
|
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
|
line, so that those parameters revert to their
|
||||||
default values. The file is copied to a temporary
|
default values. The file is copied to a temporary
|
||||||
file then renamed into place. Specify a list of
|
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-
|
no <a href="postconf.1.html"><b>postconf</b>(1)</a> command to perform the reverse oper-
|
||||||
ation.
|
ation.
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ Postfix configuration utility
|
|||||||
.fi
|
.fi
|
||||||
\fBManaging main.cf:\fR
|
\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]
|
[\fB-C \fIclass,...\fR] [\fIparameter ...\fR]
|
||||||
|
|
||||||
\fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
|
\fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
|
||||||
@ -22,7 +22,7 @@ Postfix configuration utility
|
|||||||
|
|
||||||
\fBManaging master.cf:\fR
|
\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]
|
[\fIservice ...\fR]
|
||||||
|
|
||||||
\fBManaging bounce message templates:\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).
|
(Postfix 2.9 and later).
|
||||||
.IP \fB-e\fR
|
.IP \fB-e\fR
|
||||||
Edit the \fBmain.cf\fR configuration file, and update
|
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
|
on the \fBpostconf\fR(1) command line. The file is copied
|
||||||
to a temporary file then renamed into place.
|
to a temporary file then renamed into place.
|
||||||
Specify quotes to protect special characters and whitespace
|
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.
|
This feature is available with Postfix 2.9 and later.
|
||||||
.IP \fB-n\fR
|
.IP \fB-n\fR
|
||||||
Print only \fIname\fR=\fIvalue\fR parameter settings that
|
Show only configuration parameters that have explicit
|
||||||
are explicitly specified in \fBmain.cf\fR. When specified
|
\fIname=value\fR settings in \fBmain.cf\fR.
|
||||||
with \fB-M\fR, print only \fBmaster.cf\fR entries that have
|
When specified with \fB-M\fR, show only services that have
|
||||||
"-o \fIname\fR=\fIvalue\fR" parameter settings (Postfix
|
explicit "-o \fIname=value\fR" settings in \fBmaster.cf\fR
|
||||||
2.10 and later).
|
(Postfix 2.10 and later).
|
||||||
Specify \fB-nf\fR to fold long lines for human readability
|
Specify \fB-nf\fR to fold long lines for human readability
|
||||||
(Postfix 2.9 and later).
|
(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]"
|
.IP "\fB-t\fR [\fItemplate_file\fR]"
|
||||||
Display the templates for text that appears at the beginning
|
Display the templates for text that appears at the beginning
|
||||||
of delivery status notification (DSN) messages, without
|
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 parameters named on the \fBpostconf\fR(1) command line.
|
||||||
The file is copied to a temporary file then renamed into
|
The file is copied to a temporary file then renamed into
|
||||||
place.
|
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
|
pairs. There is no \fBpostconf\fR(1) command to perform
|
||||||
the reverse operation.
|
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.
|
so that those parameters revert to their default values.
|
||||||
The file is copied to a temporary file then renamed into
|
The file is copied to a temporary file then renamed into
|
||||||
place.
|
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
|
pairs. There is no \fBpostconf\fR(1) command to perform
|
||||||
the reverse operation.
|
the reverse operation.
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* Patches change both the patchlevel and the release date. Snapshots have no
|
* Patches change both the patchlevel and the release date. Snapshots have no
|
||||||
* patchlevel; they change the release date only.
|
* patchlevel; they change the release date only.
|
||||||
*/
|
*/
|
||||||
#define MAIL_RELEASE_DATE "20121226"
|
#define MAIL_RELEASE_DATE "20121227"
|
||||||
#define MAIL_VERSION_NUMBER "2.10"
|
#define MAIL_VERSION_NUMBER "2.10"
|
||||||
|
|
||||||
#ifdef SNAPSHOT
|
#ifdef SNAPSHOT
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/* .fi
|
/* .fi
|
||||||
/* \fBManaging main.cf:\fR
|
/* \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]
|
/* [\fB-C \fIclass,...\fR] [\fIparameter ...\fR]
|
||||||
/*
|
/*
|
||||||
/* \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
|
/* \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
|
||||||
@ -18,7 +18,7 @@
|
|||||||
/*
|
/*
|
||||||
/* \fBManaging master.cf:\fR
|
/* \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]
|
/* [\fIservice ...\fR]
|
||||||
/*
|
/*
|
||||||
/* \fBManaging bounce message templates:\fR
|
/* \fBManaging bounce message templates:\fR
|
||||||
@ -108,7 +108,7 @@
|
|||||||
/* (Postfix 2.9 and later).
|
/* (Postfix 2.9 and later).
|
||||||
/* .IP \fB-e\fR
|
/* .IP \fB-e\fR
|
||||||
/* Edit the \fBmain.cf\fR configuration file, and update
|
/* 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
|
/* on the \fBpostconf\fR(1) command line. The file is copied
|
||||||
/* to a temporary file then renamed into place.
|
/* to a temporary file then renamed into place.
|
||||||
/* Specify quotes to protect special characters and whitespace
|
/* Specify quotes to protect special characters and whitespace
|
||||||
@ -253,13 +253,17 @@
|
|||||||
/*
|
/*
|
||||||
/* This feature is available with Postfix 2.9 and later.
|
/* This feature is available with Postfix 2.9 and later.
|
||||||
/* .IP \fB-n\fR
|
/* .IP \fB-n\fR
|
||||||
/* Print only \fIname\fR=\fIvalue\fR parameter settings that
|
/* Show only configuration parameters that have explicit
|
||||||
/* are explicitly specified in \fBmain.cf\fR. When specified
|
/* \fIname=value\fR settings in \fBmain.cf\fR.
|
||||||
/* with \fB-M\fR, print only \fBmaster.cf\fR entries that have
|
/* When specified with \fB-M\fR, show only services that have
|
||||||
/* "-o \fIname\fR=\fIvalue\fR" parameter settings (Postfix
|
/* explicit "-o \fIname=value\fR" settings in \fBmaster.cf\fR
|
||||||
/* 2.10 and later).
|
/* (Postfix 2.10 and later).
|
||||||
/* Specify \fB-nf\fR to fold long lines for human readability
|
/* Specify \fB-nf\fR to fold long lines for human readability
|
||||||
/* (Postfix 2.9 and later).
|
/* (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]"
|
/* .IP "\fB-t\fR [\fItemplate_file\fR]"
|
||||||
/* Display the templates for text that appears at the beginning
|
/* Display the templates for text that appears at the beginning
|
||||||
/* of delivery status notification (DSN) messages, without
|
/* of delivery status notification (DSN) messages, without
|
||||||
@ -288,7 +292,7 @@
|
|||||||
/* the parameters named on the \fBpostconf\fR(1) command line.
|
/* the parameters named on the \fBpostconf\fR(1) command line.
|
||||||
/* The file is copied to a temporary file then renamed into
|
/* The file is copied to a temporary file then renamed into
|
||||||
/* place.
|
/* 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
|
/* pairs. There is no \fBpostconf\fR(1) command to perform
|
||||||
/* the reverse operation.
|
/* the reverse operation.
|
||||||
/*
|
/*
|
||||||
@ -299,7 +303,7 @@
|
|||||||
/* so that those parameters revert to their default values.
|
/* so that those parameters revert to their default values.
|
||||||
/* The file is copied to a temporary file then renamed into
|
/* The file is copied to a temporary file then renamed into
|
||||||
/* place.
|
/* 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
|
/* pairs. There is no \fBpostconf\fR(1) command to perform
|
||||||
/* the reverse operation.
|
/* the reverse operation.
|
||||||
/*
|
/*
|
||||||
@ -367,6 +371,7 @@
|
|||||||
#include <stringops.h>
|
#include <stringops.h>
|
||||||
#include <name_mask.h>
|
#include <name_mask.h>
|
||||||
#include <warn_stat.h>
|
#include <warn_stat.h>
|
||||||
|
#include <mymalloc.h>
|
||||||
|
|
||||||
/* Global library. */
|
/* Global library. */
|
||||||
|
|
||||||
@ -409,6 +414,7 @@ int main(int argc, char **argv)
|
|||||||
"all", PC_PARAM_MASK_CLASS,
|
"all", PC_PARAM_MASK_CLASS,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
ARGV *override_params = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fingerprint executables and core dumps.
|
* Fingerprint executables and core dumps.
|
||||||
@ -438,7 +444,7 @@ int main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Parse JCL.
|
* 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) {
|
switch (ch) {
|
||||||
case 'a':
|
case 'a':
|
||||||
cmd_mode |= SHOW_SASL_SERV;
|
cmd_mode |= SHOW_SASL_SERV;
|
||||||
@ -469,11 +475,9 @@ int main(int argc, char **argv)
|
|||||||
case 'f':
|
case 'f':
|
||||||
cmd_mode |= FOLD_LINE;
|
cmd_mode |= FOLD_LINE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '#':
|
case '#':
|
||||||
cmd_mode = COMMENT_OUT;
|
cmd_mode = COMMENT_OUT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
cmd_mode &= ~SHOW_NAME;
|
cmd_mode &= ~SHOW_NAME;
|
||||||
break;
|
break;
|
||||||
@ -489,6 +493,11 @@ int main(int argc, char **argv)
|
|||||||
case 'n':
|
case 'n':
|
||||||
cmd_mode |= SHOW_NONDEF;
|
cmd_mode |= SHOW_NONDEF;
|
||||||
break;
|
break;
|
||||||
|
case 'o':
|
||||||
|
if (override_params == 0)
|
||||||
|
override_params = argv_alloc(2);
|
||||||
|
argv_add(override_params, optarg, (char *) 0);
|
||||||
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
if (ext_argv)
|
if (ext_argv)
|
||||||
msg_fatal("specify one of -b and -t");
|
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");
|
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)
|
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");
|
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.
|
* Display bounce template information and exit.
|
||||||
@ -568,6 +579,8 @@ int main(int argc, char **argv)
|
|||||||
else if (cmd_mode & SHOW_MASTER) {
|
else if (cmd_mode & SHOW_MASTER) {
|
||||||
read_master(FAIL_ON_OPEN_ERROR);
|
read_master(FAIL_ON_OPEN_ERROR);
|
||||||
read_parameters();
|
read_parameters();
|
||||||
|
if (override_params)
|
||||||
|
set_parameters(override_params->argv);
|
||||||
register_builtin_parameters(basename(argv[0]), getpid());
|
register_builtin_parameters(basename(argv[0]), getpid());
|
||||||
register_service_parameters();
|
register_service_parameters();
|
||||||
register_user_parameters();
|
register_user_parameters();
|
||||||
@ -599,6 +612,8 @@ int main(int argc, char **argv)
|
|||||||
else {
|
else {
|
||||||
if ((cmd_mode & SHOW_DEFS) == 0) {
|
if ((cmd_mode & SHOW_DEFS) == 0) {
|
||||||
read_parameters();
|
read_parameters();
|
||||||
|
if (override_params)
|
||||||
|
set_parameters(override_params->argv);
|
||||||
}
|
}
|
||||||
register_builtin_parameters(basename(argv[0]), getpid());
|
register_builtin_parameters(basename(argv[0]), getpid());
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ extern void set_config_dir(void);
|
|||||||
* postconf_main.c
|
* postconf_main.c
|
||||||
*/
|
*/
|
||||||
extern void read_parameters(void);
|
extern void read_parameters(void);
|
||||||
extern void set_parameters(void);
|
extern void set_parameters(char **);
|
||||||
extern void show_parameters(int, int, char **);
|
extern void show_parameters(int, int, char **);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
/* DESCRIPTION
|
/* DESCRIPTION
|
||||||
/* read_parameters() reads parameters from main.cf.
|
/* 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
|
/* show_parameters() writes main.cf parameters to the standard
|
||||||
/* output stream.
|
/* output stream.
|
||||||
/*
|
/*
|
||||||
@ -106,6 +109,23 @@ void read_parameters(void)
|
|||||||
myfree(path);
|
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 */
|
/* print_line - show line possibly folded, and with normalized whitespace */
|
||||||
|
|
||||||
static void print_line(int mode, const char *fmt,...)
|
static void print_line(int mode, const char *fmt,...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user