From: Wietse Venema Date: Wed, 9 Nov 2011 05:00:00 +0000 (-0500) Subject: postfix-2.9-20111109 X-Git-Tag: v2.9.0-RC1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b01e0d04c71f31a6ba0dcbfae018aceff732e468;p=thirdparty%2Fpostfix.git postfix-2.9-20111109 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index d4ababc45..83b84ed74 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -17045,20 +17045,20 @@ Apologies for any names omitted. Feature: "postconf -M" support to show Postfix's idea of what is in the master.cf file. File: postconf/postconf.c. - Work in progress: extract mail delivery transport names - from master.cf, and provide better postconf(1) support to - manipulate main.cf parameters with transport-dependent - names. - Feature: postconf "-f" option to "nicely" format long lines from main.cf or master.cf. File: postconf/postconf.c. -201108 +20111108 Cleanup: postconf finally supports dynamic configuration parameter names: parameters whose name depend on a mail - delivery transport name in master.cf, and parameters whose - names are specified with smtpd_restriction_classes in - main.cf. This adds 70 parameters to the "postconf" output, + delivery transport or spawn service in master.cf, and + parameters whose names are specified with smtpd_restriction_classes + in main.cf. This adds 70 parameters to the "postconf" output, more if additional mail delivery transports are defined in master.cf. File: postconf/postconf.c. + +20111109 + + Cleanup: account for "," in smtpd_restriction_classes + value (Victor Duchovni). File: postconf/postconf.c. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index a813583f2..58344f353 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -14,6 +14,20 @@ specifies the release date of a stable release or snapshot release. If you upgrade from Postfix 2.7 or earlier, read RELEASE_NOTES-2.8 before proceeding. +Major changes with snapshot 20111108 +==================================== + +postconf support for parameter names that are generated automatically +from master.cf entries (delivery agents, spawn services), and for +parameter names that are defined with main.cf smtpd_restriction_classes. +This increases the postconf output size with 70 lines or more. + +Major changes with snapshot 20111106 +==================================== + +"postconf -M" support to print master.cf entries, and "postconf -f" +support to fold long main.cf or master.cf lines for human readability. + Incompatible changes with snapshot 20111106 =========================================== diff --git a/postfix/WISHLIST b/postfix/WISHLIST index 4157fa955..0fdcb5bea 100644 --- a/postfix/WISHLIST +++ b/postfix/WISHLIST @@ -6,6 +6,13 @@ Wish list: Things to do after the stable release: + postconf: legitimize spontaneous_name=value if it is + referenced as legitimate_name=$spontaneous_name in main.cf + or master.cf, and warn about spontaneous_name=value that + have no legitimizing reference. Use mac_expand callback + to identidy references, and add mac_expand option to always + expand a conditional macro's right-hand side. + TLS_README has the priorities reversed. The section about SMTP client settings begins with an exposition about client certificates, which almost no-one needs. Instead, the text diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 3db456fda..1a653e442 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 "20111108" +#define MAIL_RELEASE_DATE "20111109" #define MAIL_VERSION_NUMBER "2.9" #ifdef SNAPSHOT diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 8c2107c54..77460913c 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -754,6 +754,58 @@ static void set_parameters(void) */ } +/* read_master - read and digest the master.cf file */ + +static void read_master(void) +{ + char *path; + VSTRING *buf = vstring_alloc(100); + ARGV *argv; + VSTREAM *fp; + int entry_count = 0; + int line_count = 0; + + /* + * Get the location of master.cf. + */ + if (var_config_dir == 0) + set_config_dir(); + path = concatenate(var_config_dir, "/", MASTER_CONF_FILE, (char *) 0); + + /* + * We can't use the master_ent routines in their current form. They + * convert everything to internal form, and they skip disabled services. + * We need to be able to show default fields as "-", and we need to know + * about all service names so that we can generate dynamic parameter + * names (transport-dependent etc.). + */ +#define MASTER_BLANKS " \t\r\n" /* XXX */ +#define MASTER_FIELD_COUNT 8 /* XXX */ + + /* + * Initialize the in-memory master table. + */ + master_table = (ARGV **) mymalloc(sizeof(*master_table)); + + /* + * Skip blank lines and comment lines. + */ + if ((fp = vstream_fopen(path, O_RDONLY, 0)) == 0) + msg_fatal("open %s: %m", path); + while (readlline(buf, fp, &line_count) != 0) { + master_table = (ARGV **) myrealloc((char *) master_table, + (entry_count + 2) * sizeof(*master_table)); + argv = argv_split(STR(buf), MASTER_BLANKS); + if (argv->argc < MASTER_FIELD_COUNT) + msg_fatal("file %s: line %d: bad field count", path, line_count); + master_table[entry_count++] = argv; + } + master_table[entry_count] = 0; + vstream_fclose(fp); + myfree(path); + vstring_free(buf); +} + /* * Basename of programs in $daemon_directory. XXX These belong in a header * file, or they should be made configurable. @@ -888,10 +940,22 @@ static void add_dynamic_parameters(int mode) if ((mode & SHOW_DEFS) == 0 && (class_list = mail_conf_lookup_eval(VAR_REST_CLASSES)) != 0) { cp = saved_class_list = mystrdup(class_list); - while ((class_name = mystrtok(&cp, " \t\r\n")) != 0) + while ((class_name = mystrtok(&cp, ", \t\r\n")) != 0) add_restriction_class(class_name); myfree(saved_class_list); } + + /* + * TODO: Parse all legitimate parameter values (in main.cf and in + * master.cf) for references to spontaneous parameters that are defined + * in main.cf, and flag those spontaneous parameters as legitimate. Then, + * flag all remaining spontaneous parameter definitions in main.cf as + * mistakes. + * + * It is OK if a spontaneous name exists only in a reference; this is how + * Postfix implements backwards compatibility after a feature name + * change. + */ } /* hash_parameters - hash all parameter names so we can find and sort them */ @@ -943,58 +1007,6 @@ static void hash_parameters(void) htable_enter(param_table, *rct, (char *) rct); } -/* read_master - read and digest the master.cf file */ - -static void read_master(void) -{ - char *path; - VSTRING *buf = vstring_alloc(100); - ARGV *argv; - VSTREAM *fp; - int entry_count = 0; - int line_count = 0; - - /* - * Get the location of master.cf. - */ - if (var_config_dir == 0) - set_config_dir(); - path = concatenate(var_config_dir, "/", MASTER_CONF_FILE, (char *) 0); - - /* - * We can't use the master_ent routines in their current form. They - * convert everything to internal form, and they skip disabled services. - * We need to be able to show default fields as "-", and we need to know - * about all service names so that we can generate dynamic parameter - * names (transport-dependent etc.). - */ -#define MASTER_BLANKS " \t\r\n" /* XXX */ -#define MASTER_FIELD_COUNT 8 /* XXX */ - - /* - * Initialize the in-memory master table. - */ - master_table = (ARGV **) mymalloc(sizeof(*master_table)); - - /* - * Skip blank lines and comment lines. - */ - if ((fp = vstream_fopen(path, O_RDONLY, 0)) == 0) - msg_fatal("open %s: %m", path); - while (readlline(buf, fp, &line_count) != 0) { - master_table = (ARGV **) myrealloc((char *) master_table, - (entry_count + 2) * sizeof(*master_table)); - argv = argv_split(STR(buf), MASTER_BLANKS); - if (argv->argc < MASTER_FIELD_COUNT) - msg_fatal("file %s: line %d: bad field count", path, line_count); - master_table[entry_count++] = argv; - } - master_table[entry_count] = 0; - vstream_fclose(fp); - myfree(path); - vstring_free(buf); -} - /* print_line - show line possibly folded, and with normalized whitespace */ static void print_line(int mode, const char *fmt,...) @@ -1369,7 +1381,7 @@ static void print_del_transp_param(int mode, const char *name, } } -/* print_rest_class_param - show dynamic parameter */ +/* print_rest_class_param - show dynamic restriction class parameter */ static void print_rest_class_param(int mode, const char *name) {