]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.5-20070911
authorWietse Venema <wietse@porcupine.org>
Tue, 11 Sep 2007 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:33:21 +0000 (06:33 +0000)
14 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/html/pipe.8.html
postfix/man/man8/pipe.8
postfix/src/global/mail_version.h
postfix/src/master/Makefile.in
postfix/src/master/master.h
postfix/src/master/master_avail.c
postfix/src/master/master_conf.c
postfix/src/master/master_ent.c
postfix/src/master/master_spawn.c
postfix/src/pipe/pipe.c
postfix/src/smtp/smtp_connect.c
postfix/src/smtpd/smtpd_check.c

index 06f5b7cbf5841f3c1ce085537807db885290998a..8c7acdf968b9f5065366b50f4d44f46a79aa5a66 100644 (file)
@@ -13693,3 +13693,22 @@ Apologies for any names omitted.
        delivery agent performs final delivery. This changes the
        status in DSN "success" messages from "relayed" into
        "delivered".  File: pipe/pipe.c.
+
+20070904-6
+
+       Feature: stress-adaptive behavior. When a "public" network
+       service runs into an "all processes are busy" condition,
+       the master(8) daemon logs a warning, restarts the service,
+       and runs it with "-o stress=yes" on the command line (normally
+       it runs the service with "-o stress=").  This can be used
+       to make main.cf parameter settings stress dependent.
+       Examples: "smtpd_timeout = ${stress?10}${stress:300}" and
+       "smtpd_hard_error_limit = ${stress?1}${stress:20}".  Files:
+       master/master_avail.c, master/master_spawn.c, master/master_ent.c.
+
+20070911
+
+       Bugfix (introduced Postfix 2.2.11): certificate with
+       unparsable canonical name caused the SMTPD policy client
+       to allocate zero-length memory, triggering an assertion
+       that it shouldn't do such things.  File: smtpd/smtpd_check.c.
index 69d2600ab7aa240af0c981706d4510c83d1fb0e0..7a6526d90f6046732d0ac02ed880c8ab02eff391 100644 (file)
@@ -17,6 +17,27 @@ Incompatibility with Postfix 2.3 and earlier
 If you upgrade from Postfix 2.3 or earlier, read RELEASE_NOTES-2.4
 before proceeding.
 
+Major changes with Postfix snapshot 20070911
+============================================
+
+Stress-adaptive behavior. When a "public" network service runs into
+an "all processes are busy" condition, the master(8) daemon logs a
+warning, restarts the service, and runs it with "-o stress=yes" on
+the command line (under normal conditions it runs the service with
+"-o stress=" on the command line).  This can be used to make main.cf
+parameter settings stress dependent, for example:
+
+/etc/postfix/main.cf:
+    smtpd_timeout = ${stress?10}${stress:300}
+    smtpd_hard_error_limit = ${stress?1}${stress:20}
+
+Translation: under conditions of stress, use an smtpd_timeout value
+of 10 seconds instead of 300, and use smtpd_hard_error_limit of 1
+instead of 20. The syntax is explained in the postconf(5) manpage.
+
+This feature needs further configuration and documentation, but is
+already useful in its present form.
+
 Major changes with Postfix snapshot 20070724
 ============================================
 
index 61d865ca5d665d873fc46fab075f817397b58a50..539ef320f27ca01a94f1567085ee08998181d868 100644 (file)
@@ -122,67 +122,69 @@ PIPE(8)                                                                PIPE(8)
                      tus  notification)  messages, and changes it
                      from "relayed" into "delivered".
 
+                     This feature is available as of Postfix 2.5.
+
               <b>h</b>      Fold  the  command-line  <b>$recipient</b>  address
                      domain part (text to the right of the right-
-                     most <b>@</b> character) to lower  case;  fold  the
+                     most  <b>@</b>  character)  to lower case; fold the
                      entire  command-line  <b>$domain</b>  and  <b>$nexthop</b>
-                     host or domain information  to  lower  case.
+                     host  or  domain  information to lower case.
                      This is recommended for delivery via <b>UUCP</b>.
 
-              <b>q</b>      Quote  white space and other special charac-
+              <b>q</b>      Quote white space and other special  charac-
                      ters in the command-line <b>$sender</b> and <b>$recip-</b>
                      <b>ient</b> address localparts (text to the left of
                      the right-most <b>@</b> character), according to an
-                     8-bit  transparent version of <a href="http://tools.ietf.org/html/rfc822">RFC 822</a>.  This
-                     is recommended  for  delivery  via  <b>UUCP</b>  or
+                     8-bit transparent version of <a href="http://tools.ietf.org/html/rfc822">RFC 822</a>.   This
+                     is  recommended  for  delivery  via  <b>UUCP</b> or
                      <b>BSMTP</b>.
 
-                     The  result  is  compatible with the address
-                     parsing of command-line  recipients  by  the
+                     The result is compatible  with  the  address
+                     parsing  of  command-line  recipients by the
                      Postfix <a href="sendmail.1.html"><b>sendmail</b>(1)</a> mail submission command.
 
-                     The <b>q</b> flag affects  only  entire  addresses,
+                     The  <b>q</b>  flag  affects only entire addresses,
                      not the partial address information from the
-                     <b>$user</b>, <b>$extension</b> or  <b>$mailbox</b>  command-line
+                     <b>$user</b>,  <b>$extension</b>  or <b>$mailbox</b> command-line
                      macros.
 
               <b>u</b>      Fold  the  command-line  <b>$recipient</b>  address
-                     localpart (text to the left  of  the  right-
-                     most  <b>@</b>  character)  to lower case.  This is
+                     localpart  (text  to  the left of the right-
+                     most <b>@</b> character) to lower  case.   This  is
                      recommended for delivery via <b>UUCP</b>.
 
               <b>.</b>      Prepend "<b>.</b>" to lines starting with "<b>.</b>". This
                      is needed by, for example, <b>BSMTP</b> software.
 
-              &gt;      Prepend  "&gt;" to lines starting with "<b>From</b> ".
+              &gt;      Prepend "&gt;" to lines starting with "<b>From</b>  ".
                      This is expected by, for example, <b>UUCP</b> soft-
                      ware.
 
        <b>null_sender</b>=<i>replacement</i> (default: MAILER-DAEMON)
               Replace the null sender address (typically used for
-              delivery status notifications) with  the  specified
+              delivery  status  notifications) with the specified
               text when expanding the <b>$sender</b> command-line macro,
               and when generating a From_ or Return-Path: message
               header.
 
-              If  the null sender replacement text is a non-empty
-              string then it  is  affected  by  the  <b>q</b>  flag  for
+              If the null sender replacement text is a  non-empty
+              string  then  it  is  affected  by  the  <b>q</b> flag for
               address quoting in command-line arguments.
 
               The null sender replacement text may be empty; this
-              form is recommended for content filters  that  feed
+              form  is  recommended for content filters that feed
               mail back into Postfix. The empty sender address is
-              not affected by the <b>q</b> flag for address  quoting  in
+              not  affected  by the <b>q</b> flag for address quoting in
               command-line arguments.
 
               Caution: a null sender address is easily mis-parsed
-              by naive software. For example,  when  the  <a href="pipe.8.html"><b>pipe</b>(8)</a>
+              by  naive  software.  For example, when the <a href="pipe.8.html"><b>pipe</b>(8)</a>
               daemon executes a command such as:
 
                   command -f$sender -- $recipient (<i>bad</i>)
 
               the command will mis-parse the -f option value when
-              the sender address is a null string.   For  correct
+              the  sender  address is a null string.  For correct
               parsing, specify <b>$sender</b> as an argument by itself:
 
                   command -f $sender -- $recipient (<i>good</i>)
@@ -190,240 +192,240 @@ PIPE(8)                                                                PIPE(8)
               This feature is available as of Postfix 2.3.
 
        <b>size</b>=<i>size</i><b>_</b><i>limit</i> (optional)
-              Don't  deliver messages that exceed this size limit
+              Don't deliver messages that exceed this size  limit
               (in bytes); return them to the sender instead.
 
        <b>user</b>=<i>username</i> (required)
 
        <b>user</b>=<i>username</i>:<i>groupname</i>
               Execute the external command with the rights of the
-              specified  <i>username</i>.   The software refuses to exe-
-              cute commands with root  privileges,  or  with  the
-              privileges  of  the mail system owner. If <i>groupname</i>
-              is specified, the corresponding group  ID  is  used
+              specified <i>username</i>.  The software refuses  to  exe-
+              cute  commands  with  root  privileges, or with the
+              privileges of the mail system owner.  If  <i>groupname</i>
+              is  specified,  the  corresponding group ID is used
               instead of the group ID of <i>username</i>.
 
        <b>argv</b>=<i>command</i>... (required)
-              The  command to be executed. This must be specified
+              The command to be executed. This must be  specified
               as the last command attribute.  The command is exe-
               cuted  directly,  i.e.  without  interpretation  of
-              shell meta characters by  a  shell  command  inter-
+              shell  meta  characters  by  a shell command inter-
               preter.
 
               In  the  command  argument  vector,  the  following
               macros are recognized and replaced with correspond-
-              ing  information  from  the  Postfix  queue manager
+              ing information  from  the  Postfix  queue  manager
               delivery request.
 
-              In addition to the form ${<i>name</i>},  the  forms  $<i>name</i>
-              and  $(<i>name</i>) are also recognized.  Specify <b>$$</b> where
+              In  addition  to  the form ${<i>name</i>}, the forms $<i>name</i>
+              and $(<i>name</i>) are also recognized.  Specify <b>$$</b>  where
               a single <b>$</b> is wanted.
 
               <b>${client_address</b>}
                      This macro expands to the remote client net-
                      work address.
 
-                     This  is available in Postfix 2.2 and later.
+                     This is available in Postfix 2.2 and  later.
 
               <b>${client_helo</b>}
                      This macro expands to the remote client HELO
                      command parameter.
 
-                     This  is available in Postfix 2.2 and later.
+                     This is available in Postfix 2.2 and  later.
 
               <b>${client_hostname</b>}
-                     This macro  expands  to  the  remote  client
+                     This  macro  expands  to  the  remote client
                      hostname.
 
-                     This  is available in Postfix 2.2 and later.
+                     This is available in Postfix 2.2 and  later.
 
               <b>${client_protocol</b>}
                      This macro expands to the remote client pro-
                      tocol.
 
-                     This  is available in Postfix 2.2 and later.
+                     This is available in Postfix 2.2 and  later.
 
               <b>${domain</b>}
-                     This macro expands to the domain portion  of
+                     This  macro expands to the domain portion of
                      the recipient address.  For example, with an
-                     address  <i>user+foo@domain</i>   the   domain   is
+                     address   <i>user+foo@domain</i>   the   domain  is
                      <i>domain</i>.
 
-                     This  information  is modified by the <b>h</b> flag
+                     This information is modified by the  <b>h</b>  flag
                      for case folding.
 
-                     This is available in Postfix 2.5 and  later.
+                     This  is available in Postfix 2.5 and later.
 
               <b>${extension</b>}
-                     This  macro expands to the extension part of
-                     a recipient address.  For example,  with  an
+                     This macro expands to the extension part  of
+                     a  recipient  address.  For example, with an
                      address  <i>user+foo@domain</i>  the  extension  is
                      <i>foo</i>.
 
-                     A  command-line   argument   that   contains
-                     <b>${extension</b>}  expands  into as many command-
+                     A   command-line   argument   that  contains
+                     <b>${extension</b>} expands into as  many  command-
                      line arguments as there are recipients.
 
-                     This information is modified by the  <b>u</b>  flag
+                     This  information  is modified by the <b>u</b> flag
                      for case folding.
 
               <b>${mailbox</b>}
-                     This  macro  expands  to  the complete local
-                     part of a recipient address.   For  example,
-                     with  an address <i>user+foo@domain</i> the mailbox
+                     This macro expands  to  the  complete  local
+                     part  of  a recipient address.  For example,
+                     with an address <i>user+foo@domain</i> the  mailbox
                      is <i>user+foo</i>.
 
-                     A  command-line   argument   that   contains
-                     <b>${mailbox</b>}  expands  to as many command-line
+                     A   command-line   argument   that  contains
+                     <b>${mailbox</b>} expands to as  many  command-line
                      arguments as there are recipients.
 
-                     This information is modified by the  <b>u</b>  flag
+                     This  information  is modified by the <b>u</b> flag
                      for case folding.
 
               <b>${nexthop</b>}
                      This macro expands to the next-hop hostname.
 
-                     This information is modified by the  <b>h</b>  flag
+                     This  information  is modified by the <b>h</b> flag
                      for case folding.
 
               <b>${recipient</b>}
                      This macro expands to the complete recipient
                      address.
 
-                     A  command-line   argument   that   contains
+                     A   command-line   argument   that  contains
                      <b>${recipient</b>} expands to as many command-line
                      arguments as there are recipients.
 
-                     This information  is  modified  by  the  <b>hqu</b>
+                     This  information  is  modified  by  the <b>hqu</b>
                      flags for quoting and case folding.
 
               <b>${sasl_method</b>}
-                     This  macro  expands to the SASL authentica-
-                     tion mechanism used during the reception  of
-                     the  message.  An  empty string is passed if
-                     the message has been received  without  SASL
+                     This macro expands to the  SASL  authentica-
+                     tion  mechanism used during the reception of
+                     the message. An empty string  is  passed  if
+                     the  message  has been received without SASL
                      authentication.
 
-                     This  is available in Postfix 2.2 and later.
+                     This is available in Postfix 2.2 and  later.
 
               <b>${sasl_sender</b>}
-                     This macro expands to the SASL  sender  name
-                     (i.e.  the  original  submitter  as  per <a href="http://tools.ietf.org/html/rfc4954">RFC</a>
-                     <a href="http://tools.ietf.org/html/rfc4954">4954</a>) used during the reception of the  mes-
+                     This  macro  expands to the SASL sender name
+                     (i.e. the  original  submitter  as  per  <a href="http://tools.ietf.org/html/rfc4954">RFC</a>
+                     <a href="http://tools.ietf.org/html/rfc4954">4954</a>)  used during the reception of the mes-
                      sage.
 
-                     This  is available in Postfix 2.2 and later.
+                     This is available in Postfix 2.2 and  later.
 
               <b>${sasl_username</b>}
-                     This macro expands to  the  SASL  user  name
+                     This  macro  expands  to  the SASL user name
                      used during the reception of the message. An
-                     empty string is passed if  the  message  has
+                     empty  string  is  passed if the message has
                      been received without SASL authentication.
 
-                     This  is available in Postfix 2.2 and later.
+                     This is available in Postfix 2.2 and  later.
 
               <b>${sender</b>}
-                     This macro expands to  the  envelope  sender
+                     This  macro  expands  to the envelope sender
                      address. By default, the null sender address
-                     expands  to  MAILER-DAEMON;  this   can   be
-                     changed  with  the <b>null_sender</b> attribute, as
+                     expands   to   MAILER-DAEMON;  this  can  be
+                     changed with the <b>null_sender</b>  attribute,  as
                      described above.
 
-                     This information is modified by the  <b>q</b>  flag
+                     This  information  is modified by the <b>q</b> flag
                      for quoting.
 
               <b>${size</b>}
-                     This  macro expands to Postfix's idea of the
-                     message size, which is an  approximation  of
+                     This macro expands to Postfix's idea of  the
+                     message  size,  which is an approximation of
                      the size of the message as delivered.
 
               <b>${user</b>}
                      This macro expands to the username part of a
-                     recipient address.   For  example,  with  an
+                     recipient  address.   For  example,  with an
                      address <i>user+foo@domain</i> the username part is
                      <i>user</i>.
 
-                     A  command-line   argument   that   contains
-                     <b>${user</b>}  expands  into  as many command-line
+                     A   command-line   argument   that  contains
+                     <b>${user</b>} expands into  as  many  command-line
                      arguments as there are recipients.
 
-                     This information is modified by the  <b>u</b>  flag
+                     This  information  is modified by the <b>u</b> flag
                      for case folding.
 
 <b>STANDARDS</b>
        <a href="http://tools.ietf.org/html/rfc3463">RFC 3463</a> (Enhanced status codes)
 
 <b>DIAGNOSTICS</b>
-       Command  exit status codes are expected to follow the con-
-       ventions defined in &lt;<b>sysexits.h</b>&gt;.   Exit  status  0  means
+       Command exit status codes are expected to follow the  con-
+       ventions  defined  in  &lt;<b>sysexits.h</b>&gt;.   Exit status 0 means
        normal successful completion.
 
-       Postfix  version  2.3  and  later  support  <a href="http://tools.ietf.org/html/rfc3463">RFC 3463</a>-style
-       enhanced status codes.  If a  command  terminates  with  a
-       non-zero  exit  status, and the command output begins with
+       Postfix version  2.3  and  later  support  <a href="http://tools.ietf.org/html/rfc3463">RFC  3463</a>-style
+       enhanced  status  codes.   If  a command terminates with a
+       non-zero exit status, and the command output  begins  with
        an enhanced status code, this status code takes precedence
        over the non-zero exit status.
 
-       Problems  and transactions are logged to <b>syslogd</b>(8).  Cor-
-       rupted message files are marked so that the queue  manager
+       Problems and transactions are logged to <b>syslogd</b>(8).   Cor-
+       rupted  message files are marked so that the queue manager
        can move them to the <b>corrupt</b> queue for further inspection.
 
 <b>SECURITY</b>
-       This program needs a dual personality  1)  to  access  the
-       private  Postfix  queue and IPC mechanisms, and 2) to exe-
+       This  program  needs  a  dual personality 1) to access the
+       private Postfix queue and IPC mechanisms, and 2)  to  exe-
        cute external commands as the specified user. It is there-
        fore security sensitive.
 
 <b>CONFIGURATION PARAMETERS</b>
-       Changes  to <a href="postconf.5.html"><b>main.cf</b></a> are picked up automatically as <a href="pipe.8.html"><b>pipe</b>(8)</a>
-       processes run for only a limited amount of time.  Use  the
+       Changes to <a href="postconf.5.html"><b>main.cf</b></a> are picked up automatically as  <a href="pipe.8.html"><b>pipe</b>(8)</a>
+       processes  run  for only a limited amount of time. Use the
        command "<b>postfix reload</b>" to speed up a change.
 
-       The  text  below  provides  only  a parameter summary. See
+       The text below provides  only  a  parameter  summary.  See
        <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including examples.
 
 <b>RESOURCE AND RATE CONTROLS</b>
-       In the text below, <i>transport</i> is the first field in a  <b>mas-</b>
+       In  the text below, <i>transport</i> is the first field in a <b>mas-</b>
        <b>ter.cf</b> entry.
 
        <i>transport</i><b>_destination_concurrency_limit ($<a href="postconf.5.html#default_destination_concurrency_limit">default_destina</a>-</b>
        <b><a href="postconf.5.html#default_destination_concurrency_limit">tion_concurrency_limit</a>)</b>
               Limit the number of parallel deliveries to the same
-              destination, for delivery via the named  <i>transport</i>.
+              destination,  for delivery via the named <i>transport</i>.
               The limit is enforced by the Postfix queue manager.
 
        <i>transport</i><b>_destination_recipient_limit   ($<a href="postconf.5.html#default_destination_recipient_limit">default_destina</a>-</b>
        <b><a href="postconf.5.html#default_destination_recipient_limit">tion_recipient_limit</a>)</b>
-              Limit the number of recipients per  message  deliv-
-              ery,  for  delivery  via  the named <i>transport</i>.  The
+              Limit  the  number of recipients per message deliv-
+              ery, for delivery via  the  named  <i>transport</i>.   The
               limit is enforced by the Postfix queue manager.
 
        <i>transport</i><b>_time_limit ($<a href="postconf.5.html#command_time_limit">command_time_limit</a>)</b>
-              Limit the time for delivery  to  external  command,
+              Limit  the  time  for delivery to external command,
               for delivery via the named <i>transport</i>.  The limit is
               enforced by the pipe delivery agent.
 
-              Postfix 2.4 and later support a suffix that  speci-
-              fies  the  time  unit:  s (seconds), m (minutes), h
+              Postfix  2.4 and later support a suffix that speci-
+              fies the time unit: s  (seconds),  m  (minutes),  h
               (hours), d (days), w (weeks). The default time unit
               is seconds.
 
 <b>MISCELLANEOUS CONTROLS</b>
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The  default  location  of  the Postfix <a href="postconf.5.html">main.cf</a> and
+              The default location of  the  Postfix  <a href="postconf.5.html">main.cf</a>  and
               <a href="master.5.html">master.cf</a> configuration files.
 
        <b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
-              How much time a Postfix daemon process may take  to
-              handle  a  request  before  it  is  terminated by a
+              How  much time a Postfix daemon process may take to
+              handle a request  before  it  is  terminated  by  a
               built-in watchdog timer.
 
        <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
+              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>
@@ -435,25 +437,25 @@ PIPE(8)                                                                PIPE(8)
               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  an incoming connection
+              The  maximum  amount  of  time that an idle Postfix
+              daemon process waits  for  an  incoming  connection
               before terminating voluntarily.
 
        <b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
-              The maximal number of incoming connections  that  a
-              Postfix  daemon  process will service before termi-
+              The  maximal  number of incoming connections that a
+              Postfix daemon process will service  before  termi-
               nating voluntarily.
 
        <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>
@@ -464,8 +466,8 @@ PIPE(8)                                                                PIPE(8)
               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>
@@ -477,7 +479,7 @@ PIPE(8)                                                                PIPE(8)
        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>
index 370491807d79162255767a33bc80b8363dac35cf..8f4fa8535f83da5b8fb2880b078daaf293549529 100644 (file)
@@ -115,6 +115,8 @@ Indicate that the external command performs final delivery.
 This flag affects the status reported in "success" DSN
 (delivery status notification) messages, and changes it
 from "relayed" into "delivered".
+.sp
+This feature is available as of Postfix 2.5.
 .IP \fBh\fR
 Fold the command-line \fB$recipient\fR address domain part
 (text to the right of the right-most \fB@\fR character) to
index 193f17bd4d7320d21522ba5b7ad77f53cb6bd840..19fd0c0c9152846e6c096e51dde67683fb8c1325 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20070824"
+#define MAIL_RELEASE_DATE      "20070911"
 #define MAIL_VERSION_NUMBER    "2.5"
 
 #ifdef SNAPSHOT
index d8230c1b769b822fc38414cfe74d7c10d4d391ad..15a54777758e96a6ff12eddc9afb84595da9ad9c 100644 (file)
@@ -130,6 +130,7 @@ master_ent.o: ../../include/host_port.h
 master_ent.o: ../../include/inet_addr_host.h
 master_ent.o: ../../include/inet_addr_list.h
 master_ent.o: ../../include/iostuff.h
+master_ent.o: ../../include/mail_conf.h
 master_ent.o: ../../include/mail_params.h
 master_ent.o: ../../include/mail_proto.h
 master_ent.o: ../../include/msg.h
@@ -189,6 +190,7 @@ master_sig.o: master_sig.c
 master_spawn.o: ../../include/argv.h
 master_spawn.o: ../../include/binhash.h
 master_spawn.o: ../../include/events.h
+master_spawn.o: ../../include/mail_conf.h
 master_spawn.o: ../../include/msg.h
 master_spawn.o: ../../include/mymalloc.h
 master_spawn.o: ../../include/sys_defs.h
index 8470a189dc09363ac36f15c7952a1d5bbf13181c..0ed354d284f6e0677c61463deecb6b4a79f72e03 100644 (file)
@@ -47,6 +47,8 @@ typedef struct MASTER_SERV {
     int     max_proc;                  /* upper bound on # processes */
     char   *path;                      /* command pathname */
     struct ARGV *args;                 /* argument vector */
+    char   *stress_param_val;          /* stress value: "yes" or empty */
+    time_t  stress_expire_time;                /* stress pulse stretcher */
     int     avail_proc;                        /* idle processes */
     int     total_proc;                        /* number of processes */
     int     throttle_delay;            /* failure recovery parameter */
index b697d92407020cefffb7db2db22a8b21510b3b57..6008ca19f3f395050ae23362a1cefad20158fd40 100644 (file)
 /*     available process, or this module causes a new process to be
 /*     created to service the request.
 /*
+/*     When the service runs out of process slots, a warning is logged.
+/*     When the service is eligible for stress-mode operation, servers
+/*     are restarted and new servers are created with stress mode enabled.
+/*
 /*     master_avail_listen() ensures that someone monitors the service's
 /*     listen socket for connection requests (as long as resources
 /*     to handle connection requests are available).  This function may
@@ -76,6 +80,7 @@
 static void master_avail_event(int event, char *context)
 {
     MASTER_SERV *serv = (MASTER_SERV *) context;
+    time_t  now;
     int     n;
 
     if (event == 0)                            /* XXX Can this happen? */
@@ -84,6 +89,30 @@ static void master_avail_event(int event, char *context)
        for (n = 0; n < serv->listen_fd_count; n++)
            event_disable_readwrite(serv->listen_fd[n]);
     } else {
+
+       /*
+        * When all servers for a public internet service are busy, we start
+        * creating server processes with "-o stress=yes" on the command
+        * line, and keep creating such processes until the process count is
+        * below the limit for at least 1000 seconds. This provides a minimal
+        * solution that can be adopted into legacy and stable Postfix
+        * releases.
+        * 
+        * This is not the right place to update serv->stress_param_val in
+        * response to stress level changes. Doing so would would contaminate
+        * the "postfix reload" code with stress management implementation
+        * details, creating a source of future bugs. Instead, we update
+        * simple counters or flags here, and use their values to determine
+        * the proper serv->stress_param_val value when exec-ing a server
+        * process.
+        */
+       if (serv->stress_param_val != 0
+           && !MASTER_LIMIT_OK(serv->max_proc, serv->total_proc + 1)) {
+           now = event_time();
+           if (serv->stress_expire_time < now)
+               master_restart_service(serv);
+           serv->stress_expire_time = now + 1000;
+       }
        master_spawn(serv);
     }
 }
@@ -120,6 +149,9 @@ void    master_avail_listen(MASTER_SERV *serv)
                     serv->ext_name, serv->name, serv->max_proc);
            msg_warn("to avoid this condition, increase the process count "
                     "in master.cf or reduce the service time per client");
+           if (serv->stress_param_val)
+               msg_warn("see http://www.postfix.org/STRESS_README.html for "
+                     "examples of stress-adapting configuration settings");
        }
     }
 }
index 55ab4e92964264ead55951410781f78528882567..98f7f73d37494e2ca67a6540051baf06afc14fb5 100644 (file)
@@ -134,6 +134,7 @@ void    master_config(void)
            SWAP(char *, serv->ext_name, entry->ext_name);
            SWAP(char *, serv->path, entry->path);
            SWAP(ARGV *, serv->args, entry->args);
+           SWAP(char *, serv->stress_param_val, entry->stress_param_val);
            master_restart_service(serv);
            free_master_ent(entry);
        }
index 82db2f0c93a5d343a238e08371f92029ea2ba17c..5eb60f54574a7f098d51b09d8db3e970260d1224 100644 (file)
@@ -94,6 +94,7 @@
 #include <mail_params.h>
 #include <own_inet_addr.h>
 #include <wildcard_inet_addr.h>
+#include <mail_conf.h>
 
 /* Local stuff. */
 
@@ -511,6 +512,14 @@ MASTER_SERV *get_master_ent()
        argv_add(serv->args, "-u", (char *) 0);
     if (chroot)
        argv_add(serv->args, "-c", (char *) 0);
+    if ((serv->flags & MASTER_FLAG_LOCAL_ONLY) == 0) {
+       argv_add(serv->args, "-o", "stress=" CONFIG_BOOL_YES, (char *) 0);
+       serv->stress_param_val =
+           serv->args->argv[serv->args->argc - 1] + sizeof("stress=") - 1;
+       serv->stress_param_val[0] = 0;
+    } else
+       serv->stress_param_val = 0;
+    serv->stress_expire_time = 0;
     if (serv->listen_fd_count > 1)
        argv_add(serv->args, "-s",
            vstring_str(vstring_sprintf(junk, "%d", serv->listen_fd_count)),
index 672a9ba2a1b136aaa30cc485f1feada298f6b3c2..fadf90f2e2c0a3f903f8212acea41c634496e270 100644 (file)
 #include <vstring.h>
 #include <argv.h>
 
+/* Global library. */
+
+#include <mail_conf.h>
+
 /* Application-specific. */
 
 #include "master_proto.h"
@@ -177,6 +181,10 @@ void    master_spawn(MASTER_SERV *serv)
         * connection and run the requested command. Leave child stderr
         * alone. Disable exit handlers: they should be executed by the
         * parent only.
+        * 
+        * When we reach the process limit on a public internet service, we
+        * create stress-mode processes until the process count stays below
+        * the limit for some amount of time. See master_avail_listen().
         */
     case 0:
        msg_cleanup((void (*) (void)) 0);       /* disable exit handler */
@@ -216,6 +224,8 @@ void    master_spawn(MASTER_SERV *serv)
        vstring_sprintf(env_gen, "%s=%o", MASTER_GEN_NAME, master_generation);
        if (putenv(vstring_str(env_gen)) < 0)
            msg_fatal("%s: putenv: %m", myname);
+       if (serv->stress_param_val && serv->stress_expire_time > event_time())
+           serv->stress_param_val[0] = CONFIG_BOOL_YES[0];
 
        execvp(serv->path, serv->args->argv);
        msg_fatal("%s: exec %s: %m", myname, serv->path);
index 1e87b7948a9c019d783fb9ece7b6571f0b1ca8ee..07696f50c37e69d5c3ac73cb328330e7e4a79ae7 100644 (file)
 /*     This flag affects the status reported in "success" DSN
 /*     (delivery status notification) messages, and changes it
 /*     from "relayed" into "delivered".
+/* .sp
+/*     This feature is available as of Postfix 2.5.
 /* .IP \fBh\fR
 /*     Fold the command-line \fB$recipient\fR address domain part
 /*     (text to the right of the right-most \fB@\fR character) to
index 6089f093fe7b8d9f9804e988d7c0f503e71d596b..870c168b55c85dd9ef6ce1ea5ab8ee0795495396 100644 (file)
@@ -901,7 +901,8 @@ static void smtp_connect_remote(SMTP_STATE *state, const char *nexthop,
                }
                smtp_cleanup_session(state);
            } else {
-               msg_info("%s (port %d)", STR(why->reason), ntohs(port));
+               /* The reason already includes the IP address and TCP port. */
+               msg_info("%s", STR(why->reason));
            }
            /* Insert: test if we must skip the remaining MX hosts. */
        }
index 6a3e143517143813a8744bbf41a1c34cfb9525e2..ec9d7a9115267f970c1c544bfc5cad10d7fb9646 100644 (file)
@@ -3328,7 +3328,7 @@ static int check_policy_service(SMTPD_STATE *state, const char *server,
            coded_CN_buf = 0; \
            coded_CN = ""; \
        } else { \
-           coded_CN_buf = vstring_alloc(strlen(CN)); \
+           coded_CN_buf = vstring_alloc(strlen(CN) + 1); \
            xtext_quote(coded_CN_buf, CN, ""); \
            coded_CN = STR(coded_CN_buf); \
        } \