From: Wietse Venema
Line 11: this increases the time that a policy server -process is allowed to run from the default 1000 seconds to 3600 -seconds. The default time limit is too short for a policy daemon -that needs to run long as the SMTP server process that talks to it. +process may run to 3600 seconds. The default time limit of 1000 +seconds is too short; the policy daemon needs to run long as the +SMTP server process that talks to it. See the spawn(8) manpage for more information about the transport_time_limit parameter.
-Note: the "policy_time_limit" parameter will not +
Note: the "policy_time_limit" parameter will not show up in "postconf" command output before Postfix version 2.9. This limitation applies to many parameters whose name is a combination of a master.cf service name (in the above example, "policy") and a @@ -401,7 +401,7 @@ processes only:
3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: - 6 greylist_time_limit = 3600 + 6 greylist_time_limit = 3600 7 smtpd_recipient_restrictions = 8 ... 9 reject_unauth_destination @@ -428,13 +428,13 @@ increase the smtpd process limit. each request and reply.Line 6: this increases the time that a greylist server -process is allowed to run from the default 1000 seconds to 3600 -seconds. The default time limit is too short for a greylist daemon -that needs to run long as the SMTP server process that talks to it. +process may run to 3600 seconds. The default time limit of 1000 +seconds is too short; the greylist daemon needs to run long as the +SMTP server process that talks to it. See the spawn(8) manpage for more information about the transport_time_limit parameter.
-Note: the "greylist_time_limit" parameter will not +
Note: the "greylist_time_limit" parameter will not show up in "postconf" command output before Postfix version 2.9. This limitation applies to many parameters whose name is a combination of a master.cf service name (in the above example, "greylist") and diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html index dcbd5e177..5e6c368e0 100644 --- a/postfix/html/postconf.1.html +++ b/postfix/html/postconf.1.html @@ -12,7 +12,8 @@ POSTCONF(1) POSTCONF(1) SYNOPSIS Managing main.cf: - postconf [-dfhnv] [-c config_dir] [parameter ...] + postconf [-dfhnv] [-c config_dir] [-C class] [parameter + ...] postconf [-ev] [-c config_dir] [parameter=value ...] @@ -34,122 +35,137 @@ POSTCONF(1) POSTCONF(1) By default, the postconf(1) command displays the values of main.cf configuration parameters, and warns about possible mis-typed parameter names (Postfix 2.9 and later). It can - also change main.cf configuration parameter values, or - display other configuration information about the Postfix + also change main.cf configuration parameter values, or + display other configuration information about the Postfix mail system. Options: - -a List the available SASL server plug-in types. The - SASL plug-in type is selected with the + -a List the available SASL server plug-in types. The + SASL plug-in type is selected with the smtpd_sasl_type configuration parameter by specify- ing one of the names listed below. - cyrus This server plug-in is available when Post- + cyrus This server plug-in is available when Post- fix is built with Cyrus SASL support. dovecot This server plug-in uses the Dovecot authen- tication server, and is available when Post- - fix is built with any form of SASL support. + fix is built with any form of SASL support. - This feature is available with Postfix 2.3 and + This feature is available with Postfix 2.3 and later. - -A List the available SASL client plug-in types. The - SASL plug-in type is selected with the - smtp_sasl_type or lmtp_sasl_type configuration - parameters by specifying one of the names listed + -A List the available SASL client plug-in types. The + SASL plug-in type is selected with the + smtp_sasl_type or lmtp_sasl_type configuration + parameters by specifying one of the names listed below. - cyrus This client plug-in is available when Post- + cyrus This client plug-in is available when Post- fix is built with Cyrus SASL support. - This feature is available with Postfix 2.3 and + This feature is available with Postfix 2.3 and later. -b [template_file] Display the message text that appears at the begin- - ning of delivery status notification (DSN) mes- + ning of delivery status notification (DSN) mes- sages, replacing $name expressions with actual val- ues as described in bounce(5). - To override the built-in templates, specify a tem- - plate file name at the end of the postconf(1) com- - mand line, or specify a file name in main.cf with + To override the built-in templates, specify a tem- + plate file name at the end of the postconf(1) com- + mand line, or specify a file name in main.cf with the bounce_template_file parameter. To force selection of the built-in templates, spec- - ify an empty template file name on the postconf(1) + ify an empty template file name on the postconf(1) command line (in shell language: ""). - This feature is available with Postfix 2.3 and + This feature is available with Postfix 2.3 and later. -c config_dir - The main.cf configuration file is in the named + The main.cf configuration file is in the named directory instead of the default configuration directory. + -C class,... + When displaying main.cf parameters, select only + parameters from the specified class(es), specified + as a comma-separated list: + + builtin + Parameters with built-in names. + + service + Parameters with service-defined names (the + first field of a master.cf entry plus a + Postfix-defined suffix). + + user Parameters with user-defined names. + -d Print main.cf default parameter settings instead of - actual settings. Specify -df to fold long lines + actual settings. Specify -df to fold long lines for human readability (Postfix 2.9 and later). - -e Edit the main.cf configuration file, and update - parameter settings with the "name=value" pairs on + -e Edit the main.cf configuration file, and update + parameter settings with the "name=value" pairs on the postconf(1) 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 on the postconf(1) command line. The -e is no longer needed with Postfix version 2.8 and later. - -f Fold long lines when printing main.cf or master.cf - configuration file entries, for human readability. + -f Fold long lines when printing main.cf or master.cf + configuration file entries, for human readability. - This feature is available with Postfix 2.9 and + This feature is available with Postfix 2.9 and later. -h Show main.cf parameter values without the "name = " label that normally precedes the value. - -l List the names of all supported mailbox locking + -l List the names of all supported mailbox locking methods. Postfix supports the following methods: - flock A kernel-based advisory locking method for - local files only. This locking method is - available on systems with a BSD compatible + flock A kernel-based advisory locking method for + local files only. This locking method is + available on systems with a BSD compatible library. - fcntl A kernel-based advisory locking method for + fcntl A kernel-based advisory locking method for local and remote files. dotlock - An application-level locking method. An - application locks a file named filename by - creating a file named filename.lock. The - application is expected to remove its own - lock file, as well as stale lock files that + An application-level locking method. An + application locks a file named filename by + creating a file named filename.lock. The + application is expected to remove its own + lock file, as well as stale lock files that were left behind after abnormal termination. -m List the names of all supported lookup table types. - In Postfix configuration files, lookup tables are - specified as type:name, where type is one of the - types listed below. The table name syntax depends - on the lookup table type as described in the DATA- + In Postfix configuration files, lookup tables are + specified as type:name, where type is one of the + types listed below. The table name syntax depends + on the lookup table type as described in the DATA- BASE_README document. - btree A sorted, balanced tree structure. This is + btree A sorted, balanced tree structure. This is available on systems with support for Berke- ley DB databases. - cdb A read-optimized structure with no support - for incremental updates. This is available + cdb A read-optimized structure with no support + for incremental updates. This is available on systems with support for CDB databases. - cidr A table that associates values with Class- - less Inter-Domain Routing (CIDR) patterns. + cidr A table that associates values with Class- + less Inter-Domain Routing (CIDR) patterns. This is described in cidr_table(5). dbm An indexed file type based on hashing. This @@ -158,12 +174,12 @@ POSTCONF(1) POSTCONF(1) environ The UNIX process environment array. The - lookup key is the variable name. Originally - implemented for testing, someone may find + lookup key is the variable name. Originally + implemented for testing, someone may find this useful someday. hash An indexed file type based on hashing. This - is available on systems with support for + is available on systems with support for Berkeley DB databases. internal @@ -171,130 +187,130 @@ POSTCONF(1) POSTCONF(1) tent are lost when a process terminates. ldap (read-only) - Perform lookups using the LDAP protocol. + Perform lookups using the LDAP protocol. This is described in ldap_table(5). mysql (read-only) - Perform lookups using the MYSQL protocol. + Perform lookups using the MYSQL protocol. This is described in mysql_table(5). pcre (read-only) A lookup table based on Perl Compatible Reg- - ular Expressions. The file format is + ular Expressions. The file format is described in pcre_table(5). pgsql (read-only) - Perform lookups using the PostgreSQL proto- + Perform lookups using the PostgreSQL proto- col. This is described in pgsql_table(5). proxy (read-only) - A lookup table that is implemented via the - Postfix proxymap(8) service. The table name + A lookup table that is implemented via the + Postfix proxymap(8) service. The table name syntax is type:name. regexp (read-only) A lookup table based on regular expressions. - The file format is described in regexp_ta- + The file format is described in regexp_ta- ble(5). sdbm An indexed file type based on hashing. This - is available on systems with support for + is available on systems with support for SDBM databases. sqlite (read-only) - Perform lookups from SQLite database files. + Perform lookups from SQLite database files. This is described in sqlite_table(5). static (read-only) - A table that always returns its name as - lookup result. For example, static:foobar - always returns the string foobar as lookup + A table that always returns its name as + lookup result. For example, static:foobar + always returns the string foobar as lookup result. tcp (read-only) Perform lookups using a simple request-reply - protocol that is described in tcp_table(5). + protocol that is described in tcp_table(5). texthash (read-only) - Produces similar results as hash: files, + 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 + 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 way to query the UNIX authentica- + A limited way to query the UNIX authentica- tion database. The following tables are implemented: unix:passwd.byname - The table is the UNIX password data- - base. The key is a login name. The - result is a password file entry in + The table is the UNIX password data- + base. 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(5) + The key is a group name. The result + is a group file entry in group(5) format. - Other table types may exist depending on how Post- + Other table types may exist depending on how Post- fix was built. - -M Show master.cf file contents instead of main.cf - file contents. Specify -Mf to fold long lines for + -M Show master.cf file contents instead of main.cf + file contents. Specify -Mf to fold long lines for human readability. If service ... is specified, only the matching ser- - vices will be output. For example, "postconf -Mf - inet" will match all services that listen on the + vices will be output. For example, "postconf -Mf + inet" will match all services that listen on the network. - Specify zero or more arguments, each with a ser- - vice-type name (inet, unix, fifo, or pass) or with - a service-name.service-type pair, where service- + Specify zero or more arguments, each with a ser- + vice-type name (inet, unix, fifo, or pass) or with + a service-name.service-type pair, where service- name is the first field of a master.cf entry. - This feature is available with Postfix 2.9 and + This feature is available with Postfix 2.9 and later. - -n Print main.cf parameter settings that are explic- - itly specified in main.cf. Specify -nf to fold - long lines for human readability (Postfix 2.9 and + -n Print main.cf parameter settings that are explic- + itly specified in main.cf. Specify -nf to fold + long lines for human readability (Postfix 2.9 and later). -t [template_file] - Display the templates for text that appears at the - beginning of delivery status notification (DSN) + 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 tem- - plate file name at the end of the postconf(1) com- - mand line, or specify a file name in main.cf with + To override the built-in templates, specify a tem- + plate file name at the end of the postconf(1) com- + mand line, or specify a file name in main.cf with the bounce_template_file parameter. To force selection of the built-in templates, spec- - ify an empty template file name on the postconf(1) + ify an empty template file name on the postconf(1) command line (in shell language: ""). - This feature is available with Postfix 2.3 and + This feature is available with Postfix 2.3 and later. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. - -# Edit the main.cf configuration file, and comment + -# Edit the main.cf configuration file, and comment out the parameters given on the postconf(1) command - line, so that those parameters revert to their - default values. The file is copied to a temporary - file then renamed into place. Specify a list of + line, so that those parameters revert to their + default values. The file is copied to a temporary + file then renamed into place. Specify a list of parameter names, not name=value pairs. There is no - postconf(1) command to perform the reverse opera- + postconf(1) command to perform the reverse opera- tion. - This feature is available with Postfix 2.6 and + This feature is available with Postfix 2.6 and later. DIAGNOSTICS @@ -305,18 +321,18 @@ POSTCONF(1) POSTCONF(1) Directory with Postfix configuration files. CONFIGURATION PARAMETERS - The following main.cf parameters are especially relevant + The following main.cf parameters are especially relevant to this program. - The text below provides only a parameter summary. See + 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 + The default location of the Postfix main.cf and master.cf configuration files. bounce_template_file (empty) - Pathname of a configuration file with bounce mes- + Pathname of a configuration file with bounce mes- sage templates. FILES @@ -332,7 +348,7 @@ POSTCONF(1) POSTCONF(1) DATABASE_README, Postfix lookup table overview LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1 index 57d2d061b..d839dea3b 100644 --- a/postfix/man/man1/postconf.1 +++ b/postfix/man/man1/postconf.1 @@ -12,7 +12,7 @@ Postfix configuration utility \fBManaging main.cf:\fR \fBpostconf\fR [\fB-dfhnv\fR] [\fB-c \fIconfig_dir\fR] -[\fIparameter ...\fR] +[\fB-C \fIclass\fR] [\fIparameter ...\fR] \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR] [\fIparameter=value ...\fR] @@ -90,6 +90,19 @@ This feature is available with Postfix 2.3 and later. .IP "\fB-c \fIconfig_dir\fR" The \fBmain.cf\fR configuration file is in the named directory instead of the default configuration directory. +.IP "\fB-C \fIclass,...\fR" +When displaying \fBmain.cf\fR parameters, select only +parameters from the specified class(es), specified as a +comma-separated list: +.RS +.IP \fBbuiltin\fR +Parameters with built-in names. +.IP \fBservice\fR +Parameters with service-defined names (the first field of +a \fBmaster.cf\fR entry plus a Postfix-defined suffix). +.IP \fBuser\fR +Parameters with user-defined names. +.RE .IP \fB-d\fR Print \fBmain.cf\fR default parameter settings instead of actual settings. diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index 82c47044c..23f7e69d7 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -996,6 +996,11 @@ while (<>) { s;\btlsproxy_tls_session_cache_timeout\b;$&;g; s;\btlsproxy_use_tls\b;$&;g; + # Service-defined parameters... + + s;\bpolicy_time_limit\b;$&;g; + s;\bgreylist_time_limit\b;$&;g; + # Hyperlink URLs and RFC documents s/(http:\/\/[^ ,"\(\)]*[^ ,"\(\):;!?.])/$1<\/a>/; diff --git a/postfix/proto/SMTPD_POLICY_README.html b/postfix/proto/SMTPD_POLICY_README.html index 178813fc8..d3531f051 100644 --- a/postfix/proto/SMTPD_POLICY_README.html +++ b/postfix/proto/SMTPD_POLICY_README.html @@ -284,9 +284,9 @@ increase the smtpd process limit.
open relay.Line 11: this increases the time that a policy server -process is allowed to run from the default 1000 seconds to 3600 -seconds. The default time limit is too short for a policy daemon -that needs to run long as the SMTP server process that talks to it. +process may run to 3600 seconds. The default time limit of 1000 +seconds is too short; the policy daemon needs to run long as the +SMTP server process that talks to it. See the spawn(8) manpage for more information about the transport_time_limit parameter.
@@ -428,9 +428,9 @@ increase the smtpd process limit. each request and reply.Line 6: this increases the time that a greylist server -process is allowed to run from the default 1000 seconds to 3600 -seconds. The default time limit is too short for a greylist daemon -that needs to run long as the SMTP server process that talks to it. +process may run to 3600 seconds. The default time limit of 1000 +seconds is too short; the greylist daemon needs to run long as the +SMTP server process that talks to it. See the spawn(8) manpage for more information about the transport_time_limit parameter.
diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 2588e3406..8704ec30a 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 "20111127" +#define MAIL_RELEASE_DATE "20111129" #define MAIL_VERSION_NUMBER "2.9" #ifdef SNAPSHOT diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in index 82a9c8bb0..605e1e2f7 100644 --- a/postfix/src/postconf/Makefile.in +++ b/postfix/src/postconf/Makefile.in @@ -41,7 +41,8 @@ Makefile: Makefile.in test: $(TESTPROG) tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \ - test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 + test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 \ + test22 root_tests: @@ -284,6 +285,16 @@ test21: $(PROG) test21.ref diff test21.ref test21.tmp rm -f main.cf master.cf test21.tmp +# Like test6, but using a delivery agent that has no _time_limit magic. + +test22: $(PROG) test22.ref + rm -f main.cf master.cf + touch main.cf master.cf + echo whatevershebrings unix - n n - 0 smtp >> master.cf + ./$(PROG) -c . 2>&1 | grep whatevershebrings >test22.tmp + diff test22.ref test22.tmp + rm -f main.cf master.cf test22.tmp + printfck: $(OBJS) $(PROG) rm -rf printfck mkdir printfck @@ -322,6 +333,7 @@ postconf.o: ../../include/mail_run.h postconf.o: ../../include/mail_version.h postconf.o: ../../include/msg.h postconf.o: ../../include/msg_vstream.h +postconf.o: ../../include/name_mask.h postconf.o: ../../include/stringops.h postconf.o: ../../include/sys_defs.h postconf.o: ../../include/vbuf.h diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 10a273c15..10c17f750 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -8,7 +8,7 @@ /* \fBManaging main.cf:\fR /* /* \fBpostconf\fR [\fB-dfhnv\fR] [\fB-c \fIconfig_dir\fR] -/* [\fIparameter ...\fR] +/* [\fB-C \fIclass\fR] [\fIparameter ...\fR] /* /* \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR] /* [\fIparameter=value ...\fR] @@ -84,6 +84,19 @@ /* .IP "\fB-c \fIconfig_dir\fR" /* The \fBmain.cf\fR configuration file is in the named directory /* instead of the default configuration directory. +/* .IP "\fB-C \fIclass,...\fR" +/* When displaying \fBmain.cf\fR parameters, select only +/* parameters from the specified class(es), specified as a +/* comma-separated list: +/* .RS +/* .IP \fBbuiltin\fR +/* Parameters with built-in names. +/* .IP \fBservice\fR +/* Parameters with service-defined names (the first field of +/* a \fBmaster.cf\fR entry plus a Postfix-defined suffix). +/* .IP \fBuser\fR +/* Parameters with user-defined names. +/* .RE /* .IP \fB-d\fR /* Print \fBmain.cf\fR default parameter settings instead of /* actual settings. @@ -315,6 +328,7 @@ #include#include #include +#include /* Global library. */ @@ -349,6 +363,13 @@ int main(int argc, char **argv) struct stat st; int junk; ARGV *ext_argv = 0; + int param_class = PC_PARAM_MASK_CLASS; + static const NAME_MASK param_class_table[] = { + "builtin", PC_PARAM_FLAG_BUILTIN, + "service", PC_PARAM_FLAG_SERVICE, + "user", PC_PARAM_FLAG_USER, + 0, + }; /* * Fingerprint executables and core dumps. @@ -378,7 +399,7 @@ int main(int argc, char **argv) /* * Parse JCL. */ - while ((ch = GETOPT(argc, argv, "aAbc:deEf#hlmMntv")) > 0) { + while ((ch = GETOPT(argc, argv, "aAbc:C:deEf#hlmMntv")) > 0) { switch (ch) { case 'a': cmd_mode |= SHOW_SASL_SERV; @@ -396,6 +417,10 @@ int main(int argc, char **argv) if (setenv(CONF_ENV_PATH, optarg, 1) < 0) msg_fatal("out of memory"); break; + case 'C': + param_class = name_mask_opt("-C option", param_class_table, + optarg, NAME_MASK_ANY_CASE | NAME_MASK_FATAL); + break; case 'd': cmd_mode |= SHOW_DEFS; break; @@ -446,7 +471,7 @@ int main(int argc, char **argv) msg_verbose++; break; default: - msg_fatal("usage: %s [-a (server SASL types)] [-A (client SASL types)] [-b (bounce templates)] [-c config_dir] [-d (defaults)] [-e (edit)] [-f (fold lines)] [-# (comment-out)] [-h (no names)] [-l (lock types)] [-m (map types)] [-M (master.cf)] [-n (non-defaults)] [-v] [name...]", argv[0]); + msg_fatal("usage: %s [-a (server SASL types)] [-A (client SASL types)] [-b (bounce templates)] [-c config_dir] [-C param_class] [-d (defaults)] [-e (edit)] [-f (fold lines)] [-# (comment-out)] [-h (no names)] [-l (lock types)] [-m (map types)] [-M (master.cf)] [-n (non-defaults)] [-v] [name...]", argv[0]); } } @@ -548,7 +573,7 @@ int main(int argc, char **argv) /* * Show the requested values. */ - show_parameters(cmd_mode, argv + optind); + show_parameters(cmd_mode, param_class, argv + optind); /* * Flag unused parameters. This makes no sense with "postconf -d", diff --git a/postfix/src/postconf/postconf.h b/postfix/src/postconf/postconf.h index f2003d504..cb77952ba 100644 --- a/postfix/src/postconf/postconf.h +++ b/postfix/src/postconf/postconf.h @@ -45,8 +45,15 @@ typedef struct { } PC_PARAM_NODE; /* Values for flags. See the postconf_node module for narrative text. */ -#define PC_PARAM_FLAG_NONE (0) -#define PC_PARAM_FLAG_RAW (1<<0) +#define PC_PARAM_FLAG_RAW (1<<0) /* raw parameter value */ +#define PC_PARAM_FLAG_BUILTIN (1<<1) /* built-in parameter name */ +#define PC_PARAM_FLAG_SERVICE (1<<2) /* service-defined parameter name */ +#define PC_PARAM_FLAG_USER (1<<3) /* user-defined parameter name */ + +#define PC_PARAM_MASK_CLASS \ + (PC_PARAM_FLAG_BUILTIN | PC_PARAM_FLAG_SERVICE | PC_PARAM_FLAG_USER) +#define PC_PARAM_CLASS_OVERRIDE(node, class) \ + ((node)->flags = (((node)->flags & ~PC_PARAM_MASK_CLASS) | (class))) #define PC_RAW_PARAMETER(node) ((node)->flags & PC_PARAM_FLAG_RAW) @@ -123,7 +130,7 @@ extern void set_config_dir(void); */ extern void read_parameters(void); extern void set_parameters(void); -extern void show_parameters(int, char **); +extern void show_parameters(int, int, char **); /* * postconf_edit.c diff --git a/postfix/src/postconf/postconf_builtin.c b/postfix/src/postconf/postconf_builtin.c index 09893e50d..b915ad84a 100644 --- a/postfix/src/postconf/postconf_builtin.c +++ b/postfix/src/postconf/postconf_builtin.c @@ -333,36 +333,39 @@ void register_builtin_parameters(void) param_table = PC_PARAM_TABLE_CREATE(100); /* - * Add the built-in parameters to the global name space. + * Add the built-in parameters to the global name space. The class + * (built-i) is tentative; some parameters are actually service-defined, + * but they have their own default value. */ for (ctt = time_table; ctt->name; ctt++) - PC_PARAM_TABLE_ENTER(param_table, ctt->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, ctt->name, PC_PARAM_FLAG_BUILTIN, (char *) ctt, convert_time_parameter); for (cbt = bool_table; cbt->name; cbt++) - PC_PARAM_TABLE_ENTER(param_table, cbt->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, cbt->name, PC_PARAM_FLAG_BUILTIN, (char *) cbt, convert_bool_parameter); for (cit = int_table; cit->name; cit++) - PC_PARAM_TABLE_ENTER(param_table, cit->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, cit->name, PC_PARAM_FLAG_BUILTIN, (char *) cit, convert_int_parameter); for (cst = str_table; cst->name; cst++) - PC_PARAM_TABLE_ENTER(param_table, cst->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, cst->name, PC_PARAM_FLAG_BUILTIN, (char *) cst, convert_str_parameter); for (cft = str_fn_table; cft->name; cft++) - PC_PARAM_TABLE_ENTER(param_table, cft->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, cft->name, PC_PARAM_FLAG_BUILTIN, (char *) cft, convert_str_fn_parameter); for (cft = str_fn_table_2; cft->name; cft++) - PC_PARAM_TABLE_ENTER(param_table, cft->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, cft->name, PC_PARAM_FLAG_BUILTIN, (char *) cft, convert_str_fn_parameter); for (rst = raw_table; rst->name; rst++) - PC_PARAM_TABLE_ENTER(param_table, rst->name, PC_PARAM_FLAG_RAW, + PC_PARAM_TABLE_ENTER(param_table, rst->name, + PC_PARAM_FLAG_BUILTIN | PC_PARAM_FLAG_RAW, (char *) rst, convert_raw_parameter); for (nst = nint_table; nst->name; nst++) - PC_PARAM_TABLE_ENTER(param_table, nst->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, nst->name, PC_PARAM_FLAG_BUILTIN, (char *) nst, convert_nint_parameter); for (bst = nbool_table; bst->name; bst++) - PC_PARAM_TABLE_ENTER(param_table, bst->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, bst->name, PC_PARAM_FLAG_BUILTIN, (char *) bst, convert_nbool_parameter); for (lst = long_table; lst->name; lst++) - PC_PARAM_TABLE_ENTER(param_table, lst->name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, lst->name, PC_PARAM_FLAG_BUILTIN, (char *) lst, convert_long_parameter); } diff --git a/postfix/src/postconf/postconf_main.c b/postfix/src/postconf/postconf_main.c index e7b0f72ab..d566869d8 100644 --- a/postfix/src/postconf/postconf_main.c +++ b/postfix/src/postconf/postconf_main.c @@ -10,8 +10,9 @@ /* /* void set_parameters() /* -/* void show_parameters(mode, names) +/* void show_parameters(mode, param_class, names) /* int mode; +/* int param_class; /* char **names; /* DESCRIPTION /* read_parameters() reads parameters from main.cf. @@ -39,6 +40,16 @@ /* .IP SHOW_EVAL /* Expand parameter values (not implemented). /* .RE +/* .IP param_class +/* Bit-wise OR of one or more of the following: +/* .RS +/* .IP PC_PARAM_FLAG_BUILTIN +/* Show built-in parameters. +/* .IP PC_PARAM_FLAG_SERVICE +/* Show service-defined parameters. +/* .IP PC_PARAM_FLAG_USER +/* Show user-defined parameters. +/* .RE /* .IP names /* List of zero or more parameter names. If the list is empty, /* output all parameters. @@ -225,7 +236,7 @@ static int comp_names(const void *a, const void *b) /* show_parameters - show parameter info */ -void show_parameters(int mode, char **names) +void show_parameters(int mode, int param_class, char **names) { PC_PARAM_INFO **list; PC_PARAM_INFO **ht; @@ -239,8 +250,9 @@ void show_parameters(int mode, char **names) list = PC_PARAM_TABLE_LIST(param_table); qsort((char *) list, param_table->used, sizeof(*list), comp_names); for (ht = list; *ht; ht++) - print_parameter(mode, PC_PARAM_INFO_NAME(*ht), - PC_PARAM_INFO_NODE(*ht)); + if (param_class & PC_PARAM_INFO_NODE(*ht)->flags) + print_parameter(mode, PC_PARAM_INFO_NAME(*ht), + PC_PARAM_INFO_NODE(*ht)); myfree((char *) list); return; } diff --git a/postfix/src/postconf/postconf_service.c b/postfix/src/postconf/postconf_service.c index 168b9ec3d..ddd8bf99f 100644 --- a/postfix/src/postconf/postconf_service.c +++ b/postfix/src/postconf/postconf_service.c @@ -2,7 +2,7 @@ /* NAME /* postconf_service 3 /* SUMMARY -/* service-defined parameter support +/* service-defined parameter name support /* SYNOPSIS /* #include /* @@ -89,16 +89,22 @@ static void register_service_parameter(const char *service, const char *suffix, const char *defparam) { char *name = concatenate(service, suffix, (char *) 0); + PC_PARAM_NODE *node; /* * Skip service parameter names that have built-in definitions. This * happens with message delivery transports that have a non-default * per-destination concurrency or recipient limit, such as local(8). + * + * Some parameters were tentatively flagged as built-in, but they are + * service parameters with their own default value. We don't change the + * default but we correct the parameter class. */ - if (PC_PARAM_TABLE_LOCATE(param_table, name) != 0) { + if ((node = PC_PARAM_TABLE_FIND(param_table, name)) != 0) { + PC_PARAM_CLASS_OVERRIDE(node, PC_PARAM_FLAG_SERVICE); myfree(name); } else { - PC_PARAM_TABLE_ENTER(param_table, name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, name, PC_PARAM_FLAG_SERVICE, (char *) defparam, convert_service_parameter); } } diff --git a/postfix/src/postconf/postconf_user.c b/postfix/src/postconf/postconf_user.c index 28362bf90..8e0557f03 100644 --- a/postfix/src/postconf/postconf_user.c +++ b/postfix/src/postconf/postconf_user.c @@ -2,7 +2,7 @@ /* NAME /* postconf_user 3 /* SUMMARY -/* support for user-defined parameters +/* support for user-defined parameter names /* SYNOPSIS /* #include /* @@ -13,11 +13,12 @@ /* space of each master.cf entry. Parameters in local name /* spaces take precedence over global parameters. /* -/* There are three categories of known parameters: built-in, +/* There are three categories of known parameter names: built-in, /* service-defined (see postconf_service.c), and valid /* user-defined. /* -/* There are two categories of valid user-defined parameters: +/* There are two categories of valid user-defined parameter +/* names: /* /* - Parameters whose user-defined-name appears in the value /* of smtpd_restriction_classes in main.cf or master.cf. @@ -28,7 +29,7 @@ /* - In both cases the parameters must have a /* "user-defined-name=value" entry in main.cf or master.cf. /* -/* Other user-defined parameters are flagged as "unused". +/* Other user-defined parameter names are flagged as "unused". /* /* register_user_parameters() scans the global and per-service /* name spaces for user-defined parameters and flags @@ -122,11 +123,11 @@ static const char *flag_user_parameter(const char *mac_name, if (local_scope && dict_get(local_scope->all_params, mac_name)) { if (PC_PARAM_TABLE_LOCATE(local_scope->valid_names, mac_name) == 0) PC_PARAM_TABLE_ENTER(local_scope->valid_names, mac_name, - PC_PARAM_FLAG_NONE, PC_PARAM_NO_DATA, + PC_PARAM_FLAG_USER, PC_PARAM_NO_DATA, convert_user_parameter); } else if (mail_conf_lookup(mac_name) != 0) { if (PC_PARAM_TABLE_LOCATE(param_table, mac_name) == 0) - PC_PARAM_TABLE_ENTER(param_table, mac_name, PC_PARAM_FLAG_NONE, + PC_PARAM_TABLE_ENTER(param_table, mac_name, PC_PARAM_FLAG_USER, PC_PARAM_NO_DATA, convert_user_parameter); } return (0); @@ -198,7 +199,7 @@ static void scan_user_parameter_namespace(const char *dict_name, && PC_PARAM_TABLE_LOCATE(local_scope->valid_names, cparam_name) == 0 && htable_locate(rest_class_table, cparam_name) != 0) PC_PARAM_TABLE_ENTER(local_scope->valid_names, cparam_name, - PC_PARAM_FLAG_NONE, PC_PARAM_NO_DATA, + PC_PARAM_FLAG_USER, PC_PARAM_NO_DATA, convert_user_parameter); /* Skip "do not expand" parameters. */ if ((node = PC_PARAM_TABLE_FIND(param_table, cparam_name)) != 0 diff --git a/postfix/src/postconf/test22.ref b/postfix/src/postconf/test22.ref new file mode 100644 index 000000000..bb1c81e10 --- /dev/null +++ b/postfix/src/postconf/test22.ref @@ -0,0 +1,15 @@ +whatevershebrings_delivery_slot_cost = $default_delivery_slot_cost +whatevershebrings_delivery_slot_discount = $default_delivery_slot_discount +whatevershebrings_delivery_slot_loan = $default_delivery_slot_loan +whatevershebrings_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +whatevershebrings_destination_concurrency_limit = $default_destination_concurrency_limit +whatevershebrings_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +whatevershebrings_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +whatevershebrings_destination_rate_delay = $default_destination_rate_delay +whatevershebrings_destination_recipient_limit = $default_destination_recipient_limit +whatevershebrings_extra_recipient_limit = $default_extra_recipient_limit +whatevershebrings_initial_destination_concurrency = $initial_destination_concurrency +whatevershebrings_minimum_delivery_slots = $default_minimum_delivery_slots +whatevershebrings_recipient_limit = $default_recipient_limit +whatevershebrings_recipient_refill_delay = $default_recipient_refill_delay +whatevershebrings_recipient_refill_limit = $default_recipient_refill_limit