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.
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
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 >$@
</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
</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>
</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
</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
</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
</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
</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
</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
<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
111 8th Avenue
New York, NY 10011, USA
+ Wietse Venema
+ porcupine.org
+
POSTLOGD(8)
</pre> </body> </html>
.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
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
+
+Wietse Venema
+porcupine.org
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;
--- /dev/null
+<!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>
hs
ccformat
xxsql
+MEMCACHE
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
dereferenced
MEMCACHE
sed
+Wayback
berkeleydb
doctype
dtd
+marc
* 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
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
+/*
+/* Wietse Venema
+/* porcupine.org
/*--*/
/*
static void maillog_client_logwriter_fallback(const char *text)
{
static int fallback_guard = 0;
+ static VSTREAM *fp;
/*
* Guard against recursive calls.
* 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;
}
}
/* 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. */
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
/* 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)
/*
* 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
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
+/*
+/* Wietse Venema
+/* porcupine.org
/*--*/
/* \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.
*/
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)
/* 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);
}
/* 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.
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
+/*
+/* Wietse Venema
+/* porcupine.org
/*--*/
/*
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);