]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.10-20241122
authorWietse Z Venema <wietse@porcupine.org>
Fri, 22 Nov 2024 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Mon, 25 Nov 2024 05:26:14 +0000 (16:26 +1100)
17 files changed:
postfix/HISTORY
postfix/html/Makefile.in
postfix/html/postconf.5.html
postfix/html/postlogd.8.html
postfix/man/man8/postlogd.8
postfix/mantools/postlink
postfix/proto/index.html [new file with mode: 0644]
postfix/proto/stop
postfix/proto/stop.double-history
postfix/proto/stop.spell-history
postfix/proto/stop.spell-proto-html
postfix/src/global/mail_version.h
postfix/src/global/maillog_client.c
postfix/src/master/dgram_server.c
postfix/src/master/mail_server.h
postfix/src/postlogd/postlogd.c
postfix/src/util/msg_logger.c

index f254b8b39ab2564e23e793fd02379b4c9e554b38..afa2e42f1971183d15f245a657c294c21e931690 100644 (file)
@@ -28559,3 +28559,26 @@ Apologies for any names omitted.
        Documentation: convert some narrative text for the
        delay_logging_resolution_limit parameter into a bullet list.
        File: proto/postconf.proto.
+
+20241122
+
+       Documentation: in the postconf(5) manpage, hyperlink the
+       "overload:" default parameter settings to the STRESS_README
+       documentation.  File: mantools/postlink.
+
+       Cleanup: generate html/index.html from proto/index.html to
+       make changes visible in source diffs. Also make mantools/man2html
+       a dependency for html/*.?.html. File: html/Makefile.in.
+
+       Bugfix (defect introduced: Postfix 3.4, date 20190121): the
+       postsuper command failed with "open logfile 'xxx': Permission
+       denied" when the maillog_file parameter specified a filename
+       and Postfix was not running. This was fixed by opening the
+       maillog_file before dropping root privileges. Files:
+       util/msg_logger.c, global/maillog_client.c.
+
+       Refactoring: the unix-dgram server skeleton now passes a
+       socket file descriptor to the application (e.g., postlogd)
+       instead of a message buffer and length. This is in preparation
+       for unix-dgram support in a spawn(8)-like service. Files:
+       master/dgram_server.c, master/mail_server.h, postlogd/postlogd.c.
index 7f23ed7fdac975412bf7f0fbc2d79af3bf1fa46d..27dcff4e0f4696f03c7c9e6b0d3487ccb8788c32 100644 (file)
@@ -28,7 +28,7 @@ AWK   = awk '{ print; if (NR == 2) print ".pl 99999\n.ll 78" }'
 MAN2HTML = man2html -t "Postfix manual - `IFS=.; set \`echo $@\`; echo \"$$1($$2)\"`"
 NROFF  = LANG=C GROFF_NO_SGR=1 nroff
 
-update:        $(DAEMONS) $(COMMANDS) $(CONFIG) $(OTHER)
+update:        $(DAEMONS) $(COMMANDS) $(CONFIG) $(OTHER) index.html
 
 clean:
        echo clean
@@ -38,6 +38,11 @@ tidy:        clean
 clobber:
        rm -f $(DAEMONS) $(COMMANDS) $(CONFIG)
 
+$(DAEMONS) $(COMMANDS) $(CONFIG): ../mantools/man2html
+
+index.html: ../proto/index.html
+       cp $? $@
+
 bounce.8.html: ../src/bounce/bounce.c
        PATH=../mantools:$$PATH; \
        srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
index 5e7aa37063531bb527cf74f4786a6d2df5c5c62f..e34646ea3e33eaa17908ea5d69cac47ef4c2513c 100644 (file)
@@ -339,7 +339,7 @@ before it expires. </p>
 </DD>
 
 <DT><b><a name="address_verify_poll_count">address_verify_poll_count</a>
-(default: normal: 3, overload: 1)</b></DT><DD>
+(default: normal: 3, <a href="STRESS_README.html">overload</a>: 1)</b></DT><DD>
 
 <p>
 How many times to query the <a href="verify.8.html">verify(8)</a> service for the completion
@@ -8613,7 +8613,7 @@ See <a href="postconf.5.html#smtpd_command_filter">smtpd_command_filter</a> for
 </DD>
 
 <DT><b><a name="postscreen_command_time_limit">postscreen_command_time_limit</a>
-(default: normal: 300s, overload: 10s)</b></DT><DD>
+(default: normal: 300s, <a href="STRESS_README.html">overload</a>: 10s)</b></DT><DD>
 
 <p> The time limit to read an entire command line with <a href="postscreen.8.html">postscreen(8)</a>'s
 built-in SMTP protocol engine. </p>
@@ -9060,7 +9060,7 @@ The default time unit is d (days).  </p>
 </DD>
 
 <DT><b><a name="postscreen_greet_wait">postscreen_greet_wait</a>
-(default: normal: 6s, overload: 2s)</b></DT><DD>
+(default: normal: 6s, <a href="STRESS_README.html">overload</a>: 2s)</b></DT><DD>
 
 <p> The amount of time that <a href="postscreen.8.html">postscreen(8)</a> will wait for an SMTP
 client to send a command before its turn, and for DNS blocklist
@@ -16317,7 +16317,7 @@ Support for inline regular expressions was added in Postfix version
 </DD>
 
 <DT><b><a name="smtpd_hard_error_limit">smtpd_hard_error_limit</a>
-(default: normal: 20, overload: 1)</b></DT><DD>
+(default: normal: 20, <a href="STRESS_README.html">overload</a>: 1)</b></DT><DD>
 
 <p>
 The maximal number of errors a remote SMTP client is allowed to
@@ -16527,7 +16527,7 @@ before it is flushed upon receipt of EHLO, RSET, or end of DATA.
 </DD>
 
 <DT><b><a name="smtpd_junk_command_limit">smtpd_junk_command_limit</a>
-(default: normal: 100, overload: 1)</b></DT><DD>
+(default: normal: 100, <a href="STRESS_README.html">overload</a>: 1)</b></DT><DD>
 
 <p>
 The number of junk commands (NOOP, VRFY, ETRN or RSET) that a remote
@@ -16679,7 +16679,7 @@ DNS lookup and increases the maximal inbound delivery rate. </p>
 </DD>
 
 <DT><b><a name="smtpd_per_record_deadline">smtpd_per_record_deadline</a>
-(default: normal: no, overload: yes)</b></DT><DD>
+(default: normal: no, <a href="STRESS_README.html">overload</a>: yes)</b></DT><DD>
 
 <p> Change the behavior of the <a href="postconf.5.html#smtpd_timeout">smtpd_timeout</a> and <a href="postconf.5.html#smtpd_starttls_timeout">smtpd_starttls_timeout</a>
 time limits, from a
@@ -16703,7 +16703,7 @@ Postfix releases, the behavior is as if this parameter is set to
 </DD>
 
 <DT><b><a name="smtpd_per_request_deadline">smtpd_per_request_deadline</a>
-(default: normal: no, overload: yes)</b></DT><DD>
+(default: normal: no, <a href="STRESS_README.html">overload</a>: yes)</b></DT><DD>
 
 <p> Change the behavior of the <a href="postconf.5.html#smtpd_timeout">smtpd_timeout</a> and <a href="postconf.5.html#smtpd_starttls_timeout">smtpd_starttls_timeout</a>
 time limits, from a time limit per plaintext or TLS read or write
@@ -18150,7 +18150,7 @@ The default time unit is s (seconds).  </p>
 </DD>
 
 <DT><b><a name="smtpd_timeout">smtpd_timeout</a>
-(default: normal: 300s, overload: 10s)</b></DT><DD>
+(default: normal: 300s, <a href="STRESS_README.html">overload</a>: 10s)</b></DT><DD>
 
 <p> When the Postfix SMTP server wants to send an SMTP server
 response, how long the Postfix SMTP server will wait for an underlying
index 4faf5d1e3ce5916a5b6025d287101ef7ec892068..7399b37f57a8fcf917833020444d9f422f84e3d1 100644 (file)
@@ -14,8 +14,8 @@ POSTLOGD(8)                                                        POSTLOGD(8)
        <b>postlogd</b> [generic Postfix daemon options]
 
 <b><a name="description">DESCRIPTION</a></b>
-       This program logs events on behalf of Postfix programs when the maillog
-       configuration parameter specifies a non-empty value.
+       This  program  logs events on behalf of Postfix programs when the <a href="postconf.5.html#maillog_file">mail</a>-
+       <a href="postconf.5.html#maillog_file">log_file</a> configuration parameter specifies a non-empty value.
 
 <b><a name="bugs">BUGS</a></b>
        Non-daemon Postfix programs don't know that  they  should  log  to  the
@@ -96,5 +96,8 @@ POSTLOGD(8)                                                        POSTLOGD(8)
        111 8th Avenue
        New York, NY 10011, USA
 
+       Wietse Venema
+       porcupine.org
+
                                                                    POSTLOGD(8)
 </pre> </body> </html>
index aeb95c7d8abd8ed345d0e251a53f2b2c45ab267e..af4fdd3ed9666b21818d6a1b76c15e8597cbc5e7 100644 (file)
@@ -13,8 +13,8 @@ Postfix internal log server
 .ad
 .fi
 This program logs events on behalf of Postfix programs
-when the maillog configuration parameter specifies a non\-empty
-value.
+when the maillog_file configuration parameter specifies a
+non\-empty value.
 .SH BUGS
 .ad
 .fi
@@ -106,3 +106,6 @@ Wietse Venema
 Google, Inc.
 111 8th Avenue
 New York, NY 10011, USA
+
+Wietse Venema
+porcupine.org
index f5ec3f4f850778c6689feae36848558b22c4b0cc..62f5624ea9405a5e1dca5617071af653bda2b142 100755 (executable)
@@ -1278,6 +1278,10 @@ while (<>) {
     s/\b(unionmap):/<a href="DATABASE_README.html#types">$1<\/a>:/g;
     s/\b(inline):/<a href="DATABASE_README.html#types">$1<\/a>:/g;
 
+    if ($ARGV == "postconf.proto") {
+       s/\b(overload):/<a href="STRESS_README.html">$1<\/a>:/g;
+    }
+
     # Do nice links for smtp:host:port etc.
 
     s/\b(error):/<a href="error.8.html">$1<\/a>:/g;
diff --git a/postfix/proto/index.html b/postfix/proto/index.html
new file mode 100644 (file)
index 0000000..bbe7794
--- /dev/null
@@ -0,0 +1,228 @@
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "https://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+
+<head>
+
+<title>Postfix Documentation</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel='stylesheet' type='text/css' href='postfix-doc.css'>
+
+</head>
+
+<body>
+
+<h1><img src="postfix-logo.jpg" width="203" height="98" alt=""> Postfix Documentation </h1>
+
+<hr>
+
+<table border="0">
+
+<tr> <td width="30%" align="left" valign="top">
+
+<p><strong>General configuration </strong></p>
+
+<ul>
+
+<li> <a href="BASIC_CONFIGURATION_README.html"> Basic configuration
+</a>
+
+<li> <a href="SOHO_README.html"> Small/home office hints and tips </a>
+
+<li> <a href="STANDARD_CONFIGURATION_README.html"> Standard
+configuration examples </a>
+
+<li> <a href="ADDRESS_REWRITING_README.html"> Address rewriting
+ </a>
+
+<li> <a href="VIRTUAL_README.html"> Virtual domain hosting </a>
+
+<li> <a href="SASL_README.html"> SASL Authentication </a>
+
+<li> <a href="TLS_README.html"> TLS Encryption and authentication </a>
+
+<li> <a href="FORWARD_SECRECY_README.html"> TLS Forward Secrecy </a>
+
+<li> <a href="TLSRPT_README.html"> TLSRPT Protocol Support </a>
+
+<li> <a href="IPV6_README.html"> IP Version 6 Support </a>
+
+<li> <a href="SMTPUTF8_README.html"> SMTPUTF8 Support </a>
+
+<li> <a href="MAILLOG_README.html"> Postfix logging to file or stdout </a>
+
+<li> <a href="COMPATIBILITY_README.html"> Backwards-Compatibility Safety Net</a>
+
+<li> <a href="DEPRECATION_README.html"> Deprecated features and alternatives </a>
+
+<li> <a href="INSTALL.html"> Installation from source code </a>
+
+</ul>
+
+<p><strong>Problem solving </strong></p>
+
+<ul>
+
+<li> <a href="QSHAPE_README.html"> Bottleneck analysis  </a>
+
+<li> <a href="STRESS_README.html"> Stress-dependent configuration </a>
+
+<li> <a href="TUNING_README.html"> Performance tuning </a>
+
+<li> <a href="DEBUG_README.html"> Debugging strategies  </a>
+
+</ul>
+
+<p><strong>Content inspection </strong></p>
+
+<ul>
+
+<li> <a href="CONTENT_INSPECTION_README.html"> Content inspection
+overview </a>
+
+<li> <a href="BACKSCATTER_README.html"> Stopping backscatter mail
+</a>
+
+<li> <a href="BUILTIN_FILTER_README.html"> Built-in content inspection </a>
+
+</ul>
+
+</td>
+
+<td width="30%" align="left" valign="top">
+
+<ul>
+
+<li> <a href="FILTER_README.html"> After-queue content filter </a>
+
+<li> <a href="SMTPD_PROXY_README.html"> Before-queue content
+filter  </a>
+
+<li> <a href="MILTER_README.html"> Before-queue Milter applications
+</a>
+
+</ul>
+
+<p><strong>SMTP Relay and access control </strong></p>
+
+<ul>
+
+<li> <a href="SMTPD_ACCESS_README.html"> Relay/access control
+overview </a>
+
+<li> <a href="SMTPD_POLICY_README.html"> Access policy delegation
+</a>
+
+<li> <a href="ADDRESS_VERIFICATION_README.html"> Address verification
+ </a>
+
+<li> <a href="RESTRICTION_CLASS_README.html">
+Per-client/user/etc. access </a>
+
+<li> <a href="POSTSCREEN_README.html"> SMTP connection triage </a>
+
+<li> <a href="ETRN_README.html"> ETRN Support  </a>
+
+<li> <a href="UUCP_README.html"> LAN connected via UUCP </a>
+
+</ul>
+
+<p><strong> Lookup tables (databases) </strong></p>
+
+<ul>
+
+<li> <a href="DATABASE_README.html"> Lookup table overview </a>
+
+<li> <a href="DB_README.html"> Berkeley DB Howto  </a>
+
+<li> <a href="CDB_README.html"> CDB Howto  </a>
+
+<li> <a href="LDAP_README.html"> LDAP Howto  </a>
+
+<li> <a href="LMDB_README.html"> LMDB Howto  </a>
+
+<li> <a href="MEMCACHE_README.html"> Memcache Howto  </a>
+
+<li> <a href="MONGODB_README.html"> MongoDB Howto  </a>
+
+<li> <a href="MYSQL_README.html"> MySQL Howto  </a>
+
+<li> <a href="PCRE_README.html"> PCRE Howto </a>
+
+<li> <a href="PGSQL_README.html"> PostgreSQL Howto  </a>
+
+<li> <a href="SQLITE_README.html"> SQLite Howto  </a>
+
+</ul>
+
+<p><strong> Mailing list support </strong></p>
+
+<ul>
+
+<li> <a href="VERP_README.html"> VERP Support </a>
+
+</ul>
+
+</td>
+
+<td width="30%" align="left" valign="top">
+
+<p><strong> Specific environments </strong></p>
+
+<ul>
+
+<li> <a href="LINUX_README.html"> Linux issues </a>
+
+<li> <a href="NFS_README.html"> NFS issues </a>
+
+</ul>
+
+<p><strong> Other mail delivery agents </strong></p>
+
+<ul>
+
+<li> <a href="MAILDROP_README.html"> Maildrop  </a>
+
+</ul>
+
+<p><strong> Other topics </strong></p>
+
+<ul>
+
+<li> <a href="OVERVIEW.html"> Architecture overview </a>
+
+<li> <a href="postconf.5.html"> All main.cf parameters </a>
+
+<li> <a href="postfix-manuals.html"> All Postfix manual pages </a>
+
+<li> <a href="LOCAL_RECIPIENT_README.html"> Rejecting Unknown Local
+Recipients </a>
+
+<li> <a href="ADDRESS_CLASS_README.html"> Address Classes </a>
+
+<li> <a href="CONNECTION_CACHE_README.html"> Connection cache howto </a>
+
+<li> <a href="DSN_README.html"> Postfix DSN support </a>
+
+<li> <a href="BDAT_README.html"> Postfix BDAT (CHUNKING) support </a>
+
+<li> <a href="PACKAGE_README.html"> Guidelines for Package Builders
+</a>
+
+<li> <a href="SCHEDULER_README.html"> Queue Scheduler </a>
+
+<li> <a href="XCLIENT_README.html"> XCLIENT Command </a>
+
+<li> <a href="XFORWARD_README.html"> XFORWARD Command </a>
+
+</ul>
+
+</td>
+
+</table>
+
+</body>
+
+</html>
index ea642a3f05277d0217296c365c257a57ef24b5be..8eea8ade5536b1d9f92e9de30ad43ff25afb01c3 100644 (file)
@@ -1654,3 +1654,4 @@ STS
 hs
 ccformat
 xxsql
+MEMCACHE
index aa512908d1d2afed75e4d20c4e017f4afee57b76..422982039d8850694ece320bea244d45d517a18d 100644 (file)
@@ -143,3 +143,5 @@ proto  proto mysql_table proto pgsql_table proto ldap_table
  postfix postfix c proto ADDRESS_CLASS_README html 
 proto  proto socketmap_table qmqpd qmqpd c tls tls_misc c 
  proto socketmap_table qmqpd qmqpd c tls tls_misc c 
+ a dependency for html html File html Makefile in 
+ master dgram_server c master mail_server h postlogd postlogd c 
index 4b29774adb04e3ac5de8097e30c97f8b7a864ff9..8414697fa45be6ff8035192ae17023cb67c91529 100644 (file)
@@ -89,3 +89,4 @@ unescaped
 dereferenced
 MEMCACHE
 sed
+Wayback
index 4ca883f2968979daf96eada72742423609824d6a..e6c3f570c7fd52ea6f8970f929e33a232d2fd58f 100644 (file)
@@ -394,3 +394,4 @@ TR
 berkeleydb
 doctype
 dtd
+marc
index 9af66613aaac2251a10fd4dba38a42260dfc0ea6..9cb1f0934ab0e372d3f1fd4e90344c6dd9bfee69 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      "20241121"
+#define MAIL_RELEASE_DATE      "20241122"
 #define MAIL_VERSION_NUMBER    "3.10"
 
 #ifdef SNAPSHOT
index 4082ed895a1d63213c034b11c8355ab827ed3439..f439676bab527f27e10c9f5c7d3f0fe9bc8f91da 100644 (file)
@@ -75,6 +75,9 @@
 /*     Google, Inc.
 /*     111 8th Avenue
 /*     New York, NY 10011, USA
+/*
+/*     Wietse Venema
+/*     porcupine.org
 /*--*/
 
  /*
@@ -120,6 +123,7 @@ static int maillog_client_flags;
 static void maillog_client_logwriter_fallback(const char *text)
 {
     static int fallback_guard = 0;
+    static VSTREAM *fp;
 
     /*
      * Guard against recursive calls.
@@ -129,10 +133,20 @@ static void maillog_client_logwriter_fallback(const char *text)
      * logfile. All we can do is to hope that stderr logging will bring out
      * the bad news.
      */
-    if (fallback_guard == 0 && var_maillog_file && *var_maillog_file
-       && logwriter_one_shot(var_maillog_file, text, strlen(text)) < 0) {
-       fallback_guard = 1;
-       msg_fatal("logfile '%s' write error: %m", var_maillog_file);
+    if (fallback_guard++ == 0 && var_maillog_file && *var_maillog_file) {
+       if (text == 0 && fp != 0) {
+           (void) vstream_fclose(fp);
+           fp = 0;
+       }
+       if (fp == 0) {
+           fp = logwriter_open_or_die(var_maillog_file);
+           close_on_exec(vstream_fileno(fp), CLOSE_ON_EXEC);
+       }
+       if (text && (logwriter_write(fp, text, strlen(text)) != 0 ||
+                    vstream_fflush(fp) != 0)) {
+           msg_fatal("logfile '%s' write error: %m", var_maillog_file);
+       }
+       fallback_guard = 0;
     }
 }
 
index e49500e3490b406a1dff1b78221db2e0805f9084..32aaa9a9e41216ef05b45538a499e8a6e1530e9c 100644 (file)
@@ -9,7 +9,7 @@
 /*     NORETURN dgram_server_main(argc, argv, service, key, value, ...)
 /*     int     argc;
 /*     char    **argv;
-/*     void    (*service)(char *buf, int len, char *service_name, char **argv);
+/*     void    (*service)(int sock, char *service_name, char **argv);
 /*     int     key;
 /* DESCRIPTION
 /*     This module implements a skeleton for mail subsystem programs
 /*     dgram_server_main() is the skeleton entry point. It should
 /*     be called from the application main program. The skeleton
 /*     does the generic command-line options processing, initialization
-/*     of configurable parameters, and receiving datagrams. The
+/*     of configurable parameters, and monitors a datagram socket. The
 /*     skeleton never returns.
 /*
 /*     Arguments:
-/* .IP "void (*service)(char *buf, int len, char *service_name, char **argv)"
+/* .IP "void (*service)(int sock, char *service_name, char **argv)"
 /*     A pointer to a function that is called by the skeleton each
 /*     time a client sends a datagram to the program's service
 /*     port. The function is run after the program has irrevocably
-/*     dropped its privileges.  The buffer argument specifies the
-/*     data read from the datagram port; this data corresponds to
-/*     request.  The len argument specifies how much client data
-/*     is available.  The maximal size of the buffer is specified
-/*     via the DGRAM_BUF_SIZE manifest constant.  The service name
+/*     dropped its privileges. The sock argument specifies the socket
+/*     that the client should receive data from. The service name
 /*     argument corresponds to the service name in the master.cf
 /*     file.  The argv argument specifies command-line arguments
 /*     left over after options processing.
 /*     Google, Inc.
 /*     111 8th Avenue
 /*     New York, NY 10011, USA
+/*
+/*     Wietse Venema
+/*     porcupine.org
 /*--*/
 
 /* System library. */
@@ -258,8 +258,6 @@ static void dgram_server_timeout(int unused_event, void *unused_context)
 
 static void dgram_server_wakeup(int fd)
 {
-    char    buf[DGRAM_BUF_SIZE];
-    ssize_t len;
 
     /*
      * Commit suicide when the master process disconnected from us, after
@@ -269,8 +267,7 @@ static void dgram_server_wakeup(int fd)
         /* void */ ;
     if (dgram_server_in_flow_delay && mail_flow_get(1) < 0)
        doze(var_in_flow_delay * 1000000);
-    if ((len = recv(fd, buf, sizeof(buf), 0)) >= 0)
-       dgram_server_service(buf, len, dgram_server_name, dgram_server_argv);
+    dgram_server_service(fd, dgram_server_name, dgram_server_argv);
     if (master_notify(var_pid, dgram_server_generation, MASTER_STAT_AVAIL) < 0)
        dgram_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
     if (var_idle_limit > 0)
index 93703daf7517257824245571da1ec0cb734e930b..847edd739ec7d561325a4d2be6c4d1ed192d7d9e 100644 (file)
@@ -133,11 +133,9 @@ extern NORETURN trigger_server_main(int, char **, TRIGGER_SERVER_FN,...);
  /*
   * dgram_server.c
   */
-typedef void (*DGRAM_SERVER_FN) (char *, ssize_t, char *, char **);
+typedef void (*DGRAM_SERVER_FN) (int, char *, char **);
 extern NORETURN dgram_server_main(int, char **, DGRAM_SERVER_FN,...);
 
-#define DGRAM_BUF_SIZE 4096
-
 /* LICENSE
 /* .ad
 /* .fi
@@ -152,4 +150,7 @@ extern NORETURN dgram_server_main(int, char **, DGRAM_SERVER_FN,...);
 /*     Google, Inc.
 /*     111 8th Avenue
 /*     New York, NY 10011, USA
+/*
+/*     Wietse Venema
+/*     porcupine.org
 /*--*/
index 13f996f00391dcbfad5df5d21bff7aa1f40e636b..f844c3d576966b446711d6e41c0e55ff44fec8e7 100644 (file)
@@ -7,8 +7,8 @@
 /*     \fBpostlogd\fR [generic Postfix daemon options]
 /* DESCRIPTION
 /*     This program logs events on behalf of Postfix programs
-/*     when the maillog configuration parameter specifies a non-empty
-/*     value.
+/*     when the maillog_file configuration parameter specifies a
+/*     non-empty value.
 /* BUGS
 /*     Non-daemon Postfix programs don't know that they should log
 /*     to the internal logging service before they have processed
 /*     Google, Inc.
 /*     111 8th Avenue
 /*     New York, NY 10011, USA
+/*
+/*     Wietse Venema
+/*     porcupine.org
 /*--*/
 
  /*
   * System library.
   */
 #include <sys_defs.h>
+#include <sys/socket.h>
 
  /*
   * Utility library.
@@ -131,6 +135,11 @@ int     var_postlogd_watchdog;
   */
 static VSTREAM *postlogd_stream = 0;
 
+ /*
+  * Receive buffer management.
+  */
+#define DGRAM_BUF_SIZE 4096
+
 /* postlogd_fallback - log messages from postlogd(8) itself */
 
 static void postlogd_fallback(const char *buf)
@@ -140,10 +149,16 @@ static void postlogd_fallback(const char *buf)
 
 /* postlogd_service - perform service for client */
 
-static void postlogd_service(char *buf, ssize_t len, char *unused_service,
+static void postlogd_service(int sock, char *unused_service,
                                     char **unused_argv)
 {
+    char    buf[DGRAM_BUF_SIZE];
+    ssize_t len;
 
+    if ((len = recv(sock, buf, sizeof(buf), 0)) < 0) {
+       msg_warn("failed to receive message with recv: %m");
+       return;
+    }
     if (postlogd_stream) {
        (void) logwriter_write(postlogd_stream, buf, len);
     }
index 07c9e92f8186292a18329d8282bbbe08a4896716..6a999f64569a41f775779a03ac5a3f99167dd04c 100644 (file)
@@ -59,6 +59,9 @@
 /*     Override the fallback setting (see above) with the specified
 /*     function pointer. This remains in effect until the next
 /*     msg_logger_init() or msg_logger_control() call.
+/*     When the function is called with a null argument, it should
+/*     allocate resources immediately. This is needed in programs
+/*     that drop privileges after process initialization.
 /* .IP CA_MSG_LOGGER_CTL_DISABLE
 /*     Disable the msg_logger. This remains in effect until the
 /*     next msg_logger_init() call.
@@ -80,6 +83,9 @@
 /*     Google, Inc.
 /*     111 8th Avenue
 /*     New York, NY 10011, USA
+/*
+/*     Wietse Venema
+/*     porcupine.org
 /*--*/
 
  /*
@@ -320,6 +326,9 @@ void    msg_logger_control(int name,...)
            msg_logger_disconnect();
            if (MSG_LOGGER_NEED_SOCKET())
                msg_logger_connect();
+           if (msg_logger_sock == MSG_LOGGER_SOCK_NONE
+               && msg_logger_fallback_fn)
+               msg_logger_fallback_fn((char *) 0);
            break;
        default:
            msg_panic("%s: bad name %d", myname, name);