2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-22 09:57:34 +00:00

postfix-3.10-20241122

This commit is contained in:
Wietse Z Venema 2024-11-22 00:00:00 -05:00 committed by Viktor Dukhovni
parent a61eb8de27
commit 1099dd6b49
17 changed files with 343 additions and 36 deletions

View File

@ -28559,3 +28559,26 @@ Apologies for any names omitted.
Documentation: convert some narrative text for the Documentation: convert some narrative text for the
delay_logging_resolution_limit parameter into a bullet list. delay_logging_resolution_limit parameter into a bullet list.
File: proto/postconf.proto. 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.

View 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)\"`" MAN2HTML = man2html -t "Postfix manual - `IFS=.; set \`echo $@\`; echo \"$$1($$2)\"`"
NROFF = LANG=C GROFF_NO_SGR=1 nroff NROFF = LANG=C GROFF_NO_SGR=1 nroff
update: $(DAEMONS) $(COMMANDS) $(CONFIG) $(OTHER) update: $(DAEMONS) $(COMMANDS) $(CONFIG) $(OTHER) index.html
clean: clean:
echo clean echo clean
@ -38,6 +38,11 @@ tidy: clean
clobber: clobber:
rm -f $(DAEMONS) $(COMMANDS) $(CONFIG) rm -f $(DAEMONS) $(COMMANDS) $(CONFIG)
$(DAEMONS) $(COMMANDS) $(CONFIG): ../mantools/man2html
index.html: ../proto/index.html
cp $? $@
bounce.8.html: ../src/bounce/bounce.c bounce.8.html: ../src/bounce/bounce.c
PATH=../mantools:$$PATH; \ PATH=../mantools:$$PATH; \
srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@

View File

@ -339,7 +339,7 @@ before it expires. </p>
</DD> </DD>
<DT><b><a name="address_verify_poll_count">address_verify_poll_count</a> <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> <p>
How many times to query the <a href="verify.8.html">verify(8)</a> service for the completion 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> </DD>
<DT><b><a name="postscreen_command_time_limit">postscreen_command_time_limit</a> <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 <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> built-in SMTP protocol engine. </p>
@ -9060,7 +9060,7 @@ The default time unit is d (days). </p>
</DD> </DD>
<DT><b><a name="postscreen_greet_wait">postscreen_greet_wait</a> <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 <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 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> </DD>
<DT><b><a name="smtpd_hard_error_limit">smtpd_hard_error_limit</a> <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> <p>
The maximal number of errors a remote SMTP client is allowed to 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> </DD>
<DT><b><a name="smtpd_junk_command_limit">smtpd_junk_command_limit</a> <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> <p>
The number of junk commands (NOOP, VRFY, ETRN or RSET) that a remote 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> </DD>
<DT><b><a name="smtpd_per_record_deadline">smtpd_per_record_deadline</a> <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> <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 limits, from a
@ -16703,7 +16703,7 @@ Postfix releases, the behavior is as if this parameter is set to
</DD> </DD>
<DT><b><a name="smtpd_per_request_deadline">smtpd_per_request_deadline</a> <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> <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 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> </DD>
<DT><b><a name="smtpd_timeout">smtpd_timeout</a> <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 <p> When the Postfix SMTP server wants to send an SMTP server
response, how long the Postfix SMTP server will wait for an underlying response, how long the Postfix SMTP server will wait for an underlying

View File

@ -14,8 +14,8 @@ POSTLOGD(8) POSTLOGD(8)
<b>postlogd</b> [generic Postfix daemon options] <b>postlogd</b> [generic Postfix daemon options]
<b><a name="description">DESCRIPTION</a></b> <b><a name="description">DESCRIPTION</a></b>
This program logs events on behalf of Postfix programs when the maillog This program logs events on behalf of Postfix programs when the <a href="postconf.5.html#maillog_file">mail</a>-
configuration parameter specifies a non-empty value. <a href="postconf.5.html#maillog_file">log_file</a> configuration parameter specifies a non-empty value.
<b><a name="bugs">BUGS</a></b> <b><a name="bugs">BUGS</a></b>
Non-daemon Postfix programs don't know that they should log to the Non-daemon Postfix programs don't know that they should log to the
@ -96,5 +96,8 @@ POSTLOGD(8) POSTLOGD(8)
111 8th Avenue 111 8th Avenue
New York, NY 10011, USA New York, NY 10011, USA
Wietse Venema
porcupine.org
POSTLOGD(8) POSTLOGD(8)
</pre> </body> </html> </pre> </body> </html>

View File

@ -13,8 +13,8 @@ Postfix internal log server
.ad .ad
.fi .fi
This program logs events on behalf of Postfix programs This program logs events on behalf of Postfix programs
when the maillog configuration parameter specifies a non\-empty when the maillog_file configuration parameter specifies a
value. non\-empty value.
.SH BUGS .SH BUGS
.ad .ad
.fi .fi
@ -106,3 +106,6 @@ Wietse Venema
Google, Inc. Google, Inc.
111 8th Avenue 111 8th Avenue
New York, NY 10011, USA New York, NY 10011, USA
Wietse Venema
porcupine.org

View File

@ -1278,6 +1278,10 @@ while (<>) {
s/\b(unionmap):/<a href="DATABASE_README.html#types">$1<\/a>:/g; s/\b(unionmap):/<a href="DATABASE_README.html#types">$1<\/a>:/g;
s/\b(inline):/<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. # Do nice links for smtp:host:port etc.
s/\b(error):/<a href="error.8.html">$1<\/a>:/g; s/\b(error):/<a href="error.8.html">$1<\/a>:/g;

228
postfix/proto/index.html Normal file
View File

@ -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>

View File

@ -1654,3 +1654,4 @@ STS
hs hs
ccformat ccformat
xxsql xxsql
MEMCACHE

View File

@ -143,3 +143,5 @@ proto proto mysql_table proto pgsql_table proto ldap_table
postfix postfix c proto ADDRESS_CLASS_README html postfix postfix c proto ADDRESS_CLASS_README html
proto proto socketmap_table qmqpd qmqpd c tls tls_misc c proto proto socketmap_table qmqpd qmqpd c tls tls_misc c
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

View File

@ -89,3 +89,4 @@ unescaped
dereferenced dereferenced
MEMCACHE MEMCACHE
sed sed
Wayback

View File

@ -394,3 +394,4 @@ TR
berkeleydb berkeleydb
doctype doctype
dtd dtd
marc

View File

@ -20,7 +20,7 @@
* Patches change both the patchlevel and the release date. Snapshots have no * Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only. * patchlevel; they change the release date only.
*/ */
#define MAIL_RELEASE_DATE "20241121" #define MAIL_RELEASE_DATE "20241122"
#define MAIL_VERSION_NUMBER "3.10" #define MAIL_VERSION_NUMBER "3.10"
#ifdef SNAPSHOT #ifdef SNAPSHOT

View File

@ -75,6 +75,9 @@
/* Google, Inc. /* Google, Inc.
/* 111 8th Avenue /* 111 8th Avenue
/* New York, NY 10011, USA /* 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 void maillog_client_logwriter_fallback(const char *text)
{ {
static int fallback_guard = 0; static int fallback_guard = 0;
static VSTREAM *fp;
/* /*
* Guard against recursive calls. * 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 * logfile. All we can do is to hope that stderr logging will bring out
* the bad news. * the bad news.
*/ */
if (fallback_guard == 0 && var_maillog_file && *var_maillog_file if (fallback_guard++ == 0 && var_maillog_file && *var_maillog_file) {
&& logwriter_one_shot(var_maillog_file, text, strlen(text)) < 0) { if (text == 0 && fp != 0) {
fallback_guard = 1; (void) vstream_fclose(fp);
msg_fatal("logfile '%s' write error: %m", var_maillog_file); 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;
} }
} }

View File

@ -9,7 +9,7 @@
/* NORETURN dgram_server_main(argc, argv, service, key, value, ...) /* NORETURN dgram_server_main(argc, argv, service, key, value, ...)
/* int argc; /* int argc;
/* char **argv; /* char **argv;
/* void (*service)(char *buf, int len, char *service_name, char **argv); /* void (*service)(int sock, char *service_name, char **argv);
/* int key; /* int key;
/* DESCRIPTION /* DESCRIPTION
/* This module implements a skeleton for mail subsystem programs /* This module implements a skeleton for mail subsystem programs
@ -21,19 +21,16 @@
/* dgram_server_main() is the skeleton entry point. It should /* dgram_server_main() is the skeleton entry point. It should
/* be called from the application main program. The skeleton /* be called from the application main program. The skeleton
/* does the generic command-line options processing, initialization /* 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. /* skeleton never returns.
/* /*
/* Arguments: /* 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 /* A pointer to a function that is called by the skeleton each
/* time a client sends a datagram to the program's service /* time a client sends a datagram to the program's service
/* port. The function is run after the program has irrevocably /* port. The function is run after the program has irrevocably
/* dropped its privileges. The buffer argument specifies the /* dropped its privileges. The sock argument specifies the socket
/* data read from the datagram port; this data corresponds to /* that the client should receive data from. The service name
/* 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
/* argument corresponds to the service name in the master.cf /* argument corresponds to the service name in the master.cf
/* file. The argv argument specifies command-line arguments /* file. The argv argument specifies command-line arguments
/* left over after options processing. /* left over after options processing.
@ -152,6 +149,9 @@
/* Google, Inc. /* Google, Inc.
/* 111 8th Avenue /* 111 8th Avenue
/* New York, NY 10011, USA /* New York, NY 10011, USA
/*
/* Wietse Venema
/* porcupine.org
/*--*/ /*--*/
/* System library. */ /* System library. */
@ -258,8 +258,6 @@ static void dgram_server_timeout(int unused_event, void *unused_context)
static void dgram_server_wakeup(int fd) 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 * Commit suicide when the master process disconnected from us, after
@ -269,8 +267,7 @@ static void dgram_server_wakeup(int fd)
/* void */ ; /* void */ ;
if (dgram_server_in_flow_delay && mail_flow_get(1) < 0) if (dgram_server_in_flow_delay && mail_flow_get(1) < 0)
doze(var_in_flow_delay * 1000000); doze(var_in_flow_delay * 1000000);
if ((len = recv(fd, buf, sizeof(buf), 0)) >= 0) dgram_server_service(fd, dgram_server_name, dgram_server_argv);
dgram_server_service(buf, len, dgram_server_name, dgram_server_argv);
if (master_notify(var_pid, dgram_server_generation, MASTER_STAT_AVAIL) < 0) if (master_notify(var_pid, dgram_server_generation, MASTER_STAT_AVAIL) < 0)
dgram_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT); dgram_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
if (var_idle_limit > 0) if (var_idle_limit > 0)

View File

@ -133,11 +133,9 @@ extern NORETURN trigger_server_main(int, char **, TRIGGER_SERVER_FN,...);
/* /*
* dgram_server.c * 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,...); extern NORETURN dgram_server_main(int, char **, DGRAM_SERVER_FN,...);
#define DGRAM_BUF_SIZE 4096
/* LICENSE /* LICENSE
/* .ad /* .ad
/* .fi /* .fi
@ -152,4 +150,7 @@ extern NORETURN dgram_server_main(int, char **, DGRAM_SERVER_FN,...);
/* Google, Inc. /* Google, Inc.
/* 111 8th Avenue /* 111 8th Avenue
/* New York, NY 10011, USA /* New York, NY 10011, USA
/*
/* Wietse Venema
/* porcupine.org
/*--*/ /*--*/

View File

@ -7,8 +7,8 @@
/* \fBpostlogd\fR [generic Postfix daemon options] /* \fBpostlogd\fR [generic Postfix daemon options]
/* DESCRIPTION /* DESCRIPTION
/* This program logs events on behalf of Postfix programs /* This program logs events on behalf of Postfix programs
/* when the maillog configuration parameter specifies a non-empty /* when the maillog_file configuration parameter specifies a
/* value. /* non-empty value.
/* BUGS /* BUGS
/* Non-daemon Postfix programs don't know that they should log /* Non-daemon Postfix programs don't know that they should log
/* to the internal logging service before they have processed /* to the internal logging service before they have processed
@ -86,12 +86,16 @@
/* Google, Inc. /* Google, Inc.
/* 111 8th Avenue /* 111 8th Avenue
/* New York, NY 10011, USA /* New York, NY 10011, USA
/*
/* Wietse Venema
/* porcupine.org
/*--*/ /*--*/
/* /*
* System library. * System library.
*/ */
#include <sys_defs.h> #include <sys_defs.h>
#include <sys/socket.h>
/* /*
* Utility library. * Utility library.
@ -131,6 +135,11 @@ int var_postlogd_watchdog;
*/ */
static VSTREAM *postlogd_stream = 0; static VSTREAM *postlogd_stream = 0;
/*
* Receive buffer management.
*/
#define DGRAM_BUF_SIZE 4096
/* postlogd_fallback - log messages from postlogd(8) itself */ /* postlogd_fallback - log messages from postlogd(8) itself */
static void postlogd_fallback(const char *buf) static void postlogd_fallback(const char *buf)
@ -140,10 +149,16 @@ static void postlogd_fallback(const char *buf)
/* postlogd_service - perform service for client */ /* 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 **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) { if (postlogd_stream) {
(void) logwriter_write(postlogd_stream, buf, len); (void) logwriter_write(postlogd_stream, buf, len);
} }

View File

@ -59,6 +59,9 @@
/* Override the fallback setting (see above) with the specified /* Override the fallback setting (see above) with the specified
/* function pointer. This remains in effect until the next /* function pointer. This remains in effect until the next
/* msg_logger_init() or msg_logger_control() call. /* 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 /* .IP CA_MSG_LOGGER_CTL_DISABLE
/* Disable the msg_logger. This remains in effect until the /* Disable the msg_logger. This remains in effect until the
/* next msg_logger_init() call. /* next msg_logger_init() call.
@ -80,6 +83,9 @@
/* Google, Inc. /* Google, Inc.
/* 111 8th Avenue /* 111 8th Avenue
/* New York, NY 10011, USA /* New York, NY 10011, USA
/*
/* Wietse Venema
/* porcupine.org
/*--*/ /*--*/
/* /*
@ -320,6 +326,9 @@ void msg_logger_control(int name,...)
msg_logger_disconnect(); msg_logger_disconnect();
if (MSG_LOGGER_NEED_SOCKET()) if (MSG_LOGGER_NEED_SOCKET())
msg_logger_connect(); msg_logger_connect();
if (msg_logger_sock == MSG_LOGGER_SOCK_NONE
&& msg_logger_fallback_fn)
msg_logger_fallback_fn((char *) 0);
break; break;
default: default:
msg_panic("%s: bad name %d", myname, name); msg_panic("%s: bad name %d", myname, name);