From: Wietse Venema
The expressions "$name", "${name}" or "$(name)" are -recursively replaced by the value of the named parameter.
+The expressions "$name" and "${name}" are recursively +replaced with the value of the named parameter, except where noted. +An undefined parameter value is replaced with the empty value.
-The expression "${name?value}" expands to "value" when -"$name" is non-empty. This form is supported with Postfix version -2.2 and later.
+The expressions "${name?value}" and "${name?{value}}" are +replaced with "value" when "$name" is non-empty. These forms are +supported with Postfix versions ≥ 2.2 and ≥ 2.12, respectively. +
-The expression "${name:value}" expands to "value" when -"$name" is empty. This form is supported with Postfix version 2.2 -and later.
+The expressions "${name:value}" and "${name?{value}}" are +replaced with "value" when "$name" is empty. These forms are supported +with Postfix versions ≥ 2.2 and ≥ 2.12, respectively.
+ +The expression "${name?{value1}:{value2}}" is replaced +with "value1" when "$name" is non-empty, and with "value2" when +"$name" is empty. The "{}" is required for "value1", optional for +"value2". This form is supported with Postfix versions ≥ 2.12. +
+ +Instead of a parameter name, the first item inside "${...}" +may be a logical expression of the form: "{value3} == {value4}" +(equality) or "{value3} != {value4}" (inequality). This form is +supported with Postfix versions ≥ 2.12.
+ +Each "value" is subject to recursive named parameter and +logical expression evaluation, except where noted.
+ +Whitespace before or after each "{value}" is ignored.
Specify "$$" to produce a single "$" character.
+The legacy form "$(...)" is equivalent to the preferred +form "${...}".
+When the same parameter is defined multiple times, only diff --git a/postfix/html/proxymap.8.html b/postfix/html/proxymap.8.html index ebe62e993..ceb127769 100644 --- a/postfix/html/proxymap.8.html +++ b/postfix/html/proxymap.8.html @@ -14,11 +14,11 @@ PROXYMAP(8) PROXYMAP(8) DESCRIPTION The proxymap(8) server provides read-only or read-write table lookup - service to Postfix processes. These services are implemented with dis- + service to Postfix processes. These services are implemented with disâ tinct service names: proxymap and proxywrite, respectively. The purpose of these services is: - o To overcome chroot restrictions. For example, a chrooted SMTP + · To overcome chroot restrictions. For example, a chrooted SMTP server needs access to the system passwd file in order to reject mail for non-existent local addresses, but it is not practical to maintain a copy of the passwd file in the chroot jail. The @@ -27,7 +27,7 @@ PROXYMAP(8) PROXYMAP(8) local_recipient_maps = proxy:unix:passwd.byname $alias_maps - o To consolidate the number of open lookup tables by sharing one + · To consolidate the number of open lookup tables by sharing one open table among multiple processes. For example, making mysql connections from every Postfix daemon process results in "too many connections" errors. The solution: @@ -38,7 +38,7 @@ PROXYMAP(8) PROXYMAP(8) The total number of connections is limited by the number of proxymap server processes. - o To provide single-updater functionality for lookup tables that + · To provide single-updater functionality for lookup tables that do not reliably support multiple writers (i.e. all file-based tables). @@ -47,7 +47,7 @@ PROXYMAP(8) PROXYMAP(8) open maptype:mapname flags Open the table with type maptype and name mapname, as controlled by flags. The reply includes the maptype dependent flags (to - distinguish a fixed string table from a regular expression ta- + distinguish a fixed string table from a regular expression taâ ble). lookup maptype:mapname flags key @@ -101,7 +101,7 @@ PROXYMAP(8) PROXYMAP(8) The proxymap(8) server opens only tables that are approved via the proxy_read_maps or proxy_write_maps configuration parameters, does not talk to users, and can run at fixed low privilege, chrooted or not. - However, running the proxymap server chrooted severely limits usabil- + However, running the proxymap server chrooted severely limits usabilâ ity, because it can open only chrooted tables. The proxymap(8) server is not a trusted daemon process, and must not be @@ -113,7 +113,7 @@ PROXYMAP(8) PROXYMAP(8) the table directly. This allows the same main.cf setting to be used by sensitive and non-sensitive processes. - Postfix-writable data files should be stored under a dedicated direc- + Postfix-writable data files should be stored under a dedicated direcâ tory that is writable only by the Postfix mail system, such as the Postfix-owned data_directory. @@ -131,7 +131,7 @@ PROXYMAP(8) PROXYMAP(8) The proxymap(8) read-write service does not explicitly close lookup tables (even if it did, this could not be relied on, because the - process may be terminated between table updates). The read-write ser- + process may be terminated between table updates). The read-write serâ vice should therefore not be used with tables that leave persistent storage in an inconsistent state between updates (for example, CDB). Tables that support "sync on update" should be safe (for example, @@ -146,7 +146,7 @@ PROXYMAP(8) PROXYMAP(8) more details including examples. config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and master.cf con- + The default location of the Postfix main.cf and master.cf conâ figuration files. data_directory (see 'postconf -d' output) diff --git a/postfix/html/qmqp-sink.1.html b/postfix/html/qmqp-sink.1.html index 17077e496..a72ead8ed 100644 --- a/postfix/html/qmqp-sink.1.html +++ b/postfix/html/qmqp-sink.1.html @@ -16,13 +16,13 @@ QMQP-SINK(1) QMQP-SINK(1) DESCRIPTION qmqp-sink listens on the named host (or address) and port. It receives - messages from the network and throws them away. The purpose is to mea- + messages from the network and throws them away. The purpose is to meaâ sure QMQP client performance, not protocol compliance. Connections can be accepted on IPv4 or IPv6 endpoints, or on UNIX-domain sockets. IPv4 and IPv6 are the default. This program is the complement of the qmqp- source(1) program. - Note: this is an unsupported test program. No attempt is made to main- + Note: this is an unsupported test program. No attempt is made to mainâ tain compatibility between successive versions. Arguments: @@ -36,7 +36,7 @@ QMQP-SINK(1) QMQP-SINK(1) -c Display a running counter that is updated whenever a delivery is completed. - -v Increase verbosity. Specify -v -v to see some of the QMQP con- + -v Increase verbosity. Specify -v -v to see some of the QMQP conâ versation. -x time diff --git a/postfix/html/smtp-sink.1.html b/postfix/html/smtp-sink.1.html index 8c676de7c..cf6fa6ebc 100644 --- a/postfix/html/smtp-sink.1.html +++ b/postfix/html/smtp-sink.1.html @@ -19,7 +19,7 @@ SMTP-SINK(1) SMTP-SINK(1) SMTP messages from the network and throws them away. The purpose is to measure client performance, not protocol compliance. - smtp-sink may also be configured to capture each mail delivery transac- + smtp-sink may also be configured to capture each mail delivery transacâ tion to file. Since disk latencies are large compared to network delays, this mode of operation can reduce the maximal performance by several orders of magnitude. @@ -28,7 +28,7 @@ SMTP-SINK(1) SMTP-SINK(1) domain sockets. IPv4 and IPv6 are the default. This program is the complement of the smtp-source(1) program. - Note: this is an unsupported test program. No attempt is made to main- + Note: this is an unsupported test program. No attempt is made to mainâ tain compatibility between successive versions. Arguments: @@ -44,7 +44,7 @@ SMTP-SINK(1) SMTP-SINK(1) -a Do not announce SASL authentication support. -A delay - Wait delay seconds after responding to DATA, then abort prema- + Wait delay seconds after responding to DATA, then abort premaâ turely with a 550 reply status. Do not read further input from the client; this is an attempt to block the client before it sends ".". Specify a zero delay value to abort immediately. @@ -57,7 +57,7 @@ SMTP-SINK(1) SMTP-SINK(1) Use hard-bounce-reply for hard reject responses. The default reply is "500 5.3.0 Error: command failed". - -c Display running counters that are updated whenever an SMTP ses- + -c Display running counters that are updated whenever an SMTP sesâ sion ends, a QUIT command is executed, or when "." is received. -C Disable XCLIENT support. @@ -67,7 +67,7 @@ SMTP-SINK(1) SMTP-SINK(1) is created by expanding the dump-template via strftime(3) and appending a pseudo-random hexadecimal number (example: "%Y%m%d%H/%M." expands into "2006081203/05.809a62e3"). If the - template contains "/" characters, missing directories are cre- + template contains "/" characters, missing directories are creâ ated automatically. The message dump format is described below. Note: this option keeps one capture file open for every mail @@ -106,7 +106,7 @@ SMTP-SINK(1) SMTP-SINK(1) -m count (default: 256) An upper bound on the maximal number of simultaneous connections - that smtp-sink will handle. This prevents the process from run- + that smtp-sink will handle. This prevents the process from runâ ning out of file descriptors. Excess connections will stay queued in the TCP/IP stack. @@ -122,7 +122,7 @@ SMTP-SINK(1) SMTP-SINK(1) CISCO PIX system. Implies -e. -q command,command,... - Disconnect (without replying) after receiving one of the speci- + Disconnect (without replying) after receiving one of the speciâ fied commands. Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, @@ -131,7 +131,7 @@ SMTP-SINK(1) SMTP-SINK(1) from the shell. Command names are case-insensitive. -Q command,command,... - Send a 421 reply and disconnect after receiving one of the spec- + Send a 421 reply and disconnect after receiving one of the specâ ified commands. Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, @@ -165,7 +165,7 @@ SMTP-SINK(1) SMTP-SINK(1) An optional string that is prepended to each message that is written to a dump file (see the dump file format description below). The following C escape sequences are supported: \a - (bell), \b (backslace), \f (formfeed), \n (newline), \r (car- + (bell), \b (backslace), \f (formfeed), \n (newline), \r (carâ riage return), \t (horizontal tab), \v (vertical tab), \ddd (up to three octal digits) and \\ (the backslash character). @@ -178,7 +178,7 @@ SMTP-SINK(1) SMTP-SINK(1) window scaling implementations, specify a value > 0 and < 65536. -u username - Switch to the specified user privileges after opening the net- + Switch to the specified user privileges after opening the netâ work socket and optionally changing the process root directory. This option is required when the process runs with super-user privileges. See also the -R option. @@ -212,13 +212,13 @@ SMTP-SINK(1) SMTP-SINK(1) Each dumped message contains a sequence of text lines, terminated with the newline character. The sequence of information is as follows: - o The optional string specified with the -S option. + · The optional string specified with the -S option. - o The smtp-sink generated headers as documented below. + · The smtp-sink generated headers as documented below. - o The message header and body as received from the SMTP client. + · The message header and body as received from the SMTP client. - o An empty line. + · An empty line. The format of the smtp-sink generated headers is as follows: @@ -233,11 +233,11 @@ SMTP-SINK(1) SMTP-SINK(1) X-Helo-Args: text The arguments of the last HELO or EHLO command before this mail delivery transaction. This record is present only if the client - sent a recognizable HELO or EHLO command before the DATA com- + sent a recognizable HELO or EHLO command before the DATA comâ mand. X-Mail-Args: text - The arguments of the MAIL command that started this mail deliv- + The arguments of the MAIL command that started this mail delivâ ery transaction. This record is present exactly once. X-Rcpt-Args: text @@ -246,8 +246,8 @@ SMTP-SINK(1) SMTP-SINK(1) are in the order as sent by the client. Received: text - A message header for compatibility with mail processing soft- - ware. This three-line header marks the end of the headers pro- + A message header for compatibility with mail processing softâ + ware. This three-line header marks the end of the headers proâ vided by smtp-sink, and is formatted as follows: from helo ([addr]) @@ -257,7 +257,7 @@ SMTP-SINK(1) SMTP-SINK(1) by host (smtp-sink) with proto id random; The hostname specified with the -h option, the client - protocol (see X-Client-Proto above), and the pseudo-ran- + protocol (see X-Client-Proto above), and the pseudo-ranâ dom portion of the per-message capture file name. time-stamp diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1 index 68f9bab24..a2db7755a 100644 --- a/postfix/man/man1/postconf.1 +++ b/postfix/man/man1/postconf.1 @@ -274,25 +274,26 @@ The file format is described in \fBpcre_table\fR(5). PostgreSQL database client. This is described in \fBpgsql_table\fR(5). .IP "\fBpipemap\fR (read-only)" -A pipeline of lookup tables. Example: -"\fBpipemap:\fI!type_1:name_1! ... !type_n:name_n\fR". +A lookup table that constructs a pipeline of tables. Example: +"\fBpipemap:{\fItype_1:name_1, ..., type_n:name_n\fB}\fR". Each "pipemap:" query is given to the first table. Each lookup result becomes the query for the next table in the pipeline, and the last table produces the final result. When any table lookup produces no result, the pipeline -produces no result. The first ASCII character after "pipemap:" -will be used as the separator between the lookup tables -that follow (do not use space, ",", ":" or non-ASCII). +produces no result. The first and last characters of the +"pipemap:" table name must be "\fB{\fR" and "\fB}\fR". +Within these, individual maps are separated with comma or +whitespace. .IP "\fBproxy\fR" Postfix \fBproxymap\fR(8) client for shared access to Postfix databases. The table name syntax is \fItype\fB:\fIname\fR. .IP "\fBrandmap\fR (read-only)" An in-memory table that performs random selection. Example: -"\fBrandmap:\fI!result_1! ... !result_n\fR". Each table query +"\fBrandmap:{\fIresult_1, ..., result_n\fB}\fR". Each table query returns a random choice from the specified results. The first -ASCII character after "randmap:" will be used as the separator -between the results that follow (do not use space, ",", ":" -or non-ASCII). +and last characters of the "randmap:" table name must be +"\fB{\fR" and "\fB}\fR". Within these, individual maps are +separated with comma or whitespace. .IP "\fBregexp\fR (read-only)" A lookup table based on regular expressions. The file format is described in \fBregexp_table\fR(5). diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index d19ce122d..0cb0a6344 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -32,18 +32,36 @@ with whitespace continues a logical line. A parameter value may refer to other parameters. .RS .IP \(bu -The expressions "$name", "${name}" or "$(name)" are -recursively replaced by the value of the named parameter. +The expressions "$name" and "${name}" are recursively replaced with +the value of the named parameter. An undefined parameter value is +replaced with the empty value. .IP \(bu -The expression "${name?value}" expands to "value" when -"$name" is non-empty. This form is supported with Postfix -version 2.2 and later. +The expressions "${name?value}" and "${name?{value}}" are replaced +with "value" when "$name" is non-empty. These forms are supported +with Postfix versions >= 2.2 and >= 2.12, respectively. .IP \(bu -The expression "${name:value}" expands to "value" when -"$name" is empty. This form is supported with Postfix -version 2.2 and later. +The expressions "${name:value}" and "${name:{value}}" are replaced +with "value" when "$name" is empty. These forms are supported with +Postfix versions >= 2.2 and >= 2.12, respectively. +.IP \(bu +The expression "${name?{value1}:{value2}}" is replaced with "value1" +when "$name" is non-empty, and with "value2" when "$name" is empty. +The "{}" is required for "value1", optional for "value2". This form +is supported with Postfix versions >= 2.12. +.IP \(bu +Instead of a parameter name, the first item inside "${...}" may be +a logical expression of the form: "{value3} == {value4}" (equality) +or "{value3} != {value4}" (inequality). This form is supported +with Postfix versions >= 2.12. +.IP \(bu +Each "value" is subject to recursive named parameter and logical +expression evaluation, except where noted. +.IP \(bu +Whitespace before or after each "{value}" is ignored. .IP \(bu Specify "$$" to produce a single "$" character. +.IP \(bu +The legacy form "$(...)" is equivalent to the preferred form "${...}". .RE .IP \(bu When the same parameter is defined multiple times, only the last diff --git a/postfix/proto/DATABASE_README.html b/postfix/proto/DATABASE_README.html index 3ac27ec3d..847ad01b9 100644 --- a/postfix/proto/DATABASE_README.html +++ b/postfix/proto/DATABASE_README.html @@ -365,14 +365,14 @@ file.
The expressions "$name", "${name}" or "$(name)" are -recursively replaced by the value of the named parameter.
+The expressions "$name" and "${name}" are recursively +replaced with the value of the named parameter, except where noted. +An undefined parameter value is replaced with the empty value.
-The expression "${name?value}" expands to "value" when -"$name" is non-empty. This form is supported with Postfix version -2.2 and later.
+The expressions "${name?value}" and "${name?{value}}" are +replaced with "value" when "$name" is non-empty. These forms are +supported with Postfix versions ≥ 2.2 and ≥ 2.12, respectively. +
-The expression "${name:value}" expands to "value" when -"$name" is empty. This form is supported with Postfix version 2.2 -and later.
+The expressions "${name:value}" and "${name?{value}}" are +replaced with "value" when "$name" is empty. These forms are supported +with Postfix versions ≥ 2.2 and ≥ 2.12, respectively.
+ +The expression "${name?{value1}:{value2}}" is replaced +with "value1" when "$name" is non-empty, and with "value2" when +"$name" is empty. The "{}" is required for "value1", optional for +"value2". This form is supported with Postfix versions ≥ 2.12. +
+ +Instead of a parameter name, the first item inside "${...}" +may be a logical expression of the form: "{value3} == {value4}" +(equality) or "{value3} != {value4}" (inequality). This form is +supported with Postfix versions ≥ 2.12.
+ +Each "value" is subject to recursive named parameter and +logical expression evaluation, except where noted.
+ +Whitespace before or after each "{value}" is ignored.
Specify "$$" to produce a single "$" character.
+The legacy form "$(...)" is equivalent to the preferred +form "${...}".
+ When the same parameter is defined multiple times, only
diff --git a/postfix/proto/postconf.man.prolog b/postfix/proto/postconf.man.prolog
index 170838fe6..ac915824c 100644
--- a/postfix/proto/postconf.man.prolog
+++ b/postfix/proto/postconf.man.prolog
@@ -32,18 +32,36 @@ with whitespace continues a logical line.
A parameter value may refer to other parameters.
.RS
.IP \(bu
-The expressions "$name", "${name}" or "$(name)" are
-recursively replaced by the value of the named parameter.
+The expressions "$name" and "${name}" are recursively replaced with
+the value of the named parameter. An undefined parameter value is
+replaced with the empty value.
.IP \(bu
-The expression "${name?value}" expands to "value" when
-"$name" is non-empty. This form is supported with Postfix
-version 2.2 and later.
+The expressions "${name?value}" and "${name?{value}}" are replaced
+with "value" when "$name" is non-empty. These forms are supported
+with Postfix versions >= 2.2 and >= 2.12, respectively.
.IP \(bu
-The expression "${name:value}" expands to "value" when
-"$name" is empty. This form is supported with Postfix
-version 2.2 and later.
+The expressions "${name:value}" and "${name:{value}}" are replaced
+with "value" when "$name" is empty. These forms are supported with
+Postfix versions >= 2.2 and >= 2.12, respectively.
+.IP \(bu
+The expression "${name?{value1}:{value2}}" is replaced with "value1"
+when "$name" is non-empty, and with "value2" when "$name" is empty.
+The "{}" is required for "value1", optional for "value2". This form
+is supported with Postfix versions >= 2.12.
+.IP \(bu
+Instead of a parameter name, the first item inside "${...}" may be
+a logical expression of the form: "{value3} == {value4}" (equality)
+or "{value3} != {value4}" (inequality). This form is supported
+with Postfix versions >= 2.12.
+.IP \(bu
+Each "value" is subject to recursive named parameter and logical
+expression evaluation, except where noted.
+.IP \(bu
+Whitespace before or after each "{value}" is ignored.
.IP \(bu
Specify "$$" to produce a single "$" character.
+.IP \(bu
+The legacy form "$(...)" is equivalent to the preferred form "${...}".
.RE
.IP \(bu
When the same parameter is defined multiple times, only the last
diff --git a/postfix/src/bounce/bounce_template.h b/postfix/src/bounce/bounce_template.h
index fe6c65524..2927d1328 100644
--- a/postfix/src/bounce/bounce_template.h
+++ b/postfix/src/bounce/bounce_template.h
@@ -50,7 +50,7 @@ typedef struct BOUNCE_TEMPLATE {
#define bounce_template_encoding(t) ((t)->mime_encoding)
#define bounce_template_charset(t) ((t)->mime_charset)
-typedef int (*BOUNCE_XP_PRN_FN) (VSTREAM *, const char *, ...);
+typedef int PRINTFLIKE(2, 3) (*BOUNCE_XP_PRN_FN) (VSTREAM *, const char *,...);
typedef int (*BOUNCE_XP_PUT_FN) (VSTREAM *, const char *);
extern BOUNCE_TEMPLATE *bounce_template_create(const BOUNCE_TEMPLATE *);
diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c
index aa1fe6c5b..7860df213 100644
--- a/postfix/src/cleanup/cleanup_message.c
+++ b/postfix/src/cleanup/cleanup_message.c
@@ -580,8 +580,11 @@ static void cleanup_header_callback(void *context, int header_class,
if (hdr_opts->type == HDR_RESENT_MESSAGE_ID)
msg_info("%s: resent-message-id=%s", state->queue_id, hdrval);
if (hdr_opts->type == HDR_RECEIVED)
- if (++state->hop_count >= var_hopcount_limit)
+ if (++state->hop_count >= var_hopcount_limit) {
+ msg_warn("%s: message rejected: hopcount exceeded",
+ state->queue_id);
state->errs |= CLEANUP_STAT_HOPS;
+ }
if (CLEANUP_OUT_OK(state)) {
if (hdr_opts->flags & HDR_OPT_RR)
state->resent = "Resent-";
diff --git a/postfix/src/global/data_redirect.c b/postfix/src/global/data_redirect.c
index 7f497ca49..1a8fe0f9c 100644
--- a/postfix/src/global/data_redirect.c
+++ b/postfix/src/global/data_redirect.c
@@ -227,7 +227,7 @@ int main(int argc, char **argv)
vstream_fflush(VSTREAM_OUT);
continue;
}
- target = mystrtok(&bufp, " \t");
+ target = mystrtokq(&bufp, " \t");
junk = mystrtok(&bufp, " \t");
if (strcmp(cmd, "file") == 0 && target && !junk) {
data_redirect_file(result, target);
diff --git a/postfix/src/global/dict_memcache.c b/postfix/src/global/dict_memcache.c
index 161e0c880..0b87dfb0d 100644
--- a/postfix/src/global/dict_memcache.c
+++ b/postfix/src/global/dict_memcache.c
@@ -133,7 +133,7 @@ static int dict_memcache_set(DICT_MC *dict_mc, const char *value, int ttl)
{
VSTREAM *fp;
int count;
- int data_len = strlen(value);
+ size_t data_len = strlen(value);
/*
* Return a permanent error if we can't store this data. This results in
@@ -153,7 +153,8 @@ static int dict_memcache_set(DICT_MC *dict_mc, const char *value, int ttl)
if ((fp = auto_clnt_access(dict_mc->clnt)) == 0) {
break;
} else if (memcache_printf(fp, "set %s %d %d %ld",
- STR(dict_mc->key_buf), dict_mc->mc_flags, ttl, data_len) < 0
+ STR(dict_mc->key_buf), dict_mc->mc_flags,
+ ttl, (long) data_len) < 0
|| memcache_fwrite(fp, value, strlen(value)) < 0
|| memcache_get(fp, dict_mc->clnt_buf,
dict_mc->max_line) < 0) {
diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h
index adb59662a..c4bfa30d8 100644
--- a/postfix/src/global/mail_version.h
+++ b/postfix/src/global/mail_version.h
@@ -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 "20140907"
+#define MAIL_RELEASE_DATE "20140921"
#define MAIL_VERSION_NUMBER "2.12"
#ifdef SNAPSHOT
diff --git a/postfix/src/global/maps.c b/postfix/src/global/maps.c
index 391a80019..b0e0b9b5b 100644
--- a/postfix/src/global/maps.c
+++ b/postfix/src/global/maps.c
@@ -115,6 +115,7 @@ MAPS *maps_create(const char *title, const char *map_names, int dict_flags)
char *temp;
char *bufp;
static char sep[] = " \t,\r\n";
+ static char parens[] = "{}";
MAPS *maps;
char *map_type_name;
VSTRING *map_type_name_flags;
@@ -138,7 +139,7 @@ MAPS *maps_create(const char *title, const char *map_names, int dict_flags)
#define OPEN_FLAGS O_RDONLY
- while ((map_type_name = mystrtok(&bufp, sep)) != 0) {
+ while ((map_type_name = mystrtokq(&bufp, sep, parens)) != 0) {
vstring_sprintf(map_type_name_flags, "%s(%o,%s)",
map_type_name, OPEN_FLAGS,
dict_flags_str(dict_flags));
diff --git a/postfix/src/global/memcache_proto.h b/postfix/src/global/memcache_proto.h
index 88a1d191f..e3f850188 100644
--- a/postfix/src/global/memcache_proto.h
+++ b/postfix/src/global/memcache_proto.h
@@ -16,7 +16,7 @@
*/
extern int memcache_get(VSTREAM *, VSTRING *, ssize_t);
extern int memcache_vprintf(VSTREAM *, const char *, va_list);
-extern int memcache_printf(VSTREAM *, const char *fmt,...);
+extern int PRINTFLIKE(2, 3) memcache_printf(VSTREAM *, const char *fmt,...);
extern int memcache_fread(VSTREAM *, VSTRING *, ssize_t);
extern int memcache_fwrite(VSTREAM *, const char *, ssize_t);
diff --git a/postfix/src/global/server_acl.c b/postfix/src/global/server_acl.c
index 3855c6fe0..7717f02d0 100644
--- a/postfix/src/global/server_acl.c
+++ b/postfix/src/global/server_acl.c
@@ -120,7 +120,7 @@ SERVER_ACL *server_acl_parse(const char *extern_acl, const char *origin)
* chroot jail, while access lists are evaluated after entering the
* chroot jail.
*/
- while ((acl = mystrtok(&bp, SERVER_ACL_SEPARATORS)) != 0) {
+ while ((acl = mystrtokq(&bp, SERVER_ACL_SEPARATORS, "{}")) != 0) {
if (strchr(acl, ':') != 0) {
if (strchr(origin, ':') != 0) {
msg_warn("table %s: lookup result \"%s\" is not allowed"
diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in
index 45d894760..b7eefb516 100644
--- a/postfix/src/postconf/Makefile.in
+++ b/postfix/src/postconf/Makefile.in
@@ -49,7 +49,7 @@ tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \
test22 test23 test24 test25 test26 test27 test28 test29 test30 test4b \
test31 test32 test33 test34 test35 test36 test37 test39 test40 test41 \
test42 test43 test44 test45 test46 test47 test48 test49 test50 test51 \
- test52 test53 test54 test55 test56
+ test52 test53 test54 test55 test56 test57 test58
root_tests:
@@ -72,6 +72,7 @@ test1: $(PROG) test1.ref
touch main.cf master.cf
echo smtpd_restriction_classes = foo bar >> main.cf
echo foo = yes >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test1.tmp 2>&1
diff test1.ref test1.tmp
rm -f main.cf master.cf test1.tmp
@@ -83,6 +84,7 @@ test2: $(PROG) test2.ref
touch main.cf master.cf
echo restriction_classes = foo bar >> main.cf
echo foo = yes >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test2.tmp 2>&1
diff test2.ref test2.tmp
rm -f main.cf master.cf test2.tmp
@@ -95,6 +97,7 @@ test3: $(PROG) test3.ref
echo foo = yes >> main.cf
echo 'bar = $$foo' >> main.cf
echo 'always_bcc = $$bar' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test3.tmp 2>&1
diff test3.ref test3.tmp
rm -f main.cf master.cf test3.tmp
@@ -108,6 +111,7 @@ test4: $(PROG) test4.ref
echo 'bar = $$foo' >> main.cf
echo smtpd unix - n n - 0 smtpd >> master.cf
echo ' -o always_bcc=$$bar' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test4.tmp 2>&1
diff test4.ref test4.tmp
rm -f main.cf master.cf test4.tmp
@@ -123,6 +127,7 @@ test4b: $(PROG) test4b.ref
echo smtpd1 unix - n n - 0 smtpd >> master.cf
echo ' -o foo=xxx -o bar=yyy -o baz=zzz' >> master.cf
echo '#smtpd2 unix - n n - 0 smtpd' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test4b.tmp 2>&1
diff test4b.ref test4b.tmp
rm -f main.cf master.cf test4b.tmp
@@ -135,6 +140,7 @@ test5: $(PROG) test5.ref
touch main.cf master.cf
echo smtpd unix - n n - 0 smtpd >> master.cf
echo ' -o bar=yes -o always_bcc=$$bar -o' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test5.tmp 2>&1
diff test5.ref test5.tmp
rm -f main.cf master.cf test5.tmp
@@ -145,6 +151,7 @@ test6: $(PROG) test6.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 pipe >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . 2>&1 | grep whatevershebrings >test6.tmp
diff test6.ref test6.tmp
rm -f main.cf master.cf test6.tmp
@@ -155,6 +162,7 @@ test7: $(PROG) test7.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 spawn >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . 2>&1 | grep whatevershebrings >test7.tmp
diff test7.ref test7.tmp
rm -f main.cf master.cf test7.tmp
@@ -164,6 +172,7 @@ test8: $(PROG) test8.ref
touch main.cf master.cf
echo whatevershebrings inet - n n - 0 spawn >> master.cf
echo whatevershebrings_time_limit=1 >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . 2>&1 | grep whatevershebrings >test8.tmp
diff test8.ref test8.tmp
rm -f main.cf master.cf test8.tmp
@@ -173,6 +182,7 @@ test9: $(PROG) test9.ref
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo bar unix - n n - 0 spawn >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -M '*'/inet >test9.tmp 2>&1
diff test9.ref test9.tmp
rm -f main.cf master.cf test9.tmp
@@ -182,6 +192,7 @@ test10: $(PROG) test10.ref
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo bar unix - n n - 0 spawn >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -M bar/inet foo/unix >test10.tmp 2>&1
diff test10.ref test10.tmp
rm -f main.cf master.cf test10.tmp
@@ -191,6 +202,7 @@ test11: $(PROG) test11.ref
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo bar unix - n n - 0 spawn >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -M >test11.tmp 2>&1
diff test11.ref test11.tmp
rm -f main.cf master.cf test11.tmp
@@ -205,6 +217,7 @@ test12: $(PROG) test12.ref
echo ' -o always_bcc=$$bar -o' >> master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o always_bcc=$$bar -o' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -M >test12.tmp 2>&1
diff test12.ref test12.tmp
rm -f main.cf master.cf test12.tmp
@@ -218,6 +231,7 @@ test13: $(PROG) test13.ref
echo baz=xx >> main.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o smtpd_restriction_classes=bar' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test13.tmp 2>&1
diff test13.ref test13.tmp
rm -f main.cf master.cf test13.tmp
@@ -230,6 +244,7 @@ test14: $(PROG) test14.ref
echo smtpd_restriction_classes=bar >> main.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o bar=yes -o baz=xx' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test14.tmp 2>&1
diff test14.ref test14.tmp
rm -f main.cf master.cf test14.tmp
@@ -243,6 +258,7 @@ test15: $(PROG) test15.ref
echo baz=yy >> main.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o bar=yes -o always_bcc=$$bar$$baz' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test15.tmp 2>&1
diff test15.ref test15.tmp
rm -f main.cf master.cf test15.tmp
@@ -251,14 +267,14 @@ test15: $(PROG) test15.ref
test16: $(PROG) test16.ref
rm -f main.cf master.cf
- touch main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test16.tmp 2>&1
diff test16.ref test16.tmp
rm -f main.cf master.cf test16.tmp
test17: $(PROG) test17.ref
rm -f main.cf master.cf
- touch main.cf
+ touch -t 197101010000 main.cf
-./$(PROG) -Mc . >test17.tmp 2>&1; exit 0
diff test17.ref test17.tmp
rm -f main.cf master.cf test17.tmp
@@ -270,6 +286,7 @@ test18: $(PROG) test18.ref
touch main.cf master.cf
echo virtual_maps=xxx >> main.cf
echo smtpd_client_connection_limit_exceptions=yyy >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test18.tmp 2>&1
diff test18.ref test18.tmp
rm -f main.cf master.cf test18.tmp
@@ -281,6 +298,7 @@ test19: $(PROG) test19.ref
touch main.cf master.cf
echo forward_path='$$'aaaa >> main.cf
echo default_rbl_reply='$$'bbbb >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test19.tmp 2>&1
diff test19.ref test19.tmp
rm -f main.cf master.cf test19.tmp
@@ -292,6 +310,7 @@ test20: $(PROG) test20.ref
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o always_bcc=$$bar$$baz' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc . >test20.tmp 2>&1
diff test20.ref test20.tmp
rm -f main.cf master.cf test20.tmp
@@ -303,6 +322,7 @@ test21: $(PROG) test21.ref
touch main.cf master.cf
echo forward_path = xxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxx \
xxxxxxxxxxxxx xxxxxxxxxxxxxx >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nfc . >test21.tmp 2>&1
diff test21.ref test21.tmp
rm -f main.cf master.cf test21.tmp
@@ -313,6 +333,7 @@ test22: $(PROG) test22.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . 2>&1 | grep whatevershebrings >test22.tmp
diff test22.ref test22.tmp
rm -f main.cf master.cf test22.tmp
@@ -326,6 +347,7 @@ test23: $(PROG) test23.ref
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -nC builtin >test23.tmp 2>&1
diff test23.ref test23.tmp
rm -f main.cf master.cf test23.tmp
@@ -337,6 +359,7 @@ test24: $(PROG) test24.ref
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -nC user >test24.tmp 2>&1
diff test24.ref test24.tmp
rm -f main.cf master.cf test24.tmp
@@ -348,6 +371,7 @@ test25: $(PROG) test25.ref
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -C service 2>&1 | grep whatevershebrings >test25.tmp
diff test25.ref test25.tmp
rm -f main.cf master.cf test25.tmp
@@ -361,6 +385,7 @@ test26: $(PROG) test26.ref
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . -C all >test26.tmp 2>&1
diff test26.ref test26.tmp
rm -f main.cf master.cf test26.tmp
@@ -372,6 +397,7 @@ test27: $(PROG) test27.ref
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -c . -C all 2>&1 | grep whatevershebrings >test27.tmp
diff test27.ref test27.tmp
rm -f main.cf master.cf test27.tmp
@@ -392,6 +418,7 @@ test28: $(PROG) test28.ref
echo ' -o body_checks=$$db:zz' >> master.cf
echo 'zz_domain = whatever' >> main.cf
echo 'aa_domain = whatever' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test28.tmp 2>&1
diff test28.ref test28.tmp
rm -f main.cf master.cf test28.tmp
@@ -416,6 +443,7 @@ test29: $(PROG) test29.ref
echo 'memcachexx = proxy:memcache:memcachefoo' >> main.cf
echo 'memcachefoo_domain = bar' >> main.cf
echo 'memcachefoo_domainx = bar' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test29.tmp 2>&1
diff test29.ref test29.tmp
rm -f main.cf master.cf test29.tmp
@@ -432,6 +460,7 @@ test30: $(PROG) test30.ref
echo ' -o bodyx_checks=$$p2' >> master.cf
echo ' -oheader_checks=$$p3' >> master.cf
echo ' -oheaderx_checks=$$p4' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nc . >test30.tmp 2>&1
diff test30.ref test30.tmp
rm -f main.cf master.cf test30.tmp
@@ -443,6 +472,7 @@ test31: $(PROG) test31.ref
touch main.cf master.cf
echo 'smtpd_helo_restrictions=whatever' >> main.cf
echo 'smtpd_sender_restrictions=$$smtpd_helo_restrictions' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nxc . >test31.tmp 2>&1
diff test31.ref test31.tmp
rm -f main.cf master.cf test31.tmp
@@ -453,6 +483,7 @@ test32: $(PROG) test32.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'relay_domains=whatever' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -xc . fast_flush_domains >test32.tmp 2>&1
diff test32.ref test32.tmp
rm -f main.cf master.cf test32.tmp
@@ -464,6 +495,7 @@ test33: $(PROG) test33.ref
touch main.cf master.cf
echo 'mydestination=whatever' >> main.cf
echo 'always_bcc=$$relay_domains' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -xc . always_bcc >test33.tmp 2>&1
diff test33.ref test33.tmp
rm -f main.cf master.cf test33.tmp
@@ -474,6 +506,7 @@ test34: $(PROG) test34.ref
echo 'mydestination=whatever' >> main.cf
echo 'process_name=xxx' >> main.cf
echo 'process_id=yyy' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -xc . mydestination process_name >test34.tmp 2>&1
diff test34.ref test34.tmp
rm -f main.cf master.cf test34.tmp
@@ -485,6 +518,7 @@ test35: $(PROG) test35.ref
echo ' -o body_checks=whatever' >> master.cf
echo ' -o process_name=aaa' >> master.cf
echo ' -o process_id=bbb' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -xc . process_name >test35.tmp 2>&1
diff test35.ref test35.tmp
rm -f main.cf master.cf test35.tmp
@@ -494,6 +528,7 @@ test36: $(PROG) test36.ref
touch main.cf master.cf
echo 'mydestination=$$virtual_mapx' >> main.cf
echo 'virtual_alias_maps=$$virtual_maps' >> main.cf
+ touch -t 197101010000 main.cf
./$(PROG) -nxc . >test36.tmp 2>&1
diff test36.ref test36.tmp
rm -f main.cf master.cf test36.tmp
@@ -507,6 +542,7 @@ test37: $(PROG) test37.ref
echo ' -o mydestination=$$xxx' >> master.cf
echo ' -o always_bcc=$$aaa' >> master.cf
echo ' -o aaa=ccc' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfxc . >test37.tmp 2>&1
diff test37.ref test37.tmp
rm -f main.cf master.cf test37.tmp
@@ -517,6 +553,7 @@ test39: $(PROG) test39.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc . '*'/unix >test39.tmp 2>&1
diff test39.ref test39.tmp
rm -f main.cf master.cf test39.tmp
@@ -528,6 +565,7 @@ test40: $(PROG) test40.ref
echo ' -voaaa=bbb' >> master.cf
echo ' -vo ccc=$$aaa' >> master.cf
echo ' -v -oddd=$$ccc' >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfxc . '*'/unix >test40.tmp 2>&1
diff test40.ref test40.tmp
rm -f main.cf master.cf test40.tmp
@@ -538,6 +576,7 @@ test41: $(PROG) test41.ref
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Pc . bar/unix/xxx=yyy bar/unix/aaa=bbb >test41.tmp 2>&1
./$(PROG) -Mfc. >>test41.tmp 2>&1
./$(PROG) -Pc . bar/unix/xxx=YYY bar/unix/aaa=BBB >>test41.tmp 2>&1
@@ -552,6 +591,7 @@ test42: $(PROG) test42.ref
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Pc . bar/unix/xxx=yyy bar/unix/aaa=bbb >test42.tmp 2>&1
./$(PROG) -Mfc. >>test42.tmp 2>&1
./$(PROG) -Pc . >>test42.tmp 2>&1
@@ -566,6 +606,7 @@ test43: $(PROG) test43.ref
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Fc . bar/unix/chroot=y bar/unix/command='aa -stuffobb=cc dd' >test43.tmp 2>&1
./$(PROG) -Mfc. >>test43.tmp 2>&1
diff test43.ref test43.tmp
@@ -577,6 +618,7 @@ test44: $(PROG) test44.ref
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mc . bar/unix='xx inet - n n - 0 aa -stuffobb=cc dd' >test44.tmp 2>&1
./$(PROG) -Mfc. >>test44.tmp 2>&1
diff test44.ref test44.tmp
@@ -588,6 +630,7 @@ test45: $(PROG) test45.ref
echo foo unix - n n - 0 other >> master.cf
echo bar xxxx - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc. >test45.tmp 2>&1 || true
diff test45.ref test45.tmp
rm -f main.cf master.cf test45.tmp
@@ -598,6 +641,7 @@ test46: $(PROG) test46.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet X n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc. >test46.tmp 2>&1 || true
diff test46.ref test46.tmp
rm -f main.cf master.cf test46.tmp
@@ -608,6 +652,7 @@ test47: $(PROG) test47.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - X n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc. >test47.tmp 2>&1 || true
diff test47.ref test47.tmp
rm -f main.cf master.cf test47.tmp
@@ -618,6 +663,7 @@ test48: $(PROG) test48.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n X - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc. >test48.tmp 2>&1 || true
diff test48.ref test48.tmp
rm -f main.cf master.cf test48.tmp
@@ -628,6 +674,7 @@ test49: $(PROG) test49.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n X 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc. >test49.tmp 2>&1 || true
diff test49.ref test49.tmp
rm -f main.cf master.cf test49.tmp
@@ -638,6 +685,7 @@ test50: $(PROG) test50.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n - X other >> master.cf
echo baz unix - n n - 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc. >test50.tmp 2>&1 || true
diff test50.ref test50.tmp
rm -f main.cf master.cf test50.tmp
@@ -648,6 +696,7 @@ test51: $(PROG) test51.ref
echo foo unix - n n -? 0 other >> master.cf
echo bar inet - n n X? 0 other >> master.cf
echo baz unix - n n 0? 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -Mfc. >test51.tmp 2>&1 || true
diff test51.ref test51.tmp
rm -f main.cf master.cf test51.tmp
@@ -658,6 +707,7 @@ test52: $(PROG) test52.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -MXc. bar/inet foo/unix xxx/yyy
./$(PROG) -Mfc. >test52.tmp 2>&1 || true
diff test52.ref test52.tmp
@@ -669,6 +719,7 @@ test53: $(PROG) test53.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -M#c. bar/inet xxx/yyy
diff test53.ref master.cf
rm -f main.cf master.cf test53.tmp
@@ -679,6 +730,7 @@ test54: $(PROG) test54.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -M#c. bar/inet foo/unix
diff test54.ref master.cf
rm -f main.cf master.cf test54.tmp
@@ -689,6 +741,7 @@ test55: $(PROG) test55.ref
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -M#c. bar/inet baz/unix
diff test55.ref master.cf
rm -f main.cf master.cf test55.tmp
@@ -701,10 +754,41 @@ test56: $(PROG) test56.ref
echo " -o first" >> master.cf
echo " -o second" >> master.cf
echo baz unix - n n 0 0 other >> master.cf
+ touch -t 197101010000 main.cf
./$(PROG) -M#c. bar/inet xxx/yyy
diff test56.ref master.cf
rm -f main.cf master.cf test56.tmp
+# Many more tests in util/mac_expand.in.
+
+test57: $(PROG) test57.ref
+ rm -f main.cf master.cf
+ touch main.cf master.cf
+ echo 'x = $${{1} == {2}?{error}:x-value}' >> main.cf
+ echo 'y = y-value' >> main.cf
+ echo 'bar = $${x?{$$y}:$$z}' >> main.cf
+ echo 'baz = $${x?{$$z}:$$y}' >> main.cf
+ echo 'foo = $$bar$$baz' >> main.cf
+ echo 't1 = Postfix 2.11 $${{$${x?bug:x}} == {bug}?in}compatible' >> main.cf
+ echo 't2 = $$t1' >> main.cf
+ touch -t 197101010000 main.cf
+ ./$(PROG) -nxc. >test57.tmp 2>&1
+ diff test57.ref test57.tmp
+ rm -f main.cf master.cf test57.tmp
+
+test58: $(PROG) test58.ref
+ rm -f main.cf master.cf
+ touch main.cf master.cf
+ echo 'mydestination = foo bar pipemap:{ldap:xxx, memcache:yy} randmap:{xx' >> main.cf
+ echo 'xxx_domain = foo' >> main.cf
+ echo 'xxx_bogus = foo' >> main.cf
+ echo 'yy_backup = bbb' >> main.cf
+ echo 'yy_bogus = bbb' >> main.cf
+ touch -t 197101010000 main.cf
+ $(SHLIB_ENV) ./postconf -nc. >test58.tmp 2>&1 || true
+ diff test58.ref test58.tmp
+ rm -f main.cf master.cf test58.tmp
+
printfck: $(OBJS) $(PROG)
rm -rf printfck
mkdir printfck
@@ -812,6 +896,8 @@ postconf_dbms.o: ../../include/htable.h
postconf_dbms.o: ../../include/mac_expand.h
postconf_dbms.o: ../../include/mac_parse.h
postconf_dbms.o: ../../include/mail_conf.h
+postconf_dbms.o: ../../include/mail_params.h
+postconf_dbms.o: ../../include/msg.h
postconf_dbms.o: ../../include/myflock.h
postconf_dbms.o: ../../include/name_code.h
postconf_dbms.o: ../../include/split_at.h
diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c
index c5251b8fc..016304f1a 100644
--- a/postfix/src/postconf/postconf.c
+++ b/postfix/src/postconf/postconf.c
@@ -268,25 +268,26 @@
/* PostgreSQL database client. This is described in
/* \fBpgsql_table\fR(5).
/* .IP "\fBpipemap\fR (read-only)"
-/* A pipeline of lookup tables. Example:
-/* "\fBpipemap:\fI!type_1:name_1! ... !type_n:name_n\fR".
+/* A lookup table that constructs a pipeline of tables. Example:
+/* "\fBpipemap:{\fItype_1:name_1, ..., type_n:name_n\fB}\fR".
/* Each "pipemap:" query is given to the first table. Each
/* lookup result becomes the query for the next table in the
/* pipeline, and the last table produces the final result.
/* When any table lookup produces no result, the pipeline
-/* produces no result. The first ASCII character after "pipemap:"
-/* will be used as the separator between the lookup tables
-/* that follow (do not use space, ",", ":" or non-ASCII).
+/* produces no result. The first and last characters of the
+/* "pipemap:" table name must be "\fB{\fR" and "\fB}\fR".
+/* Within these, individual maps are separated with comma or
+/* whitespace.
/* .IP "\fBproxy\fR"
/* Postfix \fBproxymap\fR(8) client for shared access to Postfix
/* databases. The table name syntax is \fItype\fB:\fIname\fR.
/* .IP "\fBrandmap\fR (read-only)"
/* An in-memory table that performs random selection. Example:
-/* "\fBrandmap:\fI!result_1! ... !result_n\fR". Each table query
+/* "\fBrandmap:{\fIresult_1, ..., result_n\fB}\fR". Each table query
/* returns a random choice from the specified results. The first
-/* ASCII character after "randmap:" will be used as the separator
-/* between the results that follow (do not use space, ",", ":"
-/* or non-ASCII).
+/* and last characters of the "randmap:" table name must be
+/* "\fB{\fR" and "\fB}\fR". Within these, individual maps are
+/* separated with comma or whitespace.
/* .IP "\fBregexp\fR (read-only)"
/* A lookup table based on regular expressions. The file format
/* is described in \fBregexp_table\fR(5).
diff --git a/postfix/src/postconf/postconf.h b/postfix/src/postconf/postconf.h
index f174d164c..178a237f9 100644
--- a/postfix/src/postconf/postconf.h
+++ b/postfix/src/postconf/postconf.h
@@ -288,7 +288,7 @@ extern char *pcf_expand_parameter_value(VSTRING *, int, const char *,
/*
* postconf_print.c.
*/
-extern void pcf_print_line(VSTREAM *, int, const char *,...);
+extern void PRINTFLIKE(3, 4) pcf_print_line(VSTREAM *, int, const char *,...);
/*
* postconf_unused.c.
diff --git a/postfix/src/postconf/postconf_builtin.c b/postfix/src/postconf/postconf_builtin.c
index ba53d050d..b07f5bb64 100644
--- a/postfix/src/postconf/postconf_builtin.c
+++ b/postfix/src/postconf/postconf_builtin.c
@@ -223,12 +223,11 @@ static const char *pcf_check_mydomainname(void)
return (domain);
/*
- * Use the hostname when it is not a FQDN ("foo"), or when the hostname
- * actually is a domain name ("foo.com").
+ * Use a default domain when the hostname is not a FQDN ("foo").
*/
if (var_myhostname == 0)
pcf_get_myhostname();
- if ((dot = strchr(var_myhostname, '.')) == 0 || strchr(dot + 1, '.') == 0)
+ if ((dot = strchr(var_myhostname, '.')) == 0)
return (domain = DEF_MYDOMAIN);
return (domain = mystrdup(dot + 1));
}
diff --git a/postfix/src/postconf/postconf_dbms.c b/postfix/src/postconf/postconf_dbms.c
index 883d4368c..a618fdac7 100644
--- a/postfix/src/postconf/postconf_dbms.c
+++ b/postfix/src/postconf/postconf_dbms.c
@@ -54,10 +54,12 @@
#include