From: Wietse Venema
Line 12: specify smtpd_policy_service_request_limit to +avoid error-recovery delays with policy servers that cannot +maintain a persistent connection.
+With Solaris < 9, or Postfix < 2.10 on any Solaris version, use TCP sockets instead of UNIX-domain sockets:
@@ -323,11 +328,12 @@ version, use TCP sockets instead of UNIX-domain sockets: 9 check_policy_service inet:127.0.0.1:9998 10 ... 11 127.0.0.1:9998_time_limit = 3600 +12 # smtpd_policy_service_request_limit = 1 -Other configuration parameters that control the client side of -the policy delegation protocol:
+Configuration parameters that control the client side of the +policy delegation protocol:
smtpd_policy_service_timeout (default: 100s): The time limit to connect to, send to or receive from a policy server.
+smtpd_policy_service_request_limit (default: 0): The maximal +number of requests per policy connection, or zero (no limit).
+ +Configuration parameters that control the server side of the +policy delegation protocol:
+ +transport_time_limit ($command_time_limit): The +maximal amount of time the policy daemon is allowed to run before +it is terminated. The transport is the service name of the +master.cf entry for the policy daemon service. In the above +examples, the service name is "policy" or "127.0.0.1:9998".
+Line 12: specify smtpd_policy_service_request_limit to +avoid error-recovery delays with policy servers that cannot +maintain a persistent connection.
+With Solaris < 9, or Postfix < 2.10 on any Solaris @@ -473,6 +500,7 @@ client/server configuration" section above.
9 reject_unauth_destination 10 check_policy_service inet:127.0.0.1:9998 11 ... +12 # smtpd_policy_service_request_limit = 1 diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html index f5969b753..bf2ddd9eb 100644 --- a/postfix/html/postconf.1.html +++ b/postfix/html/postconf.1.html @@ -253,46 +253,47 @@ POSTCONF(1) POSTCONF(1) PostgreSQL database client. This is described in pgsql_table(5). - pipeline (read-only) - A pipeline of lookup tables. Example: "pipe- - line:!type_1:name_1! ... !type_n:name_n". Each "pipe- - line:" query is given to the first table. Each lookup - result becomes the query for the next table in the pipe- - line, and the last table produces the final result. When - any table lookup produces no result, the pipeline pro- - duces no result. The ASCII character after "pipeline:" - will be used as the separator between the lookup tables - that follow (do not use space, ",", ":" or non-ASCII). - - proxy Postfix proxymap(8) client for shared access to Postfix + pipemap (read-only) + A pipeline of lookup tables. Example: + "pipemap:!type_1:name_1! ... !type_n:name_n". 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). + + proxy Postfix proxymap(8) client for shared access to Postfix databases. The table name syntax is type:name. - random (read-only) - An in-memory table that performs random selection. Exam- - ple: "random:!result_1! ... !result_n". Each table query - returns a random choice from the specified results. The - ASCII character after "random:" will be used as the sepa- - rator between the results that follow (do not use space, - ",", ":" or non-ASCII). + randmap (read-only) + An in-memory table that performs random selection. Exam- + ple: "randmap:!result_1! ... !result_n". 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). regexp (read-only) - A lookup table based on regular expressions. The file + A lookup table based on regular expressions. The file format is described in regexp_table(5). sdbm An indexed file type based on hashing. Available on sys- tems with support for SDBM databases. socketmap (read-only) - Sendmail-style socketmap client. The table name is - inet:host:port:name for a TCP/IP server, or unix:path- - name:name for a UNIX-domain server. This is described in + Sendmail-style socketmap client. The table name is + inet:host:port:name for a TCP/IP server, or unix:path- + name:name for a UNIX-domain server. This is described in socketmap_table(5). sqlite (read-only) SQLite database. This is described in sqlite_table(5). static (read-only) - A table that always returns its name as lookup result. + A table that always returns its name as lookup result. For example, static:foobar always returns the string foo- bar as lookup result. @@ -300,48 +301,48 @@ POSTCONF(1) POSTCONF(1) TCP/IP client. The protocol is described in tcp_table(5). texthash (read-only) - Produces similar results as hash: files, except that you - don't need to run the postmap(1) command before you can - use the file, and that it does not detect changes after + Produces similar results as hash: files, except that you + don't need to run the postmap(1) command before you can + use the file, and that it does not detect changes after the file is read. unix (read-only) - A limited view of the UNIX authentication database. The + A limited view of the UNIX authentication database. The following tables are implemented: unix:passwd.byname - The table is the UNIX password database. The key - is a login name. The result is a password file + The table is the UNIX password database. The key + is a login name. The result is a password file entry in passwd(5) format. unix:group.byname The table is the UNIX group database. The key is a - group name. The result is a group file entry in + group name. The result is a group file entry in group(5) format. - Other table types may exist depending on how Postfix was built. + Other table types may exist depending on how Postfix was built. - -M Show master.cf file contents instead of main.cf file contents. + -M Show master.cf file contents instead of main.cf file contents. Specify -Mf to fold long lines for human readability. Specify zero or more arguments, each with a service-name or ser- - vice-name/service-type pair, where service-name is the first - field of a master.cf entry and service-type is one of (inet, + vice-name/service-type pair, where service-name is the first + field of a master.cf entry and service-type is one of (inet, unix, fifo, or pass). - If service-name or service-name/service-type is specified, only - the matching master.cf entries will be output. For example, - "postconf -Mf smtp" will output all services named "smtp", and - "postconf -Mf smtp/inet" will output only the smtp service that - listens on the network. Trailing service type fields that are + If service-name or service-name/service-type is specified, only + the matching master.cf entries will be output. For example, + "postconf -Mf smtp" will output all services named "smtp", and + "postconf -Mf smtp/inet" will output only the smtp service that + listens on the network. Trailing service type fields that are omitted will be handled as "*" wildcard fields. This feature is available with Postfix 2.9 and later. The syntax - was changed from "name.type" to "name/type", and "*" wildcard + was changed from "name.type" to "name/type", and "*" wildcard support was added with Postfix 2.11. -n Show only configuration parameters that have explicit name=value - settings in main.cf. Specify -nf to fold long lines for human + settings in main.cf. Specify -nf to fold long lines for human readability (Postfix 2.9 and later). -o name=value @@ -353,50 +354,50 @@ POSTCONF(1) POSTCONF(1) This feature is available with Postfix 2.11 and later. - -P Show master.cf service parameter settings (by default all ser- + -P Show master.cf service parameter settings (by default all ser- vices and all parameters). formatted as one "ser- - vice/type/parameter=value" per line. Specify -Pf to fold long + vice/type/parameter=value" per line. Specify -Pf to fold long lines. - Specify one or more "service/type/parameter" instances on the - postconf(1) command line to limit the output to parameters of - interest. Trailing parameter name or service type fields that + Specify one or more "service/type/parameter" instances on the + postconf(1) command line to limit the output to parameters of + interest. Trailing parameter name or service type fields that are omitted will be handled as "*" wildcard fields. This feature is available with Postfix 2.11 and later. -t [template_file] - Display the templates for text that appears at the beginning of - delivery status notification (DSN) messages, without expanding + Display the templates for text that appears at the beginning of + delivery status notification (DSN) messages, without expanding $name expressions. To override the built-in templates, specify a template file name - at the end of the postconf(1) command line, or specify a file + at the end of the postconf(1) command line, or specify a file name in main.cf with the bounce_template_file parameter. - To force selection of the built-in templates, specify an empty - template file name on the postconf(1) command line (in shell + To force selection of the built-in templates, specify an empty + template file name on the postconf(1) command line (in shell language: ""). This feature is available with Postfix 2.3 and later. - -v Enable verbose logging for debugging purposes. Multiple -v + -v Enable verbose logging for debugging purposes. Multiple -v options make the software increasingly verbose. - -x Expand $name in main.cf or master.cf parameter values. The + -x Expand $name in main.cf or master.cf parameter values. The expansion is recursive. This feature is available with Postfix 2.10 and later. - -X Edit the main.cf configuration file, and remove the parameters + -X Edit the main.cf configuration file, and remove the parameters named on the postconf(1) command line. Specify a list of param- eter names, not "name=value" pairs. - With -M, edit the master.cf configuration file, and remove one - or more service entries as specified with "service/type" on the + With -M, edit the master.cf configuration file, and remove one + or more service entries as specified with "service/type" on the postconf(1) command line. - With -P, edit the master.cf configuration file, and remove one + With -P, edit the master.cf configuration file, and remove one or more service parameter settings (-o parameter=value settings) as specied with "service/type/parameter" on the postconf(1) com- mand line. @@ -405,10 +406,10 @@ POSTCONF(1) POSTCONF(1) into place. Specify quotes to protect special characters on the postconf(1) command line. - There is no postconf(1) command to perform the reverse opera- + There is no postconf(1) command to perform the reverse opera- tion. - This feature is available with Postfix 2.10 and later. Support + This feature is available with Postfix 2.10 and later. Support for -M and -P was added with Postfix 2.11. -# Edit the main.cf configuration file, and comment out the parame- @@ -416,18 +417,18 @@ POSTCONF(1) POSTCONF(1) eters revert to their default values. Specify a list of parame- ter names, not "name=value" pairs. - With -M, edit the master.cf configuration file, and comment out - one or more service entries as specified with "service/type" on + With -M, edit the master.cf configuration file, and comment out + one or more service entries as specified with "service/type" on the postconf(1) command line. In all cases the file is copied to a temporary file then renamed into place. Specify quotes to protect special characters on the postconf(1) command line. - There is no postconf(1) command to perform the reverse opera- + There is no postconf(1) command to perform the reverse opera- tion. - This feature is available with Postfix 2.6 and later. Support + This feature is available with Postfix 2.6 and later. Support for -M was added with Postfix 2.11. DIAGNOSTICS @@ -438,18 +439,18 @@ POSTCONF(1) POSTCONF(1) Directory with Postfix configuration files. CONFIGURATION PARAMETERS - The following main.cf parameters are especially relevant to this pro- + The following main.cf parameters are especially relevant to this pro- gram. - The text below provides only a parameter summary. See postconf(5) for + The text below provides only a parameter summary. See postconf(5) for 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. bounce_template_file (empty) - Pathname of a configuration file with bounce message templates. + Pathname of a configuration file with bounce message templates. FILES /etc/postfix/main.cf, Postfix configuration parameters diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 5c3873c3c..832cfb1d0 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -14113,6 +14113,25 @@ This feature is available in Postfix 2.1 and later. + + ++The maximal number of requests per Postfix SMTP server policy +connection, or zero (no limit). Once a connection reaches this +limit, the connection is closed and the next request will be sent +over a new connection. This is a workaround to avoid error-recovery +delays with policy servers that cannot maintain a persistent +connection. +
+ ++This feature is available in Postfix 2.12 and later. +
+ +Line 12: specify smtpd_policy_service_request_limit to +avoid error-recovery delays with policy servers that cannot +maintain a persistent connection.
+With Solaris < 9, or Postfix < 2.10 on any Solaris version, use TCP sockets instead of UNIX-domain sockets:
@@ -323,11 +328,12 @@ version, use TCP sockets instead of UNIX-domain sockets: 9 check_policy_service inet:127.0.0.1:9998 10 ... 11 127.0.0.1:9998_time_limit = 3600 +12 # smtpd_policy_service_request_limit = 1 -Other configuration parameters that control the client side of -the policy delegation protocol:
+Configuration parameters that control the client side of the +policy delegation protocol:
smtpd_policy_service_timeout (default: 100s): The time limit to connect to, send to or receive from a policy server.
+smtpd_policy_service_request_limit (default: 0): The maximal +number of requests per policy connection, or zero (no limit).
+ +Configuration parameters that control the server side of the +policy delegation protocol:
+ +transport_time_limit ($command_time_limit): The +maximal amount of time the policy daemon is allowed to run before +it is terminated. The transport is the service name of the +master.cf entry for the policy daemon service. In the above +examples, the service name is "policy" or "127.0.0.1:9998".
+Line 12: specify smtpd_policy_service_request_limit to +avoid error-recovery delays with policy servers that cannot +maintain a persistent connection.
+With Solaris < 9, or Postfix < 2.10 on any Solaris @@ -473,6 +500,7 @@ client/server configuration
+The maximal number of requests per Postfix SMTP server policy +connection, or zero (no limit). Once a connection reaches this +limit, the connection is closed and the next request will be sent +over a new connection. This is a workaround to avoid error-recovery +delays with policy servers that cannot maintain a persistent +connection. +
+ ++This feature is available in Postfix 2.12 and later. +
+ %PARAM smtpd_reject_unlisted_recipient yesdiff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 9e345d80a..e96d165a5 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -2884,6 +2884,10 @@ extern char *var_smtpd_input_transp; #define DEF_SMTPD_POLICY_TMOUT "100s" extern int var_smtpd_policy_tmout; +#define VAR_SMTPD_POLICY_REQ_LIMIT "smtpd_policy_service_request_limit" +#define DEF_SMTPD_POLICY_REQ_LIMIT 0 +extern int var_smtpd_policy_req_limit; + #define VAR_SMTPD_POLICY_IDLE "smtpd_policy_service_max_idle" #define DEF_SMTPD_POLICY_IDLE "300s" extern int var_smtpd_policy_idle; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 497be7128..66222c83a 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 "20140629" +#define MAIL_RELEASE_DATE "20140701" #define MAIL_VERSION_NUMBER "2.12" #ifdef SNAPSHOT diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 127de63e1..c5251b8fc 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -267,24 +267,24 @@ /* .IP "\fBpgsql\fR (read-only)" /* PostgreSQL database client. This is described in /* \fBpgsql_table\fR(5). -/* .IP "\fBpipeline\fR (read-only)" +/* .IP "\fBpipemap\fR (read-only)" /* A pipeline of lookup tables. Example: -/* "\fBpipeline:\fI!type_1:name_1! ... !type_n:name_n\fR". -/* Each "pipeline:" query is given to the first table. Each +/* "\fBpipemap:\fI!type_1:name_1! ... !type_n:name_n\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 ASCII character after "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). /* .IP "\fBproxy\fR" /* Postfix \fBproxymap\fR(8) client for shared access to Postfix /* databases. The table name syntax is \fItype\fB:\fIname\fR. -/* .IP "\fBrandom\fR (read-only)" +/* .IP "\fBrandmap\fR (read-only)" /* An in-memory table that performs random selection. Example: -/* "\fBrandom:\fI!result_1! ... !result_n\fR". Each table query -/* returns a random choice from the specified results. The -/* ASCII character after "random:" will be used as the separator +/* "\fBrandmap:\fI!result_1! ... !result_n\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). /* .IP "\fBregexp\fR (read-only)" diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index d19bbde91..4b8a6ba2b 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -720,6 +720,11 @@ /* .IP "\fBsmtpd_policy_service_timeout (100s)\fR" /* The time limit for connecting to, writing to or receiving from a /* delegated SMTPD policy server. +/* .PP +/* Available in Postfix version 2.12 and later: +/* .IP "\fBsmtpd_policy_service_request_limit (0)\fR" +/* The maximal number of requests per Postfix SMTP server policy +/* connection, or zero (no limit). /* ACCESS CONTROLS /* .ad /* .fi @@ -1224,6 +1229,7 @@ char *var_smtpd_proxy_ehlo; char *var_smtpd_proxy_opts; char *var_input_transp; int var_smtpd_policy_tmout; +int var_smtpd_policy_req_limit; int var_smtpd_policy_idle; int var_smtpd_policy_ttl; char *var_xclient_hosts; @@ -5320,6 +5326,7 @@ int main(int argc, char **argv) #ifdef USE_TLS VAR_SMTPD_TLS_CCERT_VD, DEF_SMTPD_TLS_CCERT_VD, &var_smtpd_tls_ccert_vd, 0, 0, #endif + VAR_SMTPD_POLICY_REQ_LIMIT, DEF_SMTPD_POLICY_REQ_LIMIT, &var_smtpd_policy_req_limit, 0, 0, 0, }; static const CONFIG_TIME_TABLE time_table[] = { diff --git a/postfix/src/smtpd/smtpd_check.c b/postfix/src/smtpd/smtpd_check.c index 8ba92cbc3..2774650a0 100644 --- a/postfix/src/smtpd/smtpd_check.c +++ b/postfix/src/smtpd/smtpd_check.c @@ -456,15 +456,20 @@ double smtpd_space_multf = 1.5; static void policy_client_register(const char *name) { + ATTR_CLNT *client; + if (policy_clnt_table == 0) policy_clnt_table = htable_create(1); - if (htable_find(policy_clnt_table, name) == 0) - htable_enter(policy_clnt_table, name, - (char *) attr_clnt_create(name, - var_smtpd_policy_tmout, - var_smtpd_policy_idle, - var_smtpd_policy_ttl)); + if (htable_find(policy_clnt_table, name) == 0) { + client = attr_clnt_create(name, + var_smtpd_policy_tmout, + var_smtpd_policy_idle, + var_smtpd_policy_ttl); + attr_clnt_control(client, ATTR_CLNT_CTL_REQ_LIMIT, + var_smtpd_policy_req_limit, ATTR_CLNT_CTL_END); + htable_enter(policy_clnt_table, name, (char *) client); + } } /* smtpd_check_parse - pre-parse restrictions */ diff --git a/postfix/src/util/attr_clnt.c b/postfix/src/util/attr_clnt.c index 62b225bbf..ed8dddcd9 100644 --- a/postfix/src/util/attr_clnt.c +++ b/postfix/src/util/attr_clnt.c @@ -54,6 +54,9 @@ /* .IP "ATTR_CLNT_CTL_PROTO(ATTR_CLNT_PRINT_FN, ATTR_CLNT_SCAN_FN)" /* Specifies alternatives for the attr_plain_print() and /* attr_plain_scan() functions. +/* .IP "ATTR_CLNT_CTL_REQ_LIMIT(int)" +/* The maximal number of requests per connection. To enable +/* the limit, specify a value greater than zero. /* DIAGNOSTICS /* Warnings: communication failure. /* SEE ALSO @@ -95,6 +98,8 @@ struct ATTR_CLNT { AUTO_CLNT *auto_clnt; ATTR_CLNT_PRINT_FN print; ATTR_CLNT_SCAN_FN scan; + int req_limit; + int req_count; }; /* attr_clnt_free - destroy attribute client */ @@ -116,6 +121,8 @@ ATTR_CLNT *attr_clnt_create(const char *service, int timeout, client->auto_clnt = auto_clnt_create(service, timeout, max_idle, max_ttl); client->scan = attr_vscan_plain; client->print = attr_vprint_plain; + client->req_limit = 0; + client->req_count = 0; return (client); } @@ -188,8 +195,14 @@ int attr_clnt_request(ATTR_CLNT *client, int send_flags,...) ret = client->scan(stream, recv_flags, ap); va_end(ap); /* Finalize argument lists before returning. */ - if (ret > 0) + if (ret > 0) { + if (client->req_limit > 0 + && (client->req_count += 1) >= client->req_limit) { + auto_clnt_recover(client->auto_clnt); + client->req_count = 0; + } break; + } } } if (++count >= 2 @@ -204,6 +217,7 @@ int attr_clnt_request(ATTR_CLNT *client, int send_flags,...) } sleep(1); /* XXX make configurable */ auto_clnt_recover(client->auto_clnt); + client->req_count = 0; } /* Finalize argument lists before returning. */ va_end(saved_ap); @@ -223,6 +237,11 @@ void attr_clnt_control(ATTR_CLNT *client, int name,...) client->print = va_arg(ap, ATTR_CLNT_PRINT_FN); client->scan = va_arg(ap, ATTR_CLNT_SCAN_FN); break; + case ATTR_CLNT_CTL_REQ_LIMIT: + client->req_limit = va_arg(ap, int); + if (msg_verbose) + msg_info("%s: new request limit %d", myname, client->req_limit); + break; default: msg_panic("%s: bad name %d", myname, name); } diff --git a/postfix/src/util/attr_clnt.h b/postfix/src/util/attr_clnt.h index 0a752094e..fac4a5b0f 100644 --- a/postfix/src/util/attr_clnt.h +++ b/postfix/src/util/attr_clnt.h @@ -35,6 +35,7 @@ extern void attr_clnt_control(ATTR_CLNT *, int, ...); #define ATTR_CLNT_CTL_END 0 #define ATTR_CLNT_CTL_PROTO 1 +#define ATTR_CLNT_CTL_REQ_LIMIT 2 /* LICENSE /* .ad diff --git a/postfix/src/util/dict_open.c b/postfix/src/util/dict_open.c index d5ed9ce2f..48ae556d8 100644 --- a/postfix/src/util/dict_open.c +++ b/postfix/src/util/dict_open.c @@ -343,7 +343,13 @@ static const DICT_OPEN_INFO dict_open_info[] = { DICT_TYPE_SOCKMAP, dict_sockmap_open, DICT_TYPE_FAIL, dict_fail_open, DICT_TYPE_PIPE, dict_pipe_open, +#ifdef DICT_TYPE_PIPE_LEGACY + DICT_TYPE_PIPE_LEGACY, dict_pipe_open, +#endif DICT_TYPE_RANDOM, dict_random_open, +#ifdef DICT_TYPE_RANDOM_LEGACY + DICT_TYPE_RANDOM_LEGACY, dict_random_open, +#endif #ifndef USE_DYNAMIC_MAPS #ifdef HAS_PCRE DICT_TYPE_PCRE, dict_pcre_open, diff --git a/postfix/src/util/dict_pipe.c b/postfix/src/util/dict_pipe.c index de8f086d8..37c4f37b0 100644 --- a/postfix/src/util/dict_pipe.c +++ b/postfix/src/util/dict_pipe.c @@ -12,15 +12,15 @@ /* int dict_flags; /* DESCRIPTION /* dict_pipe_open() opens a pipeline of one or more tables. -/* Example: "\fBpipeline:\fI!type_1:name_1! ... !type_n:name_n\fR". +/* Example: "\fBpipemap:\fI!type_1:name_1! ... !type_n:name_n\fR". /* -/* Each "pipeline:" query is given to the first table. Each +/* 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 ASCII character after "pipeline:" will be used as the +/* The ASCII character after "pipemap:" will be used as the /* separator between the lookup tables that follow (do not use /* space, ",", ":" or non-ASCII). /* @@ -116,6 +116,11 @@ DICT *dict_pipe_open(const char *name, int open_flags, int dict_flags) struct DICT_OWNER aggr_owner; char delim[2]; +#ifdef DICT_TYPE_PIPE_LEGACY + msg_warn("obsolete dictionary type: \"%s\"; use \"%s\" instead", + DICT_TYPE_PIPE_LEGACY, DICT_TYPE_PIPE); +#endif + /* * Clarity first. Let the optimizer worry about redundant code. */ diff --git a/postfix/src/util/dict_pipe.h b/postfix/src/util/dict_pipe.h index 442fd4a84..fb0578e1f 100644 --- a/postfix/src/util/dict_pipe.h +++ b/postfix/src/util/dict_pipe.h @@ -19,7 +19,11 @@ /* * External interface. */ -#define DICT_TYPE_PIPE "pipeline" +#define DICT_TYPE_PIPE "pipemap" + +#ifdef SNAPSHOT +#define DICT_TYPE_PIPE_LEGACY "pipeline" +#endif extern DICT *dict_pipe_open(const char *, int, int); diff --git a/postfix/src/util/dict_random.c b/postfix/src/util/dict_random.c index e085b2005..0f1f07a29 100644 --- a/postfix/src/util/dict_random.c +++ b/postfix/src/util/dict_random.c @@ -12,12 +12,12 @@ /* int dict_flags; /* DESCRIPTION /* dict_random_open() opens an in-memory, read-only, table. -/* Example: "\fBrandom:\fI!result_1! ... !result_n\fR". +/* Example: "\fBrandmap:\fI!result_1! ... !result_n\fR". /* /* Each table query returns a random choice from the specified /* results. Other table access methods are not supported. /* -/* The ASCII character after "random:" will be used as the +/* The ASCII character after "randmap:" will be used as the /* separator between the results that follow (do not use space, /* ",", ":" or non-ASCII). /* SEE ALSO @@ -82,6 +82,11 @@ DICT *dict_random_open(const char *name, int open_flags, int dict_flags) char *saved_name = 0; char delim[2]; +#ifdef DICT_TYPE_RANDOM_LEGACY + msg_warn("obsolete dictionary type: \"%s\"; use \"%s\" instead", + DICT_TYPE_RANDOM_LEGACY, DICT_TYPE_RANDOM); +#endif + /* * Clarity first. Let the optimizer worry about redundant code. */ diff --git a/postfix/src/util/dict_random.h b/postfix/src/util/dict_random.h index 374f8537e..fd16e9570 100644 --- a/postfix/src/util/dict_random.h +++ b/postfix/src/util/dict_random.h @@ -19,7 +19,11 @@ /* * External interface. */ -#define DICT_TYPE_RANDOM "random" +#define DICT_TYPE_RANDOM "randmap" + +#ifdef SNAPSHOT +#define DICT_TYPE_RANDOM_LEGACY "random" +#endif extern DICT *dict_random_open(const char *, int, int);