From: Wietse Z Venema Date: Fri, 22 Nov 2024 05:00:00 +0000 (-0500) Subject: postfix-3.10-20241122 X-Git-Tag: v3.10.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1099dd6b4995cc47de723536cbb63382f818c957;p=thirdparty%2Fpostfix.git postfix-3.10-20241122 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index f254b8b39..afa2e42f1 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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. diff --git a/postfix/html/Makefile.in b/postfix/html/Makefile.in index 7f23ed7fd..27dcff4e0 100644 --- a/postfix/html/Makefile.in +++ b/postfix/html/Makefile.in @@ -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 >$@ diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 5e7aa3706..e34646ea3 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -339,7 +339,7 @@ before it expires.

address_verify_poll_count -(default: normal: 3, overload: 1)
+(default: normal: 3, overload: 1)

How many times to query the verify(8) service for the completion @@ -8613,7 +8613,7 @@ See smtpd_command_filter for

postscreen_command_time_limit -(default: normal: 300s, overload: 10s)
+(default: normal: 300s, overload: 10s)

The time limit to read an entire command line with postscreen(8)'s built-in SMTP protocol engine.

@@ -9060,7 +9060,7 @@ The default time unit is d (days).

postscreen_greet_wait -(default: normal: 6s, overload: 2s)
+(default: normal: 6s, overload: 2s)

The amount of time that postscreen(8) 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

smtpd_hard_error_limit -(default: normal: 20, overload: 1)
+(default: normal: 20, overload: 1)

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.

smtpd_junk_command_limit -(default: normal: 100, overload: 1)
+(default: normal: 100, overload: 1)

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.

smtpd_per_record_deadline -(default: normal: no, overload: yes)
+(default: normal: no, overload: yes)

Change the behavior of the smtpd_timeout and smtpd_starttls_timeout time limits, from a @@ -16703,7 +16703,7 @@ Postfix releases, the behavior is as if this parameter is set to

smtpd_per_request_deadline -(default: normal: no, overload: yes)
+(default: normal: no, overload: yes)

Change the behavior of the smtpd_timeout and smtpd_starttls_timeout time limits, from a time limit per plaintext or TLS read or write @@ -18150,7 +18150,7 @@ The default time unit is s (seconds).

smtpd_timeout -(default: normal: 300s, overload: 10s)
+(default: normal: 300s, overload: 10s)

When the Postfix SMTP server wants to send an SMTP server response, how long the Postfix SMTP server will wait for an underlying diff --git a/postfix/html/postlogd.8.html b/postfix/html/postlogd.8.html index 4faf5d1e3..7399b37f5 100644 --- a/postfix/html/postlogd.8.html +++ b/postfix/html/postlogd.8.html @@ -14,8 +14,8 @@ POSTLOGD(8) POSTLOGD(8) postlogd [generic Postfix daemon options] DESCRIPTION - 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 mail- + log_file configuration parameter specifies a non-empty value. BUGS 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) diff --git a/postfix/man/man8/postlogd.8 b/postfix/man/man8/postlogd.8 index aeb95c7d8..af4fdd3ed 100644 --- a/postfix/man/man8/postlogd.8 +++ b/postfix/man/man8/postlogd.8 @@ -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 diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index f5ec3f4f8..62f5624ea 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -1278,6 +1278,10 @@ while (<>) { s/\b(unionmap):/$1<\/a>:/g; s/\b(inline):/$1<\/a>:/g; + if ($ARGV == "postconf.proto") { + s/\b(overload):/$1<\/a>:/g; + } + # Do nice links for smtp:host:port etc. s/\b(error):/$1<\/a>:/g; diff --git a/postfix/proto/index.html b/postfix/proto/index.html new file mode 100644 index 000000000..bbe7794e7 --- /dev/null +++ b/postfix/proto/index.html @@ -0,0 +1,228 @@ + + + + + + +Postfix Documentation + + + + + + + + +

Postfix Documentation

+ +
+ + + + + + + + + +
+ +

General configuration

+ + + +

Problem solving

+ + + +

Content inspection

+ + + +
+ + + +

SMTP Relay and access control

+ + + +

Lookup tables (databases)

+ + + +

Mailing list support

+ + + +
+ +

Specific environments

+ + + +

Other mail delivery agents

+ + + +

Other topics

+ + + +
+ + + + diff --git a/postfix/proto/stop b/postfix/proto/stop index ea642a3f0..8eea8ade5 100644 --- a/postfix/proto/stop +++ b/postfix/proto/stop @@ -1654,3 +1654,4 @@ STS hs ccformat xxsql +MEMCACHE diff --git a/postfix/proto/stop.double-history b/postfix/proto/stop.double-history index aa512908d..422982039 100644 --- a/postfix/proto/stop.double-history +++ b/postfix/proto/stop.double-history @@ -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 diff --git a/postfix/proto/stop.spell-history b/postfix/proto/stop.spell-history index 4b29774ad..8414697fa 100644 --- a/postfix/proto/stop.spell-history +++ b/postfix/proto/stop.spell-history @@ -89,3 +89,4 @@ unescaped dereferenced MEMCACHE sed +Wayback diff --git a/postfix/proto/stop.spell-proto-html b/postfix/proto/stop.spell-proto-html index 4ca883f29..e6c3f570c 100644 --- a/postfix/proto/stop.spell-proto-html +++ b/postfix/proto/stop.spell-proto-html @@ -394,3 +394,4 @@ TR berkeleydb doctype dtd +marc diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 9af66613a..9cb1f0934 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 "20241121" +#define MAIL_RELEASE_DATE "20241122" #define MAIL_VERSION_NUMBER "3.10" #ifdef SNAPSHOT diff --git a/postfix/src/global/maillog_client.c b/postfix/src/global/maillog_client.c index 4082ed895..f439676ba 100644 --- a/postfix/src/global/maillog_client.c +++ b/postfix/src/global/maillog_client.c @@ -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; } } diff --git a/postfix/src/master/dgram_server.c b/postfix/src/master/dgram_server.c index e49500e34..32aaa9a9e 100644 --- a/postfix/src/master/dgram_server.c +++ b/postfix/src/master/dgram_server.c @@ -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 @@ -21,19 +21,16 @@ /* 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. @@ -152,6 +149,9 @@ /* 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) diff --git a/postfix/src/master/mail_server.h b/postfix/src/master/mail_server.h index 93703daf7..847edd739 100644 --- a/postfix/src/master/mail_server.h +++ b/postfix/src/master/mail_server.h @@ -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 /*--*/ diff --git a/postfix/src/postlogd/postlogd.c b/postfix/src/postlogd/postlogd.c index 13f996f00..f844c3d57 100644 --- a/postfix/src/postlogd/postlogd.c +++ b/postfix/src/postlogd/postlogd.c @@ -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 @@ -86,12 +86,16 @@ /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA +/* +/* Wietse Venema +/* porcupine.org /*--*/ /* * System library. */ #include +#include /* * 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); } diff --git a/postfix/src/util/msg_logger.c b/postfix/src/util/msg_logger.c index 07c9e92f8..6a999f645 100644 --- a/postfix/src/util/msg_logger.c +++ b/postfix/src/util/msg_logger.c @@ -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);