]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.6-20210410
authorWietse Venema <wietse@porcupine.org>
Sat, 10 Apr 2021 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Mon, 12 Apr 2021 21:02:33 +0000 (17:02 -0400)
14 files changed:
postfix/HISTORY
postfix/README_FILES/OVERVIEW
postfix/WISHLIST
postfix/html/OVERVIEW.html
postfix/html/postfix.1.html
postfix/man/man1/postfix.1
postfix/proto/OVERVIEW.html
postfix/src/global/Makefile.in
postfix/src/global/mail_task.c
postfix/src/global/mail_version.h
postfix/src/postfix/postfix.c
postfix/src/util/check_arg.h
postfix/src/util/cidr_match.c
postfix/src/util/dict_cidr.ref

index f193a852262032323fe065703b7f3d52a50f619f..c05ca1a72ab4fce37e09493559f0f137dcd0d65d 100644 (file)
@@ -25473,10 +25473,28 @@ Apologies for any names omitted.
        by Coverity, reported by Jaroslav Skarvada. Fix by Viktor
        Dukhovni. File: global/haproxy_srvr.c.
 
-       Missing null pointer check (introduced: Postfix alpha) after
-       null argv[0] value. Found by Coverity, reported by Jaroslav
-       Skarvada. File: global/mail_task.c.
-
 20210404
 
        Unbroke a ton of regression tests after DNS-related changes.
+
+20210406
+
+       More specific warnings for incorrect net/mask syntax. Files:
+       util/cidr_match.c, util/dict_cidr.ref.
+
+20210410
+
+       Added an msg_panic() call to silence a Coverity warning,
+       File: global/mail_task.c.
+
+       Documentation: updated containerization suggestions in
+       the postfix(1) manpage. File: postfix/postfix.c.
+
+       Documentation: added text and ASCII art to illustrate how
+       tlsproxy(8) is used for outbound SMTP connection caching
+       and for inbound postscreen(8) TLS support. File:
+       proto/OVERVIEW.html.
+
+       Documentation: added text and ASCII art to illustrate how
+       postlogd(8) provides an alternative to syslog logging.
+       File: proto/OVERVIEW.html.
index e4344a11610f52f00843e5c7ae82f7264dc983db..d45672e106e3c7f59e477037fe850460eb027cc2 100644 (file)
@@ -282,16 +282,41 @@ queues.
     Postfix version 2.2 and later. More information about this feature is in
     the CONNECTION_CACHE_README document.
 
-            /-- smtp(8) --> Internet
+            /--  smtp(8)  --> Internet
 
     qmgr(8)
-                 |
-            \--  | smtp(8) --> Internet
-                 |
-                 ^
-                 |
+                |
+            \-- |    smtp(8)
+                |
+                |     ^
+                v     |
+
+                scache(8)
+
+    A Postfix smtp(8) client can reuse a TLS-encrypted connection (with
+    "smtp_tls_connection_reuse = yes"). This can greatly reduce the overhead of
+    connection setup and improves message delivery rates. After a Postfix smtp
+    (8) client connects to a remote SMTP server and sends plaintext EHLO and
+    STARTTLS commands, the smtp(8) client inserts a tlsproxy(8) process into
+    the connection as shown below.
+
+    After the mail transaction completes, the Postfix smtp(8) client gives its
+    connection to the tlsproxy(8) process to the scache(8) server, which keeps
+    the connection open for a limited amount of time. The smtp(8) client
+    continues with some other mail delivery request. Meanwhile, any Postfix
+    smtp(8) client can ask the scache(8) server for that cached connection and
+    reuse it for mail delivery.
+
+            /--  smtp(8)  --> tlsproxy(8) --> Internet
 
-                 scache(8)
+    qmgr(8)
+                |
+            \-- |    smtp(8)
+                |
+                |     ^
+                v     |
+
+                scache(8)
 
   * The showq(8) servers list the Postfix queue status. This is the queue
     listing service that does the work for the mailq(1) and postqueue(1)
@@ -375,25 +400,43 @@ queues.
     the implementation simple, postscreen(8) delegates DNS allow/denylist
     lookups to dnsblog(8) server processes, and delegates TLS encryption/
     decryption to tlsproxy(8) server processes. This delegation is invisible to
-    the remote SMTP client, and is not shown in the diagram below.
+    the remote SMTP client.
+
+                zombie
+
+                         \
+
+    zombie - tlsproxy(8) -                    - smtpd(8)
+
+                           \               /
+
+                 other   --- postscreen(8)
+
+                           /               \
 
-    zombie
+                 other   -                    - smtpd(8)
 
-           \
+                         /
 
-    zombie -                    - smtpd(8)
+                zombie
 
-             \               /
+  * The postlogd(8) server provides an alternative to syslog logging, which
+    remains the default. This feature is available with Postfix version 3.4 or
+    later, and supports the following modes:
 
-    other  --- postscreen(8)
+      o Logging to file, which addresses a usability problem with MacOS, and
+        eliminates information loss caused by systemd rate limits.
 
-             /               \
+         commands    -> postlogd(8) -> /path/to/file
+        or daemons
 
-    other  -                    - smtpd(8)
+      o Logging to stdout, which eliminates a syslog dependency when Postfix
+        runs inside a container.
 
-           /
+         commands  -> postlogd(8) ->    stdout inherited
+        or daemons                   from "postfix start-fg"
 
-    zombie
+    See MAILLOG_README for details and limitations.
 
 P\bPo\bos\bst\btf\bfi\bix\bx s\bsu\bup\bpp\bpo\bor\brt\bt c\bco\bom\bmm\bma\ban\bnd\bds\bs
 
index 32c59c0ea17948066ee94870c6a73c0a6b5e9db7..757bb98028063071ba488315dfce0633f16fedf1 100644 (file)
@@ -1,8 +1,5 @@
 Wish list:
 
-       Update the OVERVIEW page: add postlogd; add tlsproxy to
-       connection caching section.
-
        Make smtpd_relay_before_recipient_restrictions settable
        in smtpd_checks tests.
 
index ba25fdc7b3a77af34f00f52d5c1eb56b38bcee0d..be680e02e5698d877ae54dc672099d414fb4b821 100644 (file)
@@ -561,21 +561,59 @@ about this feature is in the <a href="CONNECTION_CACHE_README.html">CONNECTION_C
 
 <tr> <td> </td> <td> <tt> /-- </tt> </td> <td align="center"
 colspan="3" bgcolor="#f0f0ff"> <a href="smtp.8.html">smtp(8)</a> </td> <td colspan="2"> <tt>
---&gt; </tt> Internet </td> </tr>
+--&gt; </tt> </td> <td> Internet </td> </tr>
+
 <tr> <td align="center" bgcolor="#f0f0ff"> <a href="qmgr.8.html">qmgr(8)</a> </td> <td> </td>
-<td align="center" rowspan="3"> &nbsp; </td> <td align="center"
-rowspan="3"><tt>|<br>|<br>|<br>|<br>v</tt></td> <td> &nbsp; </td>
+<td align="center" rowspan="3"><tt>|<br>|<br>|<br>|<br>v</tt></td>
 </tr>
  
-<tr> <td> </td> <td> <tt> \-- </tt> </td> <td align="center"
-colspan="2" bgcolor="#f0f0ff"> <a href="smtp.8.html">smtp(8)</a> </td> <td align="left"> <tt>
---&gt; </tt> Internet </td> </tr>
-<tr> <td colspan="3"> </td> <td align="center"><tt>^<br>|</tt></td>
-<td> &nbsp; </td> </tr>
+<tr> <td> &nbsp; </td> <td> <tt> \-- </tt> </td> <td align="center"
+colspan="4" bgcolor="#f0f0ff"> <a href="smtp.8.html">smtp(8)</a> </td> <td align="left">
+&nbsp; </td> </tr>
+
+<tr> <td colspan="2"> &nbsp; </td> <td> </td> <td
+align="center"><tt>^<br>|</tt></td> </tr>
+
+<tr> <td colspan="2"> </td> <td align="center" colspan="3"
+bgcolor="#f0f0ff"> <a href="scache.8.html">scache(8)</a> </td> </tr>
+
+</table>
+
+<p> A Postfix <a href="smtp.8.html">smtp(8)</a> client can reuse a TLS-encrypted connection
+(with "<a href="postconf.5.html#smtp_tls_connection_reuse">smtp_tls_connection_reuse</a> = yes"). This can greatly reduce
+the overhead of connection setup and improves message delivery
+rates. After a Postfix <a href="smtp.8.html">smtp(8)</a> client connects to a remote SMTP
+server and sends plaintext EHLO and STARTTLS commands, the <a href="smtp.8.html">smtp(8)</a>
+client inserts a <a href="tlsproxy.8.html">tlsproxy(8)</a> process into the connection as shown
+below. </p>
+
+<p> After the mail transaction completes, the Postfix <a href="smtp.8.html">smtp(8)</a> client
+gives its connection to the <a href="tlsproxy.8.html">tlsproxy(8)</a> process to the <a href="scache.8.html">scache(8)</a>
+server, which keeps the connection open for a limited amount of
+time. The <a href="smtp.8.html">smtp(8)</a> client continues with some other mail delivery
+request. Meanwhile, any Postfix <a href="smtp.8.html">smtp(8)</a> client can ask the <a href="scache.8.html">scache(8)</a>
+server for that cached connection and reuse it for mail delivery.
+</p>
+
+<table>
+
+<tr> <td> </td> <td> <tt> /-- </tt> </td> <td align="center"
+colspan="3" bgcolor="#f0f0ff"> <a href="smtp.8.html">smtp(8)</a> </td> <td colspan="2"> <tt>
+--&gt; </tt> </td> <td align="center"bgcolor="#f0f0ff"> <a href="tlsproxy.8.html">tlsproxy(8)</a>
+</td> <td> <tt> --&gt; </tt> </td> <td> Internet </td> </tr>
+
+<tr> <td align="center" bgcolor="#f0f0ff"> <a href="qmgr.8.html">qmgr(8)</a> </td> <td> </td>
+<td align="center" rowspan="3"><tt>|<br>|<br>|<br>|<br>v</tt></td>
+</tr>
  
-<tr> <td colspan="3"> </td> <td align="center" colspan="3"
+<tr> <td> &nbsp; </td> <td> <tt> \-- </tt> </td> <td align="center"
+colspan="4" bgcolor="#f0f0ff"> <a href="smtp.8.html">smtp(8)</a> </td> <td align="left">
+&nbsp; </td> </tr>
+
+<tr> <td colspan="2"> &nbsp; </td> <td> </td> <td
+align="center"><tt>^<br>|</tt></td> </tr>
+
+<tr> <td colspan="2"> </td> <td align="center" colspan="3"
 bgcolor="#f0f0ff"> <a href="scache.8.html">scache(8)</a> </td> </tr>
 
 </table>
@@ -746,41 +784,85 @@ pass its tests; by allowing allowlisted clients to skip tests,
 later. To keep the implementation simple, <a href="postscreen.8.html">postscreen(8)</a> delegates
 DNS allow/denylist lookups to <a href="dnsblog.8.html">dnsblog(8)</a> server processes, and
 delegates TLS encryption/decryption to <a href="tlsproxy.8.html">tlsproxy(8)</a> server processes.
-This delegation is invisible to the remote SMTP client, and is not
-shown in the diagram below.  </p>
+This delegation is invisible to the remote SMTP client. </p>
 
 <table>
 
-<tr> <td> zombie </td> </tr>
+<tr> <td colspan="2"> </td> <td align="center"> zombie </td> </tr>
 
-<tr> <td>  </td> <td align="left"> <tt> \ </tt> </td> </tr>
+<tr> <td colspan="3">  </td> <td align="left"> <tt> \ </tt> </td> </tr>
 
-<tr> <td> zombie </td> <td align="left"> <tt> - </tt> </td> <td>
+<tr> <td> zombie </td> <td> <tt> - </tt> </td> <td bgcolor="#f0f0ff" align="center"> <a href="tlsproxy.8.html">tlsproxy(8)</a> </td> <td align="left"> <tt> - </tt> </td> <td>
 </td> <td>  </td> <td>  </td> <td align="right"> <tt> - </tt> </td>
 <td bgcolor="#f0f0ff" align="center"> <a href="smtpd.8.html">smtpd(8)</a> </td> </tr>
 
-<tr> <td>  </td> <td align="right"> <tt> \ </tt> </td> <td> </td>
+<tr> <td colspan="3">  </td> <td align="right"> <tt> \ </tt> </td> <td> </td>
 <td align="left"> <tt> / </tt> </td> </tr>
 
-<tr> <td bgcolor="#f0f0ff" align="center"> other </td> <td> <tt>
+<tr> <td colspan="2"> </td> <td bgcolor="#f0f0ff" align="center"> other </td> <td> <tt>
 --- </tt> </td> <td bgcolor="#f0f0ff" align="center" valign="middle">
 <a href="postscreen.8.html">postscreen(8)</a> </td> </tr>
 
-<tr> <td>  </td> <td align="right"> <tt> / </tt> </td> <td> </td>
+<tr> <td colspan="3">  </td> <td align="right"> <tt> / </tt> </td> <td> </td>
 <td align="right"> <tt> \ </tt> </td> </tr>
 
-<tr> <td bgcolor="#f0f0ff" align="center"> other </td> <td align="left">
+<tr> <td colspan="2"> </td> <td bgcolor="#f0f0ff" align="center"> other </td> <td align="left">
 <tt> - </tt> </td> <td> </td> <td>  </td> <td>  </td> <td align="right">
 <tt> - </tt> </td> <td bgcolor="#f0f0ff" align="center"> <a href="smtpd.8.html">smtpd(8)</a>
 </td> </tr>
 
-<tr> <td>  </td> <td align="left"> <tt> / </tt> </td> </tr>
+<tr> <td colspan="3">  </td> <td align="left"> <tt> / </tt> </td> </tr>
 
-<tr> <td> zombie </td> </tr>
+<tr> <td colspan="2"> </td> <td align="center"> zombie </td> </tr>
 
+</table>
+
+<li> <p>The <a href="postlogd.8.html">postlogd(8)</a> server provides an alternative to syslog
+logging, which remains the default. This feature is available with
+Postfix version 3.4 or later, and supports the following modes:
+</p>
+
+
+<ul>
+
+<li> <p>Logging to file, which addresses a usability problem with
+MacOS, and eliminates information loss caused by systemd rate limits.
+</p>
+
+<table>
+
+<tr> <td bgcolor="#f0f0ff" rowspan="3" valign="middle" align="center">
+commands<br>or daemons</td> <td colspan="4"> &nbsp; </td> </tr>
+
+<tr> <td colspan="2"> <td> <tt> -&gt; </tt> </td> <td bgcolor="#f0f0ff">
+<a href="postlogd.8.html">postlogd(8)</a> </td> <td> <tt> -&gt; </tt> </td> <td> /path/to/file
+</td> </tr>
+
+<tr> <td colspan=6> &nbsp; </td> </tr>
 
 </table>
 
+<li> <p>Logging to stdout, which eliminates a syslog dependency
+when Postfix runs inside a container. </p>
+
+<table>
+
+<tr> <td bgcolor="#f0f0ff" rowspan="3" valign="middle" align="center">
+commands<br>or daemons</td> <td colspan="4"> &nbsp; </td> <td
+rowspan="3" align="center"> stdout inherited<br>from "postfix
+start-fg" </td> </tr>
+
+<tr> <td colspan="2"> <tt> -&gt; </tt> </td> <td bgcolor="#f0f0ff">
+<a href="postlogd.8.html">postlogd(8)</a> </td> <td> <tt> -&gt; </tt> </td> </tr>
+
+<tr> <td colspan=5> &nbsp; </td> </tr>
+
+</table>
+
+</ul>
+
+<p> See <a href="MAILLOG_README.html">MAILLOG_README</a> for details and limitations. </p>
+
 </ul>
 
 <h2> <a name="commands"> Postfix support commands </a> </h2>
index 32c04801c97fe3f04f1fc7ae3fe9831684e989e6..4541c47db422914ae0275e0374d483432db422a9 100644 (file)
@@ -41,11 +41,15 @@ POSTFIX(1)                                                          POSTFIX(1)
               ground,  and enable <a href="master.8.html"><b>master</b>(8)</a> "init" mode when running as PID 1.
               This command requires that multi-instance  support  is  disabled
               (i.e.  the  <a href="postconf.5.html#multi_instance_directories">multi_instance_directories</a>  parameter  value must be
-              empty). When running Postfix inside a container, mount the  con-
-              tainer  host's  /dev/log  socket  inside the container (example:
-              "docker run -v /dev/log:/dev/log ...")  and specify  a  distinct
-              Postfix  "<a href="postconf.5.html#syslog_name">syslog_name</a>"  prefix  that identifies logging from the
-              Postfix instance.
+              empty).
+
+              When running Postfix inside a container, see <a href="MAILLOG_README.html">MAILLOG_README</a>  for
+              logging  to  stdout.  Postfix  logs  to syslog by default, which
+              requires a) running a syslogd process inside the  container,  or
+              b) mounting the container host's /dev/log socket inside the con-
+              tainer (example: "docker run -v /dev/log:/dev/log ..."), and  c)
+              a  distinct Postfix "<a href="postconf.5.html#syslog_name">syslog_name</a>" prefix that identifies logging
+              from the Postfix instance.
 
        <b>stop</b>   Stop the Postfix mail system in an orderly fashion. If possible,
               running  processes  are  allowed  to terminate at their earliest
index 0231ee6463b6246b3c048d119b7790c4b49e157d..5f52e69fd53ca133e2cc9a9b3bcbc3be469d347b 100644 (file)
@@ -43,11 +43,15 @@ in the foreground, and enable \fBmaster\fR(8) "init" mode
 when running as PID 1.
 This command requires that multi\-instance support is
 disabled (i.e. the multi_instance_directories parameter
-value must be empty). When running Postfix inside a container,
-mount the container host's /dev/log socket inside the
-container (example: "docker run \-v /dev/log:/dev/log ...")
-and specify a distinct Postfix "syslog_name" prefix that
-identifies logging from the Postfix instance.
+value must be empty).
+
+When running Postfix inside a container, see MAILLOG_README
+for logging to stdout. Postfix logs to syslog by default,
+which requires a) running a syslogd process inside the
+container, or b) mounting the container host's /dev/log
+socket inside the container (example: "docker run \-v
+/dev/log:/dev/log ..."), and c) a distinct Postfix "syslog_name"
+prefix that identifies logging from the Postfix instance.
 .IP \fBstop\fR
 Stop the Postfix mail system in an orderly fashion. If
 possible, running processes are allowed to terminate at
index a71527264dcae7d7b4d36dac4a81b862ad3d5a81..663070156f3540f98220f70d69b9445c280d31bd 100644 (file)
@@ -561,21 +561,59 @@ about this feature is in the CONNECTION_CACHE_README document. </p>
 
 <tr> <td> </td> <td> <tt> /-- </tt> </td> <td align="center"
 colspan="3" bgcolor="#f0f0ff"> smtp(8) </td> <td colspan="2"> <tt>
---&gt; </tt> Internet </td> </tr>
+--&gt; </tt> </td> <td> Internet </td> </tr>
+
 <tr> <td align="center" bgcolor="#f0f0ff"> qmgr(8) </td> <td> </td>
-<td align="center" rowspan="3"> &nbsp; </td> <td align="center"
-rowspan="3"><tt>|<br>|<br>|<br>|<br>v</tt></td> <td> &nbsp; </td>
+<td align="center" rowspan="3"><tt>|<br>|<br>|<br>|<br>v</tt></td>
 </tr>
  
-<tr> <td> </td> <td> <tt> \-- </tt> </td> <td align="center"
-colspan="2" bgcolor="#f0f0ff"> smtp(8) </td> <td align="left"> <tt>
---&gt; </tt> Internet </td> </tr>
-<tr> <td colspan="3"> </td> <td align="center"><tt>^<br>|</tt></td>
-<td> &nbsp; </td> </tr>
+<tr> <td> &nbsp; </td> <td> <tt> \-- </tt> </td> <td align="center"
+colspan="4" bgcolor="#f0f0ff"> smtp(8) </td> <td align="left">
+&nbsp; </td> </tr>
+
+<tr> <td colspan="2"> &nbsp; </td> <td> </td> <td
+align="center"><tt>^<br>|</tt></td> </tr>
+
+<tr> <td colspan="2"> </td> <td align="center" colspan="3"
+bgcolor="#f0f0ff"> scache(8) </td> </tr>
+
+</table>
+
+<p> A Postfix smtp(8) client can reuse a TLS-encrypted connection
+(with "smtp_tls_connection_reuse = yes"). This can greatly reduce
+the overhead of connection setup and improves message delivery
+rates. After a Postfix smtp(8) client connects to a remote SMTP
+server and sends plaintext EHLO and STARTTLS commands, the smtp(8)
+client inserts a tlsproxy(8) process into the connection as shown
+below. </p>
+
+<p> After the mail transaction completes, the Postfix smtp(8) client
+gives its connection to the tlsproxy(8) process to the scache(8)
+server, which keeps the connection open for a limited amount of
+time. The smtp(8) client continues with some other mail delivery
+request. Meanwhile, any Postfix smtp(8) client can ask the scache(8)
+server for that cached connection and reuse it for mail delivery.
+</p>
+
+<table>
+
+<tr> <td> </td> <td> <tt> /-- </tt> </td> <td align="center"
+colspan="3" bgcolor="#f0f0ff"> smtp(8) </td> <td colspan="2"> <tt>
+--&gt; </tt> </td> <td align="center"bgcolor="#f0f0ff"> tlsproxy(8)
+</td> <td> <tt> --&gt; </tt> </td> <td> Internet </td> </tr>
+
+<tr> <td align="center" bgcolor="#f0f0ff"> qmgr(8) </td> <td> </td>
+<td align="center" rowspan="3"><tt>|<br>|<br>|<br>|<br>v</tt></td>
+</tr>
  
-<tr> <td colspan="3"> </td> <td align="center" colspan="3"
+<tr> <td> &nbsp; </td> <td> <tt> \-- </tt> </td> <td align="center"
+colspan="4" bgcolor="#f0f0ff"> smtp(8) </td> <td align="left">
+&nbsp; </td> </tr>
+
+<tr> <td colspan="2"> &nbsp; </td> <td> </td> <td
+align="center"><tt>^<br>|</tt></td> </tr>
+
+<tr> <td colspan="2"> </td> <td align="center" colspan="3"
 bgcolor="#f0f0ff"> scache(8) </td> </tr>
 
 </table>
@@ -746,41 +784,85 @@ postscreen(8) minimizes its impact on legitimate email traffic.
 later. To keep the implementation simple, postscreen(8) delegates
 DNS allow/denylist lookups to dnsblog(8) server processes, and
 delegates TLS encryption/decryption to tlsproxy(8) server processes.
-This delegation is invisible to the remote SMTP client, and is not
-shown in the diagram below.  </p>
+This delegation is invisible to the remote SMTP client. </p>
 
 <table>
 
-<tr> <td> zombie </td> </tr>
+<tr> <td colspan="2"> </td> <td align="center"> zombie </td> </tr>
 
-<tr> <td>  </td> <td align="left"> <tt> \ </tt> </td> </tr>
+<tr> <td colspan="3">  </td> <td align="left"> <tt> \ </tt> </td> </tr>
 
-<tr> <td> zombie </td> <td align="left"> <tt> - </tt> </td> <td>
+<tr> <td> zombie </td> <td> <tt> - </tt> </td> <td bgcolor="#f0f0ff" align="center"> tlsproxy(8) </td> <td align="left"> <tt> - </tt> </td> <td>
 </td> <td>  </td> <td>  </td> <td align="right"> <tt> - </tt> </td>
 <td bgcolor="#f0f0ff" align="center"> smtpd(8) </td> </tr>
 
-<tr> <td>  </td> <td align="right"> <tt> \ </tt> </td> <td> </td>
+<tr> <td colspan="3">  </td> <td align="right"> <tt> \ </tt> </td> <td> </td>
 <td align="left"> <tt> / </tt> </td> </tr>
 
-<tr> <td bgcolor="#f0f0ff" align="center"> other </td> <td> <tt>
+<tr> <td colspan="2"> </td> <td bgcolor="#f0f0ff" align="center"> other </td> <td> <tt>
 --- </tt> </td> <td bgcolor="#f0f0ff" align="center" valign="middle">
 postscreen(8) </td> </tr>
 
-<tr> <td>  </td> <td align="right"> <tt> / </tt> </td> <td> </td>
+<tr> <td colspan="3">  </td> <td align="right"> <tt> / </tt> </td> <td> </td>
 <td align="right"> <tt> \ </tt> </td> </tr>
 
-<tr> <td bgcolor="#f0f0ff" align="center"> other </td> <td align="left">
+<tr> <td colspan="2"> </td> <td bgcolor="#f0f0ff" align="center"> other </td> <td align="left">
 <tt> - </tt> </td> <td> </td> <td>  </td> <td>  </td> <td align="right">
 <tt> - </tt> </td> <td bgcolor="#f0f0ff" align="center"> smtpd(8)
 </td> </tr>
 
-<tr> <td>  </td> <td align="left"> <tt> / </tt> </td> </tr>
+<tr> <td colspan="3">  </td> <td align="left"> <tt> / </tt> </td> </tr>
 
-<tr> <td> zombie </td> </tr>
+<tr> <td colspan="2"> </td> <td align="center"> zombie </td> </tr>
 
+</table>
+
+<li> <p>The postlogd(8) server provides an alternative to syslog
+logging, which remains the default. This feature is available with
+Postfix version 3.4 or later, and supports the following modes:
+</p>
+
+
+<ul>
+
+<li> <p>Logging to file, which addresses a usability problem with
+MacOS, and eliminates information loss caused by systemd rate limits.
+</p>
+
+<table>
+
+<tr> <td bgcolor="#f0f0ff" rowspan="3" valign="middle" align="center">
+commands<br>or daemons</td> <td colspan="4"> &nbsp; </td> </tr>
+
+<tr> <td colspan="2"> <td> <tt> -&gt; </tt> </td> <td bgcolor="#f0f0ff">
+postlogd(8) </td> <td> <tt> -&gt; </tt> </td> <td> /path/to/file
+</td> </tr>
+
+<tr> <td colspan=6> &nbsp; </td> </tr>
 
 </table>
 
+<li> <p>Logging to stdout, which eliminates a syslog dependency
+when Postfix runs inside a container. </p>
+
+<table>
+
+<tr> <td bgcolor="#f0f0ff" rowspan="3" valign="middle" align="center">
+commands<br>or daemons</td> <td colspan="4"> &nbsp; </td> <td
+rowspan="3" align="center"> stdout inherited<br>from "postfix
+start-fg" </td> </tr>
+
+<tr> <td colspan="2"> <tt> -&gt; </tt> </td> <td bgcolor="#f0f0ff">
+postlogd(8) </td> <td> <tt> -&gt; </tt> </td> </tr>
+
+<tr> <td colspan=5> &nbsp; </td> </tr>
+
+</table>
+
+</ul>
+
+<p> See MAILLOG_README for details and limitations. </p>
+
 </ul>
 
 <h2> <a name="commands"> Postfix support commands </a> </h2>
index 0fab4ceb61e9b4f586ffa78a59952b2e0e0715c7..e12397d12c4c57562c5099cdc9258a6ab5f596e7 100644 (file)
@@ -1989,6 +1989,7 @@ mail_stream.o: mail_stream.c
 mail_stream.o: mail_stream.h
 mail_stream.o: opened.h
 mail_task.o: ../../include/check_arg.h
+mail_task.o: ../../include/msg.h
 mail_task.o: ../../include/safe.h
 mail_task.o: ../../include/sys_defs.h
 mail_task.o: ../../include/vbuf.h
index 733645d380d1aec5330c76cdde06494698ccdedf..4f006768b830787ea49bdbf1b0b81646da21e3be 100644 (file)
@@ -18,7 +18,9 @@
 /*     The result is overwritten with each call.
 /*
 /*     A null argv0 argument requests that the current result is
-/*     returned, or "unknown" when no current result exists.
+/*     returned.
+/* DIAGNOSTICS
+/*     Panic: argv0 is a null pointer, but no current result exists.
 /* LICENSE
 /* .ad
 /* .fi
@@ -44,6 +46,7 @@
 
 #include <vstring.h>
 #include <safe.h>
+#include <msg.h>
 
 /* Global library. */
 
@@ -59,8 +62,6 @@ const char *mail_task(const char *argv0)
     const char *slash;
     const char *tag;
 
-    if (argv0 == 0 && canon_name == 0)
-       argv0 = "unknown";
     if (argv0) {
        if (canon_name == 0)
            canon_name = vstring_alloc(10);
@@ -73,5 +74,7 @@ const char *mail_task(const char *argv0)
                mail_conf_eval(DEF_SYSLOG_NAME);
        vstring_sprintf(canon_name, "%s/%s", tag, argv0);
     }
+    if (canon_name == 0)
+       msg_panic("mail_task: no current result");
     return (vstring_str(canon_name));
 }
index 4586850a82e5adf2e8e9263eb90a8936644b2122..9b5e60df970e61e4c1de35e410cdedeafadddd4d 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      "20210405"
+#define MAIL_RELEASE_DATE      "20210410"
 #define MAIL_VERSION_NUMBER    "3.6"
 
 #ifdef SNAPSHOT
index 2270ce41baaec9211a36542d452fa920f6db030a..357124ff5c579103273ff0e5f254b3ff50f85a4f 100644 (file)
 /*     when running as PID 1.
 /*     This command requires that multi-instance support is
 /*     disabled (i.e. the multi_instance_directories parameter
-/*     value must be empty). When running Postfix inside a container,
-/*     mount the container host's /dev/log socket inside the
-/*     container (example: "docker run -v /dev/log:/dev/log ...")
-/*     and specify a distinct Postfix "syslog_name" prefix that
-/*     identifies logging from the Postfix instance.
+/*     value must be empty). 
+/*
+/*     When running Postfix inside a container, see MAILLOG_README
+/*     for logging to stdout. Postfix logs to syslog by default,
+/*     which requires a) running a syslogd process inside the
+/*     container, or b) mounting the container host's /dev/log
+/*     socket inside the container (example: "docker run -v
+/*     /dev/log:/dev/log ..."), and c) a distinct Postfix "syslog_name"
+/*     prefix that identifies logging from the Postfix instance.
 /* .IP \fBstop\fR
 /*     Stop the Postfix mail system in an orderly fashion. If
 /*     possible, running processes are allowed to terminate at
index 3a83895075ca4ae74c1c146711687fc71890328c..09f09326a4825df35e867fa131194f494115d39f 100644 (file)
   * assignment is made in unreachable code, the compiler "should" not emit
   * any references to those assignment targets. We use the "extern" class so
   * that gcc will not complain about unused variables. Using "extern" breaks
-  * when a compiler does emit references unreachable assignment targets.
+  * when a compiler does emit references to unreachable assignment targets.
   * Hopefully, those cases will be rare.
   */
 #define CHECK_VAL_HELPER_DCL(tag, type) extern type CHECK_VAL_DUMMY(type)
index a2692369cd39653c652074949e8346c6197d554e..0ae7c5626c1389e56bda1b80adca24c3c940302c 100644 (file)
@@ -220,14 +220,23 @@ VSTRING *cidr_match_parse(CIDR_MATCH *ip, char *pattern, int match,
      * Parse the pattern into network and mask, destroying the pattern.
      */
     if ((mask = split_at(mask_search, '/')) != 0) {
+       const char *parse_error;
+
        ip->addr_family = CIDR_MATCH_ADDR_FAMILY(pattern);
        ip->addr_bit_count = CIDR_MATCH_ADDR_BIT_COUNT(ip->addr_family);
        ip->addr_byte_count = CIDR_MATCH_ADDR_BYTE_COUNT(ip->addr_family);
-       if (!alldig(mask)
-           || (ip->mask_shift = atoi(mask)) > ip->addr_bit_count
-           || inet_pton(ip->addr_family, pattern, ip->net_bytes) != 1) {
+       if (!alldig(mask)) {
+           parse_error = "bad mask value";
+       } else if ((ip->mask_shift = atoi(mask)) > ip->addr_bit_count) {
+           parse_error = "bad mask length";
+       } else if (inet_pton(ip->addr_family, pattern, ip->net_bytes) != 1) {
+           parse_error = "bad network value";
+       } else {
+           parse_error = 0;
+       }
+       if (parse_error != 0) {
            vstring_sprintf(why ? why : (why = vstring_alloc(20)),
-                         "bad net/mask pattern: \"%s/%s\"", pattern, mask);
+                           "%s in \"%s/%s\"", parse_error, pattern, mask);
            return (why);
        }
        if (ip->mask_shift > 0) {
index a83de6b0c5e4301c30def15745124170975ebbef..305e3fd303ff4a201ad51d9bbec6fee399f2520a 100644 (file)
@@ -1,13 +1,13 @@
 ./dict_open: warning: cidr map dict_cidr.map, line 5: non-null host address bits in "172.16.1.3/21", perhaps you should use "172.16.0.0/21" instead: skipping this rule
-./dict_open: warning: cidr map dict_cidr.map, line 6: bad net/mask pattern: "172.16.1.3/33": skipping this rule
-./dict_open: warning: cidr map dict_cidr.map, line 7: bad net/mask pattern: "172.999.0.0/21": skipping this rule
+./dict_open: warning: cidr map dict_cidr.map, line 6: bad mask length in "172.16.1.3/33": skipping this rule
+./dict_open: warning: cidr map dict_cidr.map, line 7: bad network value in "172.999.0.0/21": skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 8: bad address pattern: "172.16.1.999": skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 9: no lookup result: skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 38: non-null host address bits in "1.0.0.0/0", perhaps you should use "0.0.0.0/0" instead: skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 40: non-null host address bits in "1::/0", perhaps you should use "::/0" instead: skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 42: missing ']' character after "[1234": skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 43: garbage after "[1234]": skipping this rule
-./dict_open: warning: cidr map dict_cidr.map, line 44: bad net/mask pattern: "172.16.1.3/3x": skipping this rule
+./dict_open: warning: cidr map dict_cidr.map, line 44: bad mask value in "172.16.1.3/3x": skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 45: ENDIF without IF: skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 46: ENDIF without IF: skipping this rule
 ./dict_open: warning: cidr map dict_cidr.map, line 49: no address pattern: skipping this rule