]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.9-20111122
authorWietse Venema <wietse@porcupine.org>
Tue, 22 Nov 2011 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:37:39 +0000 (06:37 +0000)
14 files changed:
postfix/HISTORY
postfix/README_FILES/VERP_README
postfix/html/VERP_README.html
postfix/html/postconf.1.html
postfix/html/postconf.5.html
postfix/man/man1/postconf.1
postfix/man/man5/postconf.5
postfix/proto/VERP_README.html
postfix/proto/postconf.proto
postfix/src/global/mail_version.h
postfix/src/postconf/Makefile.in
postfix/src/postconf/postconf.c
postfix/src/postconf/test16.ref [new file with mode: 0644]
postfix/src/postconf/test17.ref [new file with mode: 0644]

index d38c6ca8ad9df08faa3c64b9718b853d4078ff67..f3057480b8c49d39459642f2b51b409cbd85f09c 100644 (file)
@@ -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.
index 94ce80b18b74aee98515a707740aea0c1191e555..5a5a1c2b1233d35fbafac6168aa59ecf93e4e51f 100644 (file)
@@ -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.
 
 U\bUs\bsi\bin\bng\bg V\bVE\bER\bRP\bP w\bwi\bit\bth\bh m\bma\baj\bjo\bor\brd\bdo\bom\bmo\bo e\bet\btc\bc.\b. m\bma\bai\bil\bli\bin\bng\bg l\bli\bis\bst\bts\bs
 
@@ -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:<listname@example\.com>.*)/ $1 XVERP
+
 V\bVE\bER\bRP\bP s\bsu\bup\bpp\bpo\bor\brt\bt i\bin\bn t\bth\bhe\be P\bPo\bos\bst\btf\bfi\bix\bx s\bse\ben\bnd\bdm\bma\bai\bil\bl c\bco\bom\bmm\bma\ban\bnd\bd
 
 The Postfix sendmail command has a -V flag to request VERP style delivery.
index 5cb63e1992fb29c2d4ed9b355a3242b91425a6fd..3ae4ab161962c470d5c49f43a9460411b1f3c334 100644 (file)
@@ -98,8 +98,8 @@ parameters.
 
 <dt> <a href="postconf.5.html#disable_verp_bounces">disable_verp_bounces</a> (default: no) 
 
-    <dd> <p> if Postfix sends one bounce report for multi-recipient
-    VERP mail, or one bounce report per recipient. The default,
+    <dd> <p> 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. </p> </dd>
 
 </dl>
@@ -217,6 +217,21 @@ MAIL FROM:&lt;sender@domain&gt; XVERP=+=
 second form overrides them explicitly. The values shown are the
 recommended ones. </p>
 
+<p> You can use the <a href="postconf.5.html#smtpd_command_filter">smtpd_command_filter</a> feature to append XVERP
+to SMTP commands from legacy sofware. This requires Postfix 2.7
+or later. </p>
+
+<blockquote>
+<pre>
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
+    <a href="postconf.5.html#smtpd_command_filter">smtpd_command_filter</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/append_verp.pcre
+    <a href="postconf.5.html#smtpd_authorized_verp_clients">smtpd_authorized_verp_clients</a> = $<a href="postconf.5.html#mynetworks">mynetworks</a>
+
+/etc/postfix/append_verp.<a href="pcre_table.5.html">pcre</a>:
+    /^(MAIL FROM:&lt;listname@example\.com&gt;.*)/ $1 XVERP
+</pre>
+</blockquote>
+
 <h2> <a name="sendmail"> VERP support in the Postfix sendmail command </a> </h2>
 
 <p> The Postfix sendmail command has a -V flag to request VERP style
index 712e9f0dad9e40554df6bab11ad776a91c2f6dcd..bbbb551d23f4854661da4ab208eb2aed61a0ff86 100644 (file)
@@ -99,8 +99,8 @@ POSTCONF(1)                                                        POSTCONF(1)
               parameter settings with the "<i>name</i>=<i>value</i>"  pairs  on
               the <a href="postconf.1.html"><b>postconf</b>(1)</a> 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 f<a href="postconf.1.html">Bpostconf(1)</a> command line.
 
               The <b>-e</b> is no longer needed with Postfix version 2.8
               and later.
@@ -286,14 +286,15 @@ POSTCONF(1)                                                        POSTCONF(1)
               verbose.
 
        <b>-#</b>     Edit  the  <a href="postconf.5.html"><b>main.cf</b></a>  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  <i>name</i>=<i>value</i> pairs.
-              There is no  <a href="postconf.1.html"><b>postconf</b>(1)</a>  command  to  perform  the
-              reverse operation.
-
-              This  feature  is  available  with  Postfix 2.6 and
+              out the parameters given on the <a href="postconf.1.html"><b>postconf</b>(1)</a> 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 <i>name</i>=<i>value</i> pairs.  There is no
+              <a href="postconf.1.html"><b>postconf</b>(1)</a>  command  to perform the reverse opera-
+              tion.
+
+              This feature is  available  with  Postfix  2.6  and
               later.
 
 <b>DIAGNOSTICS</b>
@@ -304,18 +305,18 @@ POSTCONF(1)                                                        POSTCONF(1)
               Directory with Postfix configuration files.
 
 <b>CONFIGURATION PARAMETERS</b>
-       The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are  especially  relevant
+       The  following  <a href="postconf.5.html"><b>main.cf</b></a> 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
        <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including examples.
 
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The default location of  the  Postfix  <a href="postconf.5.html">main.cf</a>  and
+              The  default  location  of  the Postfix <a href="postconf.5.html">main.cf</a> and
               <a href="master.5.html">master.cf</a> configuration files.
 
        <b><a href="postconf.5.html#bounce_template_file">bounce_template_file</a> (empty)</b>
-              Pathname  of  a configuration file with bounce mes-
+              Pathname of a configuration file with  bounce  mes-
               sage templates.
 
 <b>FILES</b>
@@ -331,7 +332,7 @@ POSTCONF(1)                                                        POSTCONF(1)
        <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
index 35aa2c307aa46f311873d8b4fa8010061a31937c..fe0faa867fcc4e3e40562d2d852d29072015fc82 100644 (file)
@@ -12385,6 +12385,12 @@ feature: </p>
     /^RCPT\s+TO:\s*&lt;'([^[:space:]]+)'&gt;(.*)/     RCPT TO:&lt;$1&gt;$2
 </pre>
 
+<pre>
+    # Append XVERP to MAIL FROM commands to request VERP-style delivery.
+    # See <a href="VERP_README.html">VERP_README</a> for more information on how to use Postfix VERP.
+    /^(MAIL FROM:&lt;listname@example\.com&gt;.*)/   $1 XVERP
+</pre>
+
 <pre>
     # Bounce-never mail sink. Use <a href="postconf.5.html#notify_classes">notify_classes</a>=bounce,resource,software
     # to send bounced mail to the postmaster (with message body removed).
index 941b7daf6fd37fe905177d25541c561af2e6458f..13ced579f6bafeebc87ebd46ecf29f7dbbcd6892 100644 (file)
@@ -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.
index efb99f01ea7bfd3a04e1576b1fddf9d490a3a60f..a8346737c0cf446479a26d9c03354391b7170963 100644 (file)
@@ -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:<listname@example\e.com>.*)/   $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).
index 6aeecb41da442efb711bbc9a93ce082486af8f4b..8f0e248b39b73d7be229e854afb1b162b213a790 100644 (file)
@@ -98,8 +98,8 @@ parameters.
 
 <dt> disable_verp_bounces (default: no) 
 
-    <dd> <p> if Postfix sends one bounce report for multi-recipient
-    VERP mail, or one bounce report per recipient. The default,
+    <dd> <p> 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. </p> </dd>
 
 </dl>
@@ -217,6 +217,21 @@ MAIL FROM:&lt;sender@domain&gt; XVERP=+=
 second form overrides them explicitly. The values shown are the
 recommended ones. </p>
 
+<p> You can use the smtpd_command_filter feature to append XVERP
+to SMTP commands from legacy sofware. This requires Postfix 2.7
+or later. </p>
+
+<blockquote>
+<pre>
+/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:&lt;listname@example\.com&gt;.*)/ $1 XVERP
+</pre>
+</blockquote>
+
 <h2> <a name="sendmail"> VERP support in the Postfix sendmail command </a> </h2>
 
 <p> The Postfix sendmail command has a -V flag to request VERP style
index 7b55f390af18d6432197bc7d415479c15f687c68..0a63df48ba6e3b30c7fe84b00bf970b6c539540a 100644 (file)
@@ -13021,6 +13021,12 @@ feature: </p>
     /^RCPT\s+TO:\s*&lt;'([^[:space:]]+)'&gt;(.*)/     RCPT TO:&lt;$1&gt;$2
 </pre>
 
+<pre>
+    # 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:&lt;listname@example\.com&gt;.*)/   $1 XVERP
+</pre>
+
 <pre>
     # Bounce-never mail sink. Use notify_classes=bounce,resource,software 
     # to send bounced mail to the postmaster (with message body removed).
index da402c90313af622cfe6dede2fd229e76a21700c..3c38cc398a4597efde66cfd27ca523549ed28404 100644 (file)
@@ -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
index ca31397cd45a7bcb6df070a054748ee5af43b23a..748d2e32b8810b92143676aba32bb47a21c795a3 100644 (file)
@@ -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
index a786a1ee1143de1982d1bf7ac85d9817fab407f2..0af9d13fd7b4a14a8a6405535824d30547242f9e 100644 (file)
@@ -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.
 /*     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 (file)
index 0000000..a1c2e06
--- /dev/null
@@ -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 (file)
index 0000000..bcfb716
--- /dev/null
@@ -0,0 +1 @@
+./postconf: fatal: open ./master.cf: No such file or directory