microseconds, or 0.01 second) that controls the detail in
the new "delays=a/b/c/d" logging. Specify a power of 10
in the range from 1 to 100000. File: global/log_adhoc.c.
+ Parameter renamed 20051108.
20051105
smtpd/smtpd.c, qmqpd/qmqpd.c, *qmgr/qmgr_message.c,
*qmgr/qmgr_active.c, local/forward.c.
-20061106
+20051106
The SMTP client logs the remote server port in the form of
relay=hostname[hostaddr]:port to the local maillog file.
with a few simple macros, to make future changes in time
representation less painful.
+20051108
+
+ Cleanup: eliminated floating point operations from the
+ ad-hoc delay logging code. Files: util/format_tv.[hc],
+ global/log_adhoc.c.
+
+ The delay logging resolution is now controlled with the
+ delay_logging_resolution_limit parameter, which specifies
+ the maximal number of digits after the decimal point.
+
+ Bugfix: under unlikely conditions two messages could get
+ the same message ID. Found by Victor. Files: global/mail_stream.c,
+ global/mail_queue.c.
+
Open problems:
"postsuper -r" no longer resets the message arrival time,
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=no_address_mappings
Note: do not specify whitespace around the "=" here.
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=nso_address_mapping
Note: do not specify whitespace around the "=" here.
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=no_address_mappings
Note: do not specify whitespace around the "=" here.
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=no_address_mappings
Note: do not specify whitespace around the "=" here.
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=no_address_mapping
+ -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=<a href="postconf.5.html#no_address_mappings">no_address_mappings</a>
</pre>
</blockquote>
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=no_address_mapping
+ -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=nso_address_mapping
</pre>
</blockquote>
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=no_address_mapping
+ -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=<a href="postconf.5.html#no_address_mappings">no_address_mappings</a>
</pre>
</blockquote>
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=no_address_mapping
+ -o <a href="postconf.5.html#receive_override_options">receive_override_options</a>=<a href="postconf.5.html#no_address_mappings">no_address_mappings</a>
</pre>
</blockquote>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#delay_warning_time">delay_warning_time</a> (0h)</b>
- The time after which the sender receives the mes-
+ The time after which the sender receives the mes-
sage headers of mail that is still queued.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
over an internal communication channel.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#myhostname">myhostname</a> (see 'postconf -d' output)</b>
<b><a href="postconf.5.html#myorigin">myorigin</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
The domain name that locally-posted mail appears to
- come from, and that locally posted mail is deliv-
+ come from, and that locally posted mail is deliv-
ered to.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#soft_bounce">soft_bounce</a> (no)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
Available in Postfix version 2.1 and later:
<b><a href="postconf.5.html#enable_original_recipient">enable_original_recipient</a> (yes)</b>
- Enable support for the X-Original-To message
+ Enable support for the X-Original-To message
header.
<b>FILES</b>
<a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a> Postfix address manipulation
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#double_bounce_sender">double_bounce_sender</a> (double-bounce)</b>
The sender address of postmaster notifications that
over an internal communication channel.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>SEE ALSO</b>
syslogd(8), system logging
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>HISTORY</b>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#double_bounce_sender">double_bounce_sender</a> (double-bounce)</b>
The sender address of postmaster notifications that
over an internal communication channel.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#notify_classes">notify_classes</a> (resource, software)</b>
- The list of error classes that are reported to the
+ The list of error classes that are reported to the
postmaster.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>SEE ALSO</b>
syslogd(8), system logging
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#disable_dns_lookups">disable_dns_lookups</a> (no)</b>
- Disable DNS lookups in the Postfix SMTP and LMTP
+ Disable DNS lookups in the Postfix SMTP and LMTP
clients.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
over an internal communication channel.
<b><a href="postconf.5.html#lmtp_tcp_port">lmtp_tcp_port</a> (24)</b>
- The default TCP port that the Postfix LMTP client
+ The default TCP port that the Postfix LMTP client
connects to.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>SEE ALSO</b>
<a href="VIRTUAL_README.html">VIRTUAL_README</a>, virtual delivery agent howto
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#export_environment">export_environment</a> (see 'postconf -d' output)</b>
- The list of environment variables that a Postfix
+ The list of environment variables that a Postfix
process will export to non-Postfix processes.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
over an internal communication channel.
<b><a href="postconf.5.html#local_command_shell">local_command_shell</a> (empty)</b>
- Optional shell program for <a href="local.8.html"><b>local</b>(8)</a> delivery to
+ Optional shell program for <a href="local.8.html"><b>local</b>(8)</a> delivery to
non-Postfix command.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#prepend_delivered_header">prepend_delivered_header</a> (command, file, forward)</b>
- The message delivery contexts where the Postfix
- <a href="local.8.html"><b>local</b>(8)</a> delivery agent prepends a Delivered-To:
- message header with the address that the mail was
+ The message delivery contexts where the Postfix
+ <a href="local.8.html"><b>local</b>(8)</a> delivery agent prepends a Delivered-To:
+ message header with the address that the mail was
delivered to.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a> (canonical, virtual)</b>
- What address lookup tables copy an address exten-
+ What address lookup tables copy an address exten-
sion from the lookup key to the lookup result.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b>
sions (user+foo).
<b><a href="postconf.5.html#require_home_directory">require_home_directory</a> (no)</b>
- Whether or not a <a href="local.8.html"><b>local</b>(8)</a> recipient's home direc-
- tory must exist before mail delivery is attempted.
+ Whether or not a <a href="local.8.html"><b>local</b>(8)</a> recipient's home direc-
+ tory must exist before mail delivery is attempted.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>FILES</b>
syslogd(8), system logging
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>HISTORY</b>
The <b>Delivered-To:</b> message header appears in the <b>qmail</b> sys-
tem by Daniel Bernstein.
- The <i>maildir</i> structure appears in the <b>qmail</b> system by
+ The <i>maildir</i> structure appears in the <b>qmail</b> system by
Daniel Bernstein.
<b>AUTHOR(S)</b>
should not deliver mail unless someone issues
"<b>sendmail -q</b>" or equivalent.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#helpful_warnings">helpful_warnings</a> (yes)</b>
- Log warnings about problematic configuration set-
+ Log warnings about problematic configuration set-
tings, and provide helpful suggestions.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
over an internal communication channel.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>FILES</b>
<a href="QSHAPE_README.html">QSHAPE_README</a>, Postfix queue analysis
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#export_environment">export_environment</a> (see 'postconf -d' output)</b>
- The list of environment variables that a Postfix
+ The list of environment variables that a Postfix
process will export to non-Postfix processes.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
and most Postfix daemon processes.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>SEE ALSO</b>
syslogd(8), system logging
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
</DD>
-<DT><b><a name="delay_logging_time_resolution">delay_logging_time_resolution</a>
-(default: 10000)</b></DT><DD>
+<DT><b><a name="delay_logging_resolution_limit">delay_logging_resolution_limit</a>
+(default: 2)</b></DT><DD>
-<p> The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
-Specify a power of 10 in the range from 1 to 100000. </p>
+<p> The maximal number of digits after the decimal point when logging
+sub-second delay values. Specify a number in the range 0..6. </p>
+
+<p> Large delay values are rounded off to an integral number seconds;
+delay values below the <a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> are logged
+as "0", and small delay values are logged with at most two-digit
+precision. </p>
<p> The format of the "delays=a/b/c/d" logging is as follows: </p>
</ul>
-<p> Delay values less than <a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> are logged
-as "0", while delay values less than 10s are logged with at most
-two-digit precision. </p>
+<p> This feature is available in Postfix 2.3 and later. </p>
</DD>
should not deliver mail unless someone issues
"<b>sendmail -q</b>" or equivalent.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#helpful_warnings">helpful_warnings</a> (yes)</b>
- Log warnings about problematic configuration set-
+ Log warnings about problematic configuration set-
tings, and provide helpful suggestions.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
over an internal communication channel.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>FILES</b>
<a href="QSHAPE_README.html">QSHAPE_README</a>, Postfix queue analysis
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#disable_dns_lookups">disable_dns_lookups</a> (no)</b>
- Disable DNS lookups in the Postfix SMTP and LMTP
+ Disable DNS lookups in the Postfix SMTP and LMTP
clients.
<b><a href="postconf.5.html#fallback_relay">fallback_relay</a> (empty)</b>
- Optional list of relay hosts for SMTP destinations
+ Optional list of relay hosts for SMTP destinations
that can't be found or that are unreachable.
<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a> (all)</b>
tem receives mail on.
<b><a href="postconf.5.html#inet_protocols">inet_protocols</a> (ipv4)</b>
- The Internet protocols Postfix will attempt to use
+ The Internet protocols Postfix will attempt to use
when making or accepting connections.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
over an internal communication channel.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a> (empty)</b>
The network interface addresses that this mail sys-
- tem receives mail on by way of a proxy or network
+ tem receives mail on by way of a proxy or network
address translation unit.
<b><a href="postconf.5.html#smtp_bind_address">smtp_bind_address</a> (empty)</b>
An optional numerical network address that the SMTP
- client should bind to when making an IPv4 connec-
+ client should bind to when making an IPv4 connec-
tion.
<b><a href="postconf.5.html#smtp_bind_address6">smtp_bind_address6</a> (empty)</b>
An optional numerical network address that the SMTP
- client should bind to when making an IPv6 connec-
+ client should bind to when making an IPv6 connec-
tion.
<b><a href="postconf.5.html#smtp_helo_name">smtp_helo_name</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
- The hostname to send in the SMTP EHLO or HELO com-
+ The hostname to send in the SMTP EHLO or HELO com-
mand.
<b><a href="postconf.5.html#smtp_host_lookup">smtp_host_lookup</a> (dns)</b>
- What mechanisms when the SMTP client uses to look
+ What mechanisms when the SMTP client uses to look
up a host's IP address.
<b><a href="postconf.5.html#smtp_randomize_addresses">smtp_randomize_addresses</a> (yes)</b>
- Randomize the order of equal-preference MX host
+ Randomize the order of equal-preference MX host
addresses.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>SEE ALSO</b>
<a href="TLS_README.html">TLS_README</a>, Postfix STARTTLS howto
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
handle a request before it is terminated by a
built-in watchdog timer.
- <b><a href="postconf.5.html#delay_logging_time_resolution">delay_logging_time_resolution</a> (10000)</b>
- The time resolution (microseconds) of the sub-sec-
- ond delay values that are logged for subsequent
- message delivery stages.
+ <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
+ The maximal number of digits after the decimal
+ point when logging sub-second delay values.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
The time limit for sending or receiving information
over an internal communication channel.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
- The maximum amount of time that an idle Postfix
- daemon process waits for the next service request
+ The maximum amount of time that an idle Postfix
+ daemon process waits for the next service request
before exiting.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
- The maximal number of connection requests before a
+ The maximal number of connection requests before a
Postfix daemon process terminates.
<b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
- The process ID of a Postfix command or daemon
+ The process ID of a Postfix command or daemon
process.
<b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
- The process name of a Postfix command or daemon
+ The process name of a Postfix command or daemon
process.
<b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
- The location of the Postfix top-level queue direc-
+ The location of the Postfix top-level queue direc-
tory.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>SEE ALSO</b>
<a href="VIRTUAL_README.html">VIRTUAL_README</a>, domain hosting howto
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>HISTORY</b>
- This delivery agent was originally based on the Postfix
- local delivery agent. Modifications mainly consisted of
- removing code that either was not applicable or that was
- not safe in this context: aliases, ~user/.forward files,
+ This delivery agent was originally based on the Postfix
+ local delivery agent. Modifications mainly consisted of
+ removing code that either was not applicable or that was
+ not safe in this context: aliases, ~user/.forward files,
delivery to "|command" or to /file/name.
The <b>Delivered-To:</b> message header appears in the <b>qmail</b> sys-
tem by Daniel Bernstein.
- The <b>maildir</b> structure appears in the <b>qmail</b> system by
+ The <b>maildir</b> structure appears in the <b>qmail</b> system by
Daniel Bernstein.
<b>AUTHOR(S)</b>
.fi
.ad
.ft R
-.SH delay_logging_time_resolution (default: 10000)
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
-Specify a power of 10 in the range from 1 to 100000.
+.SH delay_logging_resolution_limit (default: 2)
+The maximal number of digits after the decimal point when logging
+sub-second delay values. Specify a number in the range 0..6.
+.PP
+Large delay values are rounded off to an integral number seconds;
+delay values below the delay_logging_resolution_limit are logged
+as "0", and small delay values are logged with at most two-digit
+precision.
.PP
The format of the "delays=a/b/c/d" logging is as follows:
.IP \(bu
.IP \(bu
d = time in message transmission
.PP
-Delay values less than delay_logging_time_resolution are logged
-as "0", while delay values less than 10s are logged with at most
-two-digit precision.
+This feature is available in Postfix 2.3 and later.
.SH delay_notice_recipient (default: postmaster)
The recipient of postmaster notifications with the message headers
of mail that cannot be delivered within $delay_warning_time time
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBdelay_warning_time (0h)\fR"
The time after which the sender receives the message headers of
mail that is still queued.
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBdouble_bounce_sender (double-bounce)\fR"
The sender address of postmaster notifications that are generated
by the mail system.
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBdouble_bounce_sender (double-bounce)\fR"
The sender address of postmaster notifications that are generated
by the mail system.
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBdisable_dns_lookups (no)\fR"
Disable DNS lookups in the Postfix SMTP and LMTP clients.
.IP "\fBipc_timeout (3600s)\fR"
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBexport_environment (see 'postconf -d' output)\fR"
The list of environment variables that a Postfix process will export
to non-Postfix processes.
.IP "\fBdefer_transports (empty)\fR"
The names of message delivery transports that should not deliver mail
unless someone issues "\fBsendmail -q\fR" or equivalent.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBhelpful_warnings (yes)\fR"
Log warnings about problematic configuration settings, and provide
helpful suggestions.
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBexport_environment (see 'postconf -d' output)\fR"
The list of environment variables that a Postfix process will export
to non-Postfix processes.
.IP "\fBdefer_transports (empty)\fR"
The names of message delivery transports that should not deliver mail
unless someone issues "\fBsendmail -q\fR" or equivalent.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBhelpful_warnings (yes)\fR"
Log warnings about problematic configuration settings, and provide
helpful suggestions.
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBdisable_dns_lookups (no)\fR"
Disable DNS lookups in the Postfix SMTP and LMTP clients.
.IP "\fBfallback_relay (empty)\fR"
.IP "\fBdaemon_timeout (18000s)\fR"
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer.
-.IP "\fBdelay_logging_time_resolution (10000)\fR"
-The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
+.IP "\fBdelay_logging_resolution_limit (2)\fR"
+The maximal number of digits after the decimal point when logging
+sub-second delay values.
.IP "\fBipc_timeout (3600s)\fR"
The time limit for sending or receiving information over an internal
communication channel.
s;\bdefer_code\b;<a href="postconf.5.html#defer_code">$&</a>;g;
s;\bdefer_service_name\b;<a href="postconf.5.html#defer_service_name">$&</a>;g;
s;\bdefer_transports\b;<a href="postconf.5.html#defer_transports">$&</a>;g;
- s;\bdelay_logging_time_resolution\b;<a href="postconf.5.html#delay_logging_time_resolution">$&</a>;g;
+ s;\bdelay_logging_resolution_limit\b;<a href="postconf.5.html#delay_logging_resolution_limit">$&</a>;g;
s;\bdelay_notice_recip[-</bB>]*\n* *[<bB>]*ient\b;<a href="postconf.5.html#delay_notice_recipient">$&</a>;g;
s;\bdelay_warning_time\b;<a href="postconf.5.html#delay_warning_time">$&</a>;g;
s;\bdeliver_lock_attempts\b;<a href="postconf.5.html#deliver_lock_attempts">$&</a>;g;
--- /dev/null
+This patch adds support for logfiles with conn_use, delays, and dsn
+attributes.
+
+--- pflogsumm.pl.orig 2005-04-09 12:54:44.000000000 +0200
++++ pflogsumm.pl 2005-11-07 21:50:05.483199193 +0100
+@@ -696,7 +696,7 @@
+ }
+ }
+ elsif((($addr, $relay, $delay, $status, $toRmdr) = $logRmdr =~
+- /to=<([^>]*)>, (?:orig_to=<[^>]*>, )?relay=([^,]+), delay=([^,]+), status=(\S+)(.*)$/o) >= 4)
++ /to=<([^>]*)>, (?:orig_to=<[^>]*>, )?relay=([^,]+), (?:conn_use=[^,]+, )?delay=([^,]+), (?:delays=[^,]+, )?(?:dsn=[^,]+, )?status=(\S+)(.*)$/o) >= 4)
+ {
+
+ if($opts{'m'} && $addr =~ /^(.*!)*([^!]+)!([^!@]+)@([^\.]+)$/o) {
+++ /dev/null
-Postfix 2.3 changes the logging format, introducing a field that
-reports the delivery status code as "dsn=x.yy.zz", where yy and zz
-can be up to three digits long. This breaks pflogsumm analysis.
-
-The patch below appeared in:
-
- Message-ID: <4257CF98.10309@michaweb.net>
- Date: Sat, 09 Apr 2005 14:50:32 +0200
- From: John Fawcett <johnml@michaweb.net>
- To: postfix-users@postfix.org
- Subject: postfix 2.3 and pflogsumm
-
---- pflogsumm.original 2005-04-09 12:54:44.140532258 +0200
-+++ pflogsumm 2005-04-09 12:55:33.246949650 +0200
-@@ -696,7 +696,7 @@
- }
- }
- elsif((($addr, $relay, $delay, $status, $toRmdr) = $logRmdr =~
-- /to=<([^>]*)>, (?:orig_to=<[^>]*>, )?relay=([^,]+), delay=([^,]+), status=(\S+)(.*)$/o) >= 4)
-+ /to=<([^>]*)>, (?:orig_to=<[^>]*>, )?relay=([^,]+), delay=([^,]+), (?:dsn=\d+\.\d+\.\d+, )?status=(\S+)(.*)$/o) >= 4)
- {
-
- if($opts{'m'} && $addr =~ /^(.*!)*([^!]+)!([^!@]+)@([^\.]+)$/o) {
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=no_address_mappings
</pre>
</blockquote>
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=nso_address_mapping
</pre>
</blockquote>
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=no_address_mappings
</pre>
</blockquote>
<pre>
/etc/postfix/master.cf:
:10026 inet n - n - - smtpd
- -o receive_override_options=no_address_mapping
+ -o receive_override_options=no_address_mappings
</pre>
</blockquote>
lookup is disabled. Turning off name lookup reduces delays due to
DNS lookup and increases the maximal inbound delivery rate. </p>
-%PARAM delay_logging_time_resolution 10000
+%PARAM delay_logging_resolution_limit 2
-<p> The time resolution (microseconds) of the sub-second delay
-values that are logged for subsequent message delivery stages.
-Specify a power of 10 in the range from 1 to 100000. </p>
+<p> The maximal number of digits after the decimal point when logging
+sub-second delay values. Specify a number in the range 0..6. </p>
+
+<p> Large delay values are rounded off to an integral number seconds;
+delay values below the delay_logging_resolution_limit are logged
+as "0", and small delay values are logged with at most two-digit
+precision. </p>
<p> The format of the "delays=a/b/c/d" logging is as follows: </p>
</ul>
-<p> Delay values less than delay_logging_time_resolution are logged
-as "0", while delay values less than 10s are logged with at most
-two-digit precision. </p>
+<p> This feature is available in Postfix 2.3 and later. </p>
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBdelay_warning_time (0h)\fR"
/* The time after which the sender receives the message headers of
/* mail that is still queued.
*
* XXX It is the queue ID non-inode bits that prevent messages from getting
* the same Message-Id within the same second.
+ *
+ * XXX An arbitrary amount of time may pass between the start of the mail
+ * transaction and the creation of a queue file. Since we guarantee queue
+ * ID uniqueness only within a second, we must ensure that the time in
+ * the message ID matches the queue ID creation time, if we use the queue
+ * ID in the message ID.
*/
if ((state->headers_seen & (1 << (state->resent[0] ?
HDR_RESENT_MESSAGE_ID : HDR_MESSAGE_ID))) == 0) {
- tv = state->arrival_time.tv_sec;
+ tv = state->handle->ctime.tv_sec;
tp = gmtime(&tv);
strftime(time_stamp, sizeof(time_stamp), "%Y%m%d%H%M%S", tp);
cleanup_out_format(state, REC_TYPE_NORM, "%sMessage-Id: <%s.%s@%s>",
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBdouble_bounce_sender (double-bounce)\fR"
/* The sender address of postmaster notifications that are generated
/* by the mail system.
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBdouble_bounce_sender (double-bounce)\fR"
/* The sender address of postmaster notifications that are generated
/* by the mail system.
is_header.o: is_header.c
is_header.o: is_header.h
log_adhoc.o: ../../include/attr.h
+log_adhoc.o: ../../include/format_tv.h
log_adhoc.o: ../../include/msg.h
log_adhoc.o: ../../include/sys_defs.h
log_adhoc.o: ../../include/vbuf.h
#include <msg.h>
#include <vstring.h>
+#include <format_tv.h>
/* Global library. */
}
/*
- * XXX Eliminate dependency on floating point. Wietse insists, however,
- * that precision be limited to avoid logfile clutter. That is, numbers
- * less than 100 must look as if they were formatted with %.2g, not as if
- * they were formatted with %.2f, and numbers of 10 and up must have no
- * sub-second detail at all.
+ * Round off large time values to an integral number of seconds, and
+ * display small numbers with only two digits as long as we stay above
+ * the time resolution.
*/
-#define MILLION 1000000
-#define DMILLION ((double) MILLION)
-
#define PRETTY_FORMAT(b, text, x) \
do { \
- if ((x).dt_sec > 9 \
- || ((x).dt_sec == 0 && (x).dt_usec < var_delay_resolution)) { \
- vstring_sprintf_append((b), text "%ld", \
- (long) (x).dt_sec + ((x).dt_usec > (MILLION / 2))); \
- } else { \
- vstring_sprintf_append((b), text "%.2g", (x).dt_sec \
- + ((x).dt_usec - (x).dt_usec % var_delay_resolution) \
- / DMILLION); \
- } \
+ vstring_strcat((b), text); \
+ format_tv((b), (x).dt_sec, (x).dt_usec, 2, var_delay_max_res); \
} while (0)
PRETTY_FORMAT(buf, ", delay=", delay);
/* int var_strict_encoding;
/* int var_verify_neg_cache;
/* int var_oldlog_compat;
-/* int var_delay_resolution;
+/* int var_delay_max_res;
/*
/* void mail_params_init()
/*
int var_strict_encoding;
int var_verify_neg_cache;
int var_oldlog_compat;
-int var_delay_resolution;
+int var_delay_max_res;
const char null_format_string[1] = "";
VAR_SMTP_TLS_LOGLEVEL, DEF_SMTP_TLS_LOGLEVEL, &var_smtp_tls_loglevel, 0, 0,
VAR_TLS_DAEMON_RAND_BYTES, DEF_TLS_DAEMON_RAND_BYTES, &var_tls_daemon_rand_bytes, 1, 0,
#endif
- VAR_DELAY_RESOLUTION, DEF_DELAY_RESOLUTION, &var_delay_resolution, MIN_DELAY_RESOLUTION, MAX_DELAY_RESOLUTION,
+ VAR_DELAY_MAX_RES, DEF_DELAY_MAX_RES, &var_delay_max_res, MIN_DELAY_MAX_RES, MAX_DELAY_MAX_RES,
0,
};
static CONFIG_TIME_TABLE time_defaults[] = {
extern bool var_frozen_delivered;
/*
- * Delay logging time resolution.
+ * Delay logging time roundup.
*/
-#define VAR_DELAY_RESOLUTION "delay_logging_time_resolution"
-#define MAX_DELAY_RESOLUTION 100000
-#define DEF_DELAY_RESOLUTION 10000
-#define MIN_DELAY_RESOLUTION 1
-extern int var_delay_resolution;
+#define VAR_DELAY_MAX_RES "delay_logging_resolution_limit"
+#define MAX_DELAY_MAX_RES 6
+#define DEF_DELAY_MAX_RES 2
+#define MIN_DELAY_MAX_RES 0
+extern int var_delay_max_res;
/* LICENSE
/* .ad
/* SYNOPSIS
/* #include <mail_queue.h>
/*
-/* VSTREAM *mail_queue_enter(queue_name, mode)
+/* VSTREAM *mail_queue_enter(queue_name, mode, tp)
/* const char *queue_name;
/* mode_t mode;
+/* struct timeval *tp;
/*
/* VSTREAM *mail_queue_open(queue_name, queue_id, flags, mode)
/* const char *queue_name;
/* id is the file base name, see VSTREAM_PATH(). Queue ids are
/* relatively short strings and are recycled in the course of time.
/* The only guarantee given is that on a given machine, no two queue
-/* entries will have the same queue ID at the same time.
+/* entries will have the same queue ID at the same time. The tp
+/* argument, if not a null pointer, receives the time stamp that
+/* corresponds with the queue ID.
/*
/* mail_queue_open() opens the named queue file. The \fIflags\fR
/* and \fImode\fR arguments are as with open(2). The result is a
/* mail_queue_enter - make mail queue entry with locally-unique name */
-VSTREAM *mail_queue_enter(const char *queue_name, mode_t mode)
+VSTREAM *mail_queue_enter(const char *queue_name, mode_t mode,
+ struct timeval * tp)
{
char *myname = "mail_queue_enter";
static VSTRING *id_buf;
path_buf = vstring_alloc(10);
temp_path = vstring_alloc(100);
}
- GETTIMEOFDAY(&tv);
+ if (tp == 0)
+ tp = &tv;
/*
* Create a file with a temporary name that does not collide. The process
* If someone is racing against us, try to win.
*/
for (;;) {
+ GETTIMEOFDAY(tp);
vstring_sprintf(temp_path, "%s/%d.%d", queue_name,
- (int) tv.tv_usec, pid);
+ (int) tp->tv_usec, pid);
if ((fd = open(STR(temp_path), O_RDWR | O_CREAT | O_EXCL, mode)) >= 0)
break;
- if (errno == EEXIST || errno == EISDIR) {
- if ((int) ++tv.tv_usec < 0)
- tv.tv_usec = 0;
+ if (errno == EEXIST || errno == EISDIR)
continue;
- }
msg_warn("%s: create file %s: %m", myname, STR(temp_path));
sleep(10);
}
* If someone is racing against us, try to win.
*/
file_id = get_file_id(fd);
- GETTIMEOFDAY(&tv);
/*
* XXX Some systems seem to have clocks that correlate with process
* prevents multiple messages from getting the same Message-ID value.
*/
for (count = 0;; count++) {
- vstring_sprintf(id_buf, "%05X%s", (int) tv.tv_usec, file_id);
+ GETTIMEOFDAY(tp);
+ vstring_sprintf(id_buf, "%05X%s", (int) tp->tv_usec, file_id);
mail_queue_path(path_buf, queue_name, STR(id_buf));
-#if 0
- if (access(STR(path_buf), X_OK) == 0) { /* collision. */
- if ((int) ++tv.tv_usec < 0)
- tv.tv_usec = 0;
- continue;
- }
-#endif
if (sane_rename(STR(temp_path), STR(path_buf)) == 0) /* success */
break;
- if (errno == EPERM || errno == EISDIR) {/* collision. weird. */
- if ((int) ++tv.tv_usec < 0)
- tv.tv_usec = 0;
+ if (errno == EPERM || errno == EISDIR) /* collision. weird. */
continue;
- }
if (errno != ENOENT || mail_queue_mkdirs(STR(path_buf)) < 0) {
msg_warn("%s: rename %s to %s: %m", myname,
STR(temp_path), STR(path_buf));
/* DESCRIPTION
/* .nf
+ /*
+ * System library.
+ */
+#include <sys/time.h>
+
/*
* Utility library.
*/
#define MAIL_QUEUE_STAT_READY (S_IRUSR | S_IWUSR | S_IXUSR)
#define MAIL_QUEUE_STAT_CORRUPT (S_IRUSR)
-extern struct VSTREAM *mail_queue_enter(const char *, mode_t);
+extern struct VSTREAM *mail_queue_enter(const char *, mode_t, struct timeval *);
extern struct VSTREAM *mail_queue_open(const char *, const char *, int, mode_t);
extern int mail_queue_rename(const char *, const char *, const char *);
extern int mail_queue_remove(const char *, const char *);
/*
/* typedef struct {
/* .in +4
-/* VSTREAM *stream;
-/* char *id;
+/* VSTREAM *stream; /* read/write stream */
+/* char *id; /* queue ID */
+/* struct timeval ctime; /* create time */
/* private members...
/* .in -4
/* } MAIL_STREAM;
MAIL_STREAM *mail_stream_file(const char *queue, const char *class,
const char *service, int mode)
{
+ struct timeval tv;
MAIL_STREAM *info;
VSTREAM *stream;
- stream = mail_queue_enter(queue, 0600 | mode);
+ stream = mail_queue_enter(queue, 0600 | mode, &tv);
if (msg_verbose)
msg_info("open %s", VSTREAM_PATH(stream));
info->class = mystrdup(class);
info->service = mystrdup(service);
info->mode = mode;
+ info->ctime = tv;
return (info);
}
/* DESCRIPTION
/* .nf
+ /*
+ * System library.
+ */
+#include <sys/time.h>
+
/*
* Utility library.
*/
char *class; /* trigger class */
char *service; /* trigger service */
int mode; /* additional permissions */
+ struct timeval ctime; /* creation time */
};
#define MAIL_STREAM_CTL_END 0 /* Terminator */
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20051106"
+#define MAIL_RELEASE_DATE "20051108"
#define MAIL_VERSION_NUMBER "2.3"
#ifdef SNAPSHOT
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBdisable_dns_lookups (no)\fR"
/* Disable DNS lookups in the Postfix SMTP and LMTP clients.
/* .IP "\fBipc_timeout (3600s)\fR"
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBexport_environment (see 'postconf -d' output)\fR"
/* The list of environment variables that a Postfix process will export
/* to non-Postfix processes.
/* .IP "\fBdefer_transports (empty)\fR"
/* The names of message delivery transports that should not deliver mail
/* unless someone issues "\fBsendmail -q\fR" or equivalent.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBhelpful_warnings (yes)\fR"
/* Log warnings about problematic configuration settings, and provide
/* helpful suggestions.
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBexport_environment (see 'postconf -d' output)\fR"
/* The list of environment variables that a Postfix process will export
/* to non-Postfix processes.
/* .IP "\fBdefer_transports (empty)\fR"
/* The names of message delivery transports that should not deliver mail
/* unless someone issues "\fBsendmail -q\fR" or equivalent.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBhelpful_warnings (yes)\fR"
/* Log warnings about problematic configuration settings, and provide
/* helpful suggestions.
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBdisable_dns_lookups (no)\fR"
/* Disable DNS lookups in the Postfix SMTP and LMTP clients.
/* .IP "\fBfallback_relay (empty)\fR"
unix_recv_fd.c unix_send_fd.c unix_trigger.c unsafe.c uppercase.c \
username.c valid_hostname.c vbuf.c vbuf_print.c vstream.c \
vstream_popen.c vstring.c vstring_vstream.c watchdog.c writable.c \
- write_buf.c write_wait.c sane_basename.c
+ write_buf.c write_wait.c sane_basename.c format_tv.c
OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \
attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \
attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \
unix_recv_fd.o unix_send_fd.o unix_trigger.o unsafe.o uppercase.o \
username.o valid_hostname.o vbuf.o vbuf_print.o vstream.o \
vstream_popen.o vstring.o vstring_vstream.o watchdog.o writable.o \
- write_buf.o write_wait.o sane_basename.o
+ write_buf.o write_wait.o sane_basename.o format_tv.o
HDRS = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \
chroot_uid.h cidr_match.h clean_env.h connect.h ctable.h dict.h \
dict_cdb.h dict_cidr.h dict_db.h dict_dbm.h dict_env.h dict_ht.h \
sigdelay.h sock_addr.h spawn_command.h split_at.h stat_as.h \
stringops.h sys_defs.h timed_connect.h timed_wait.h trigger.h \
username.h valid_hostname.h vbuf.h vbuf_print.h vstream.h vstring.h \
- vstring_vstream.h watchdog.h
+ vstring_vstream.h watchdog.h format_tv.h
TESTSRC = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
stream_test.c dup2_pass_on_exec.c
DEFS = -I. -D$(SYSTYPE)
inet_addr_list attr_print64 attr_scan64 base64_code attr_print0 \
attr_scan0 host_port attr_scan_plain attr_print_plain htable \
unix_recv_fd unix_send_fd stream_recv_fd stream_send_fd hex_code \
- myaddrinfo myaddrinfo4 inet_proto sane_basename
+ myaddrinfo myaddrinfo4 inet_proto sane_basename format_tv
LIB_DIR = ../../lib
INC_DIR = ../../include
diff gccw.ref gccw.tmp
rm -f gccw.o gccw.tmp
+format_tv: $(LIB)
+ mv $@.o junk
+ $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
+ mv junk $@.o
+
tests: valid_hostname_test mac_expand_test dict_test unescape_test \
hex_quote_test ctable_test inet_addr_list_test base64_code_test \
attr_scan64_test attr_scan0_test dict_pcre_test host_port_test \
dict_cidr_test attr_scan_plain_test htable_test hex_code_test \
- myaddrinfo_test
+ myaddrinfo_test format_tv_test
valid_hostname_test: valid_hostname valid_hostname.in valid_hostname.ref
./valid_hostname <valid_hostname.in 2>valid_hostname.tmp
diff myaddrinfo4.ref2 myaddrinfo4.tmp
rm -f myaddrinfo4.tmp
+format_tv_test: format_tv format_tv.in format_tv.ref
+ ./format_tv <format_tv.in >format_tv.tmp
+ diff format_tv.ref format_tv.tmp
+ rm -f format_tv.tmp
+
depend: $(MAKES)
(sed '1,/^# do not edit/!d' Makefile.in; \
set -e; for i in [a-z][a-z0-9]*.c; do \
find_inet.o: sys_defs.h
find_inet.o: vbuf.h
find_inet.o: vstring.h
+format_tv.o: format_tv.c
+format_tv.o: format_tv.h
+format_tv.o: msg.h
+format_tv.o: sys_defs.h
+format_tv.o: vbuf.h
+format_tv.o: vstring.h
fsspace.o: fsspace.c
fsspace.o: fsspace.h
fsspace.o: msg.h
--- /dev/null
+/*++
+/* NAME
+/* format_tv 3
+/* SUMMARY
+/* format time value with limited precision
+/* SYNOPSIS
+/* #include <format_tv.h>
+/*
+/* VSTRING *format_tv(buffer, sec, usec, width, max_pos)
+/* VSTRING *buffer;
+/* int sec;
+/* int usec;
+/* int width;
+/* int max_pos;
+/* DESCRIPTION
+/* format_tv() formats the specified time while suppressing
+/* irrelevant digits in the output. Large numbers are always
+/* rounded up to an integral number of seconds. Small numbers
+/* are produced with a limited number of digits, provided that
+/* those digits don't exceed the limit on the number of positions
+/* after the decimal point. Trailing zeros are always omitted
+/* from the output.
+/*
+/* Arguments:
+/* .IP buffer
+/* Buffer to which the result is appended.
+/* .IP sec
+/* The seconds portion of the time value.
+/* .IP usec
+/* The microseconds portion of the time value.
+/* .IP width
+/* The maximal number of digits to produce when formatting
+/* small numbers. Trailing nulls are always omitted. Specify
+/* a number in the range 1..6.
+/* .IP max_pos
+/* The maximal number of positions after the decimal point.
+/* Specify a number in the range 0..6.
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* IBM T.J. Watson Research
+/* P.O. Box 704
+/* Yorktown Heights, NY 10598, USA
+/*--*/
+
+#include <sys_defs.h>
+
+/* Utility library. */
+
+#include <msg.h>
+#include <format_tv.h>
+
+/* Application-specific. */
+
+#define MILLION 1000000
+
+/* format_tv - print time with limited precision */
+
+VSTRING *format_tv(VSTRING *buf, int sec, int usec, int width, int max)
+{
+ static int pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000};
+ int n;
+ int rem;
+ int wid;
+ int ures;
+
+ /*
+ * Sanity check.
+ */
+ if (max < 0 || max > 6)
+ msg_panic("format_tv: bad max decimal count %d", max);
+ if (sec < 0 || usec < 0 || usec > MILLION)
+ msg_panic("format_tv: bad time %ds %dus", sec, usec);
+ if (width < 1 || width > 6)
+ msg_panic("format_tv: bad width %d", width);
+ ures = MILLION / pow10[max];
+ wid = pow10[width];
+
+ /*
+ * Adjust the resolution to suppress irrelevant digits.
+ */
+ if (ures < MILLION) {
+ if (sec > 0) {
+ for (n = 1; sec >= n && n <= wid / 10; n *= 10)
+ /* void */ ;
+ ures = (MILLION / wid) * n;
+ } else {
+ while (usec >= wid * ures)
+ ures *= 10;
+ }
+ }
+
+ /*
+ * Round up the number if necessary. Leave thrash below the resolution.
+ */
+ if (ures > 1) {
+ usec += ures / 2;
+ if (usec >= MILLION) {
+ sec += 1;
+ usec -= MILLION;
+ }
+ }
+
+ /*
+ * Format the number. Truncate thrash below the resolution.
+ */
+ vstring_sprintf_append(buf, "%d", sec);
+ if (usec >= ures) {
+ VSTRING_ADDCH(buf, '.');
+ for (rem = usec, n = MILLION / 10; rem >= ures && n > 0; n /= 10) {
+ VSTRING_ADDCH(buf, "0123456789"[rem / n]);
+ rem %= n;
+ }
+ }
+ VSTRING_TERMINATE(buf);
+ return (buf);
+}
+
+#ifdef TEST
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <vstring_vstream.h>
+
+int main(int argc, char **argv)
+{
+ VSTRING *in = vstring_alloc(10);
+ VSTRING *out = vstring_alloc(10);
+ double tval;
+ int sec;
+ int usec;
+ int width;
+ int max_pos;
+
+ while (vstring_get_nonl(in, VSTREAM_IN) > 0) {
+ vstream_printf(">> %s\n", vstring_str(in));
+ if (vstring_str(in)[0] == 0 || vstring_str(in)[0] == '#')
+ continue;
+ if (sscanf(vstring_str(in), "%lf %d %d", &tval, &width, &max_pos) != 3)
+ msg_fatal("bad input: %s", vstring_str(in));
+ sec = (int) tval; /* raw seconds */
+ usec = (tval - sec) * MILLION; /* raw microseconds */
+ VSTRING_RESET(out);
+ format_tv(out, sec, usec, width, max_pos);
+ vstream_printf("%s\n", vstring_str(out));
+ vstream_fflush(VSTREAM_OUT);
+ }
+ vstring_free(in);
+ vstring_free(out);
+ return (0);
+}
+
+#endif
--- /dev/null
+#ifndef _FORMAT_TV_H_INCLUDED_
+#define _FORMAT_TV_H_INCLUDED_
+
+/*++
+/* NAME
+/* format_tv 3h
+/* SUMMARY
+/* format time with limited precision
+/* SYNOPSIS
+/* #include <format_tv.h>
+/* DESCRIPTION
+/* .nf
+
+ /*
+ * Utility library.
+ */
+#include <vstring.h>
+
+ /*
+ * External interface.
+ */
+extern VSTRING *format_tv(VSTRING *, int, int, int, int);
+
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* IBM T.J. Watson Research
+/* P.O. Box 704
+/* Yorktown Heights, NY 10598, USA
+/*--*/
+
+#endif
--- /dev/null
+# Three digits in, 2/6 digits out, rounding down.
+1110 2 6
+111 2 6
+11.1 2 6
+1.11 2 6
+0.111 2 6
+0.0111 2 6
+0.00111 2 6
+0.000111 2 6
+0.000011 2 6
+
+# One digit in. Must not produce spurious digits or trailing nulls.
+
+1000 2 6
+100 2 6
+10 2 6
+1 2 6
+0.1 2 6
+0.01 2 6
+0.001 2 6
+0.0001 2 6
+0.00001 2 6
+0.000001 2 6
+
+# Three digits in, 2/6 digits out, rounding up.
+
+996 2 6
+99.6 2 6
+9.96 2 6
+.996 2 6
+.0996 2 6
+.00996 2 6
+.000996 2 6
+
+# Three digits in, 1/6 digits out, rounding down.
+
+1110 1 6
+111 1 6
+11.1 1 6
+1.11 1 6
+0.111 1 6
+0.0111 1 6
+0.00111 1 6
+0.000111 1 6
+0.000011 1 6
+
+# One digit in. Must not produce trailing nulls.
+
+1000 1 6
+100 1 6
+10 1 6
+1 1 6
+0.1 1 6
+0.01 1 6
+0.001 1 6
+0.0001 1 6
+0.00001 1 6
+0.000001 1 6
+
+# Three digits in, 1/6 digits out, rounding up.
+
+996 1 6
+99.6 1 6
+9.96 1 6
+.996 1 6
+.0996 1 6
+.00996 1 6
+.000996 1 6
--- /dev/null
+>> # Three digits in, 2/6 digits out, rounding down.
+>> 1110 2 6
+1110
+>> 111 2 6
+111
+>> 11.1 2 6
+11
+>> 1.11 2 6
+1.1
+>> 0.111 2 6
+0.11
+>> 0.0111 2 6
+0.011
+>> 0.00111 2 6
+0.0011
+>> 0.000111 2 6
+0.00011
+>> 0.000011 2 6
+0.000011
+>>
+>> # One digit in. Must not produce spurious digits or trailing nulls.
+>>
+>> 1000 2 6
+1000
+>> 100 2 6
+100
+>> 10 2 6
+10
+>> 1 2 6
+1
+>> 0.1 2 6
+0.1
+>> 0.01 2 6
+0.01
+>> 0.001 2 6
+0.001
+>> 0.0001 2 6
+0.0001
+>> 0.00001 2 6
+0.00001
+>> 0.000001 2 6
+0.000001
+>>
+>> # Three digits in, 2/6 digits out, rounding up.
+>>
+>> 996 2 6
+996
+>> 99.6 2 6
+100
+>> 9.96 2 6
+10
+>> .996 2 6
+1
+>> .0996 2 6
+0.1
+>> .00996 2 6
+0.01
+>> .000996 2 6
+0.001
+>>
+>> # Three digits in, 1/6 digits out, rounding down.
+>>
+>> 1110 1 6
+1110
+>> 111 1 6
+111
+>> 11.1 1 6
+11
+>> 1.11 1 6
+1
+>> 0.111 1 6
+0.1
+>> 0.0111 1 6
+0.01
+>> 0.00111 1 6
+0.001
+>> 0.000111 1 6
+0.0001
+>> 0.000011 1 6
+0.00001
+>>
+>> # One digit in. Must not produce trailing nulls.
+>>
+>> 1000 1 6
+1000
+>> 100 1 6
+100
+>> 10 1 6
+10
+>> 1 1 6
+1
+>> 0.1 1 6
+0.1
+>> 0.01 1 6
+0.01
+>> 0.001 1 6
+0.001
+>> 0.0001 1 6
+0.0001
+>> 0.00001 1 6
+0.00001
+>> 0.000001 1 6
+0.000001
+>>
+>> # Three digits in, 1/6 digits out, rounding up.
+>>
+>> 996 1 6
+996
+>> 99.6 1 6
+100
+>> 9.96 1 6
+10
+>> .996 1 6
+1
+>> .0996 1 6
+0.1
+>> .00996 1 6
+0.01
+>> .000996 1 6
+0.001
/*
/* time_t vstream_ftime(stream)
/* VSTREAM *stream;
+/*
+/* struct timeval vstream_ftimeval(stream)
+/* VSTREAM *stream;
/* DESCRIPTION
/* The \fIvstream\fR module implements light-weight buffered I/O
/* similar to the standard I/O routines.
/* fill operation, or the last buffer flush operation for the specified
/* stream. This information is maintained only when stream timeouts are
/* enabled.
+/*
+/* vstream_ftimeval() is like vstream_ftime() but returns more
+/* detail.
/* DIAGNOSTICS
/* Panics: interface violations. Fatal errors: out of memory.
/* SEE ALSO
return (VSTREAM_EOF);
}
if (stream->timeout)
- stream->iotime = time((time_t *) 0);
+ GETTIMEOFDAY(&stream->iotime);
if (msg_verbose > 2 && stream != VSTREAM_ERR && n != to_flush)
msg_info("%s: %d flushed %ld/%ld", myname, stream->fd,
(long) n, (long) to_flush);
return (VSTREAM_EOF);
default:
if (stream->timeout)
- stream->iotime = time((time_t *) 0);
+ GETTIMEOFDAY(&stream->iotime);
if (msg_verbose > 2)
msg_info("%s: fd %d got %ld", myname, stream->fd, (long) n);
bp->cnt = -n;
stream->timeout = 0;
stream->context = 0;
stream->jbuf = 0;
- stream->iotime = 0;
+ stream->iotime.tv_sec = stream->iotime.tv_usec = 0;
return (stream);
}
break;
case VSTREAM_CTL_TIMEOUT:
if (stream->timeout == 0)
- stream->iotime = time((time_t *) 0);
+ GETTIMEOFDAY(&stream->iotime);
stream->timeout = va_arg(ap, int);
break;
case VSTREAM_CTL_EXCEPT:
/*
* System library.
*/
+#include <sys/time.h>
#include <time.h>
#include <fcntl.h>
#include <stdarg.h>
VSTREAM_WAITPID_FN waitpid_fn; /* vstream_popen/close() */
int timeout; /* read/write timout */
jmp_buf *jbuf; /* exception handling */
- time_t iotime; /* time of last fill/flush */
+ struct timeval iotime; /* time of last fill/flush */
} VSTREAM;
extern VSTREAM vstream_fstd[]; /* pre-defined streams */
#define vstream_ftimeout(vp) vbuf_timeout(&(vp)->buf)
#define vstream_clearerr(vp) vbuf_clearerr(&(vp)->buf)
#define VSTREAM_PATH(vp) ((vp)->path ? (vp)->path : "unknown_stream")
-#define vstream_ftime(vp) ((vp)->iotime)
+#define vstream_ftime(vp) ((time_t) ((vp)->iotime.tv_sec))
+#define vstream_ftimeval(vp) ((vp)->iotime)
extern void vstream_control(VSTREAM *, int,...);
/* .IP "\fBdaemon_timeout (18000s)\fR"
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
-/* .IP "\fBdelay_logging_time_resolution (10000)\fR"
-/* The time resolution (microseconds) of the sub-second delay
-/* values that are logged for subsequent message delivery stages.
+/* .IP "\fBdelay_logging_resolution_limit (2)\fR"
+/* The maximal number of digits after the decimal point when logging
+/* sub-second delay values.
/* .IP "\fBipc_timeout (3600s)\fR"
/* The time limit for sending or receiving information over an internal
/* communication channel.