From: Wietse Venema Date: Tue, 22 Nov 2011 05:00:00 +0000 (-0500) Subject: postfix-2.9-20111122 X-Git-Tag: v2.9.0-RC1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24073266044711a007c36ca984c0df90b0f1ce81;p=thirdparty%2Fpostfix.git postfix-2.9-20111122 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index d38c6ca8a..f3057480b 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -17072,6 +17072,10 @@ Apologies for any names omitted. 20111113 + Portability: specify ``make makefiles "CCARGS=-DNO_NIS + ..."'' to build on systems without NIS support. Files: + makedefs, util/sys_defs.h. + Cleanup: documented the postconf algorithms and their limitations, and added regression tests to speed up future development. File: postconf/postconf.c @@ -17123,3 +17127,12 @@ Apologies for any names omitted. 20111121 Cleanup: documentation fixes. File: postconf/postconf.c. + + Cleanup: in postconf "main.cf management" mode, errors + opening master.cf are non-fatal. File: postconf/postconf.c. + +20111122 + + Cleanup: documentation examples to request VERP-style + delivery at SMTP time with the smtpd_command_filter feature. + Files: proto/VERP_README.html, proto/postconf.proto. diff --git a/postfix/README_FILES/VERP_README b/postfix/README_FILES/VERP_README index 94ce80b18..5a5a1c2b1 100644 --- a/postfix/README_FILES/VERP_README +++ b/postfix/README_FILES/VERP_README @@ -57,9 +57,8 @@ smtpd_authorized_verp_clients (default value: none) authorized_verp_clients (default: $mynetworks). disable_verp_bounces (default: no) - if Postfix sends one bounce report for multi-recipient VERP mail, or one - bounce report per recipient. The default, one per recipient, is what ezmlm - needs. + Send one bounce report for multi-recipient VERP mail, instead of one bounce + report per recipient. The default, one per recipient, is what ezmlm needs. UUssiinngg VVEERRPP wwiitthh mmaajjoorrddoommoo eettcc.. mmaaiilliinngg lliissttss @@ -138,6 +137,16 @@ delivery. The syntax allows two forms: The first form uses the default main.cf VERP delimiters, the second form overrides them explicitly. The values shown are the recommended ones. +You can use the smtpd_command_filter feature to append XVERP to SMTP commands +from legacy sofware. This requires Postfix 2.7 or later. + + /etc/postfix/main.cf: + smtpd_command_filter = pcre:/etc/postfix/append_verp.pcre + smtpd_authorized_verp_clients = $mynetworks + + /etc/postfix/append_verp.pcre: + /^(MAIL FROM:.*)/ $1 XVERP + VVEERRPP ssuuppppoorrtt iinn tthhee PPoossttffiixx sseennddmmaaiill ccoommmmaanndd The Postfix sendmail command has a -V flag to request VERP style delivery. diff --git a/postfix/html/VERP_README.html b/postfix/html/VERP_README.html index 5cb63e199..3ae4ab161 100644 --- a/postfix/html/VERP_README.html +++ b/postfix/html/VERP_README.html @@ -98,8 +98,8 @@ parameters.
disable_verp_bounces (default: no) -

if Postfix sends one bounce report for multi-recipient - VERP mail, or one bounce report per recipient. The default, +

Send one bounce report for multi-recipient VERP mail, + instead of one bounce report per recipient. The default, one per recipient, is what ezmlm needs.

@@ -217,6 +217,21 @@ MAIL FROM:<sender@domain> XVERP=+= second form overrides them explicitly. The values shown are the recommended ones.

+

You can use the smtpd_command_filter feature to append XVERP +to SMTP commands from legacy sofware. This requires Postfix 2.7 +or later.

+ +
+
+/etc/postfix/main.cf:
+    smtpd_command_filter = pcre:/etc/postfix/append_verp.pcre
+    smtpd_authorized_verp_clients = $mynetworks
+
+/etc/postfix/append_verp.pcre:
+    /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP
+
+
+

VERP support in the Postfix sendmail command

The Postfix sendmail command has a -V flag to request VERP style diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html index 712e9f0da..bbbb551d2 100644 --- a/postfix/html/postconf.1.html +++ b/postfix/html/postconf.1.html @@ -99,8 +99,8 @@ POSTCONF(1) POSTCONF(1) 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 - quotes to protect shell metacharacters and white- - space. + quotes to protect special characters and whitespace + on the fBpostconf(1) command line. The -e is no longer needed with Postfix version 2.8 and later. @@ -286,14 +286,15 @@ POSTCONF(1) POSTCONF(1) verbose. -# Edit the main.cf configuration file, and comment - out the specified parameters so that they revert to - their default values. The file is copied to a tem- - porary 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 operation. - - This feature is available with Postfix 2.6 and + 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 + parameter names, not name=value pairs. There is no + postconf(1) command to perform the reverse opera- + tion. + + This feature is available with Postfix 2.6 and later. DIAGNOSTICS @@ -304,18 +305,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 @@ -331,7 +332,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/html/postconf.5.html b/postfix/html/postconf.5.html index 35aa2c307..fe0faa867 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -12385,6 +12385,12 @@ feature:

/^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/ RCPT TO:<$1>$2 +
+    # Append XVERP to MAIL FROM commands to request VERP-style delivery.
+    # See VERP_README for more information on how to use Postfix VERP.
+    /^(MAIL FROM:<listname@example\.com>.*)/   $1 XVERP
+
+
     # Bounce-never mail sink. Use notify_classes=bounce,resource,software
     # to send bounced mail to the postmaster (with message body removed).
diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1
index 941b7daf6..13ced579f 100644
--- a/postfix/man/man1/postconf.1
+++ b/postfix/man/man1/postconf.1
@@ -100,7 +100,8 @@ Edit the \fBmain.cf\fR configuration file, and update
 parameter settings with the "\fIname\fR=\fIvalue\fR" pairs
 on the \fBpostconf\fR(1) command line. The file is copied
 to a temporary file then renamed into place.
-Specify quotes to protect shell metacharacters and whitespace.
+Specify quotes to protect special characters and whitespace
+on the fBpostconf\fR(1) command line.
 
 The \fB-e\fR is no longer needed with Postfix version 2.8
 and later.
@@ -250,9 +251,10 @@ Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 options make the software increasingly verbose.
 .IP \fB-#\fR
 Edit the \fBmain.cf\fR configuration file, and comment out
-the specified parameters so that they revert to their default
-values.  The file is copied to a temporary file then renamed
-into place.
+the parameters given on the \fBpostconf\fR(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 parameter names, not \fIname\fR=\fIvalue\fR
 pairs.  There is no \fBpostconf\fR(1) command to perform
 the reverse operation.
diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5
index efb99f01e..a8346737c 100644
--- a/postfix/man/man5/postconf.5
+++ b/postfix/man/man5/postconf.5
@@ -7758,6 +7758,16 @@ feature:
 .PP
 .nf
 .na
+.ft C
+    # Append XVERP to MAIL FROM commands to request VERP-style delivery.
+    # See VERP_README for more information on how to use Postfix VERP.
+    /^(MAIL FROM:.*)/   $1 XVERP
+.fi
+.ad
+.ft R
+.PP
+.nf
+.na
 .ft C
     # Bounce-never mail sink. Use notify_classes=bounce,resource,software
     # to send bounced mail to the postmaster (with message body removed).
diff --git a/postfix/proto/VERP_README.html b/postfix/proto/VERP_README.html
index 6aeecb41d..8f0e248b3 100644
--- a/postfix/proto/VERP_README.html
+++ b/postfix/proto/VERP_README.html
@@ -98,8 +98,8 @@ parameters.
 
 
disable_verp_bounces (default: no) -

if Postfix sends one bounce report for multi-recipient - VERP mail, or one bounce report per recipient. The default, +

Send one bounce report for multi-recipient VERP mail, + instead of one bounce report per recipient. The default, one per recipient, is what ezmlm needs.

@@ -217,6 +217,21 @@ MAIL FROM:<sender@domain> XVERP=+= second form overrides them explicitly. The values shown are the recommended ones.

+

You can use the smtpd_command_filter feature to append XVERP +to SMTP commands from legacy sofware. This requires Postfix 2.7 +or later.

+ +
+
+/etc/postfix/main.cf:
+    smtpd_command_filter = pcre:/etc/postfix/append_verp.pcre
+    smtpd_authorized_verp_clients = $mynetworks
+
+/etc/postfix/append_verp.pcre:
+    /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP
+
+
+

VERP support in the Postfix sendmail command

The Postfix sendmail command has a -V flag to request VERP style diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 7b55f390a..0a63df48b 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -13021,6 +13021,12 @@ feature:

/^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/ RCPT TO:<$1>$2
+
+    # Append XVERP to MAIL FROM commands to request VERP-style delivery.
+    # See VERP_README for more information on how to use Postfix VERP.
+    /^(MAIL FROM:<listname@example\.com>.*)/   $1 XVERP
+
+
     # Bounce-never mail sink. Use notify_classes=bounce,resource,software 
     # to send bounced mail to the postmaster (with message body removed).
diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h
index da402c903..3c38cc398 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	"20111121"
+#define MAIL_RELEASE_DATE	"20111122"
 #define MAIL_VERSION_NUMBER	"2.9"
 
 #ifdef SNAPSHOT
diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in
index ca31397cd..748d2e32b 100644
--- a/postfix/src/postconf/Makefile.in
+++ b/postfix/src/postconf/Makefile.in
@@ -37,7 +37,7 @@ Makefile: Makefile.in
 test:	$(TESTPROG)
 
 tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \
-	test12 test13 test14 test15
+	test12 test13 test14 test15 test16 test17
 
 root_tests:
 
@@ -220,6 +220,22 @@ test15:	$(PROG) test15.ref
 	diff test15.ref test15.tmp
 	rm -f main.cf master.cf test15.tmp
 
+# Test graceful degradation if master.cf is unavailable.
+
+test16:	$(PROG) test16.ref
+	rm -f main.cf master.cf
+	touch 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
+	-./$(PROG) -Mc . >test17.tmp 2>&1; exit 0
+	diff test17.ref test17.tmp
+	rm -f main.cf master.cf test17.tmp
+
 printfck: $(OBJS) $(PROG)
 	rm -rf printfck
 	mkdir printfck
diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c
index a786a1ee1..0af9d13fd 100644
--- a/postfix/src/postconf/postconf.c
+++ b/postfix/src/postconf/postconf.c
@@ -69,7 +69,7 @@
 /*	Display the message text that appears at the beginning of
 /*	delivery status notification (DSN) messages, with $\fBname\fR
 /*	expressions replaced by actual values as described in
-/*	\fBbounce\fR(5).  
+/*	\fBbounce\fR(5).
 /*
 /*	To override the built-in templates, specify a template file
 /*	name at the end of the \fBpostconf\fR(1) command line, or
@@ -93,8 +93,9 @@
 /*	Edit the \fBmain.cf\fR configuration file, and update
 /*	parameter settings with the "\fIname\fR=\fIvalue\fR" pairs
 /*	on the \fBpostconf\fR(1) command line. The file is copied
-/*	to a temporary file then renamed into place.
-/*	Specify quotes to protect shell metacharacters and whitespace.
+/*	to a temporary file then renamed into place. 
+/*	Specify quotes to protect special characters and whitespace
+/*	on the fBpostconf\fR(1) command line.
 /*
 /*	The \fB-e\fR is no longer needed with Postfix version 2.8
 /*	and later.
@@ -244,9 +245,10 @@
 /*	options make the software increasingly verbose.
 /* .IP \fB-#\fR
 /*	Edit the \fBmain.cf\fR configuration file, and comment out
-/*	the specified parameters so that they revert to their default
-/*	values.  The file is copied to a temporary file then renamed
-/*	into place.
+/*	the parameters given on the \fBpostconf\fR(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 parameter names, not \fIname\fR=\fIvalue\fR
 /*	pairs.  There is no \fBpostconf\fR(1) command to perform
 /*	the reverse operation.
@@ -814,7 +816,7 @@ static void set_parameters(void)
      * The proposal below describes some of the steps needed to expand
      * parameter values. It has a problem: it updates the configuration
      * parameter dictionary, and in doing so breaks the "postconf -d"
-     * implementation.
+     * implementation. This makes "-d" and "-e" mutually exclusive.
      * 
      * Populate the configuration parameter dictionary with default settings or
      * with actual settings.
@@ -836,10 +838,10 @@ static void set_parameters(void)
 
 /* read_master - read and digest the master.cf file */
 
-static void read_master(void)
+static void read_master(int fail_on_open_error)
 {
     char   *path;
-    VSTRING *buf = vstring_alloc(100);
+    VSTRING *buf;
     ARGV   *argv;
     VSTREAM *fp;
     int     entry_count = 0;
@@ -870,31 +872,41 @@ static void read_master(void)
     master_table = (PC_MASTER_ENT *) mymalloc(sizeof(*master_table));
 
     /*
-     * Skip blank lines and comment lines.
+     * Skip blank lines and comment lines. Degrade gracefully if master.cf is
+     * not available, and master.cf is not the primary target.
      */
-    if ((fp = vstream_fopen(path, O_RDONLY, 0)) == 0)
-	msg_fatal("open %s: %m", path);
-    while (readlline(buf, fp, &line_count) != 0) {
-	master_table = (PC_MASTER_ENT *) myrealloc((char *) master_table,
+#define WARN_ON_OPEN_ERROR	0
+#define FAIL_ON_OPEN_ERROR	1
+
+    if ((fp = vstream_fopen(path, O_RDONLY, 0)) == 0) {
+	if (fail_on_open_error)
+	    msg_fatal("open %s: %m", path);
+	msg_warn("open %s: %m", path);
+    } else {
+	buf = vstring_alloc(100);
+	while (readlline(buf, fp, &line_count) != 0) {
+	    master_table = (PC_MASTER_ENT *) 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].name_space =
-	    concatenate(argv->argv[0], ".", argv->argv[1], (char *) 0);
-	master_table[entry_count].argv = argv;
-	master_table[entry_count].valid_names = 0;
-	master_table[entry_count].all_params = 0;
-	entry_count += 1;
+	    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].name_space =
+		concatenate(argv->argv[0], ".", argv->argv[1], (char *) 0);
+	    master_table[entry_count].argv = argv;
+	    master_table[entry_count].valid_names = 0;
+	    master_table[entry_count].all_params = 0;
+	    entry_count += 1;
+	}
+	vstream_fclose(fp);
+	vstring_free(buf);
     }
 
     /*
      * Null-terminate the master table and clean up.
      */
     master_table[entry_count].argv = 0;
-    vstream_fclose(fp);
     myfree(path);
-    vstring_free(buf);
 }
 
  /*
@@ -1042,8 +1054,8 @@ static void add_service_parameters(void)
 /* flag_user_parameter - flag user-defined name "valid" if it has name=value */
 
 static const char *flag_user_parameter(const char *mac_name,
-					        int unused_mode,
-					        char *context)
+				               int unused_mode,
+				               char *context)
 {
     PC_MASTER_ENT *local_scope = (PC_MASTER_ENT *) context;
 
@@ -2102,7 +2114,7 @@ int     main(int argc, char **argv)
      * If showing master.cf entries, show them and exit
      */
     else if (cmd_mode & SHOW_MASTER) {
-	read_master();
+	read_master(FAIL_ON_OPEN_ERROR);
 	show_master(cmd_mode, argv + optind);
     }
 
@@ -2140,7 +2152,7 @@ int     main(int argc, char **argv)
 	 * and user-defined parameters ($name macros in parameter values in
 	 * main.cf and master.cf).
 	 */
-	read_master();
+	read_master(WARN_ON_OPEN_ERROR);
 	add_service_parameters();
 	if ((cmd_mode & SHOW_DEFS) == 0)
 	    add_user_parameters();
diff --git a/postfix/src/postconf/test16.ref b/postfix/src/postconf/test16.ref
new file mode 100644
index 000000000..a1c2e06a7
--- /dev/null
+++ b/postfix/src/postconf/test16.ref
@@ -0,0 +1,2 @@
+./postconf: warning: open ./master.cf: No such file or directory
+config_directory = .
diff --git a/postfix/src/postconf/test17.ref b/postfix/src/postconf/test17.ref
new file mode 100644
index 000000000..bcfb71671
--- /dev/null
+++ b/postfix/src/postconf/test17.ref
@@ -0,0 +1 @@
+./postconf: fatal: open ./master.cf: No such file or directory