]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.0.16 v2.0.16
authorWietse Venema <wietse@porcupine.org>
Sat, 13 Sep 2003 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 15:51:49 +0000 (15:51 +0000)
33 files changed:
postfix/HISTORY
postfix/conf/pcre_table
postfix/html/pcre_table.5.html
postfix/html/smtpd.8.html
postfix/man/man5/pcre_table.5
postfix/man/man8/smtpd.8
postfix/proto/pcre_table
postfix/src/bounce/Makefile.in
postfix/src/global/mail_version.h
postfix/src/lmtp/Makefile.in
postfix/src/lmtp/lmtp.c
postfix/src/lmtp/lmtp.h
postfix/src/lmtp/lmtp_connect.c
postfix/src/lmtp/lmtp_proto.c
postfix/src/lmtp/lmtp_sasl_glue.c
postfix/src/lmtp/lmtp_state.c
postfix/src/smtp/Makefile.in
postfix/src/smtp/smtp_connect.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpstone/Makefile.in
postfix/src/smtpstone/qmqp-source.c
postfix/src/smtpstone/smtp-sink.c
postfix/src/smtpstone/smtp-source.c
postfix/src/util/Makefile.in
postfix/src/util/inet_connect.c
postfix/src/util/inet_listen.c
postfix/src/util/msg_syslog.c
postfix/src/util/sane_accept.c
postfix/src/util/sane_connect.c [new file with mode: 0644]
postfix/src/util/sane_connect.h [new file with mode: 0644]
postfix/src/util/sys_defs.h
postfix/src/util/timed_connect.c
postfix/src/util/unix_connect.c

index 87eef918a79b8ac303d95ab568bc6992788125a0..80eaa0dca3376303cd912645509c6098402cd8ec 100644 (file)
@@ -7872,6 +7872,33 @@ Apologies for any names omitted.
        util/timed_read.c and as precautionary measure,
        util/timed_write.c.
 
+20030908
+
+       The 20030905 workaround triggers too many warnings. TCP
+       sockets are back to blocking, and keepalives are turned on
+       to kill off dead sockets, as suggested by Leandro Santi.
+       Files: master/{single,multi}_server.c, smtpd/smtpd.c,
+       util/sys_defs.h.
+
+20030909
+
+       Bugfix: the LMTP session caching code had problems with
+       SASL authentication after the first connection, and pipelining
+       was working poorly.  Fix by Viktor Dukhovni, Morgan Stanley.
+       Files: lmtp/lmtp.c, lmtp/lmtp_proto.c.
+
+20030912
+
+       Workaround: besides SMTP server sockets, SMTP client sockets
+       can also hang on Solaris, as reported by Leandro Santi. In
+       order to deal with this at the root, all connection management
+       is now done by sane_accept() and sane_connect().  Both turn
+       on keepalives on Solaris.
+
+20030913
+
+       Safety: set-gid commands don't trust TZ.  File: msg_syslog.c.
+
 Open problems:
 
        Doc: mention the proxy_interfaces parameter everywhere the
index 0bb6b453cf4c44419cb7250880862956ed860fc2..e4f73f00bb6b48d6b3f29c8caa16c57124424710 100644 (file)
 # 
 #        if /pattern/flags
 # 
-#        if !/pattern/flags
-# 
 #        endif  Match   the  search  string  against  the  patterns
 #               between if and endif, if and  only  if  the  search
-#               string   matches  (does  not  match)  pattern.  The
-#               if..endif can nest.
+#               string matches pattern. The if..endif can nest.
 # 
-#               Note: do not prepend whitespace to patterns  inside
+#               Note:  do not prepend whitespace to patterns inside
 #               if..endif.
 # 
 #        Each  pattern  is  a  perl-like  regular  expression.  The
-#        expression delimiter can be any character, except  whites-
-#        pace  or  characters that have special meaning (tradition-
-#        ally the forward slash is used).  The  regular  expression
+#        expression  delimiter can be any character, except whites-
+#        pace or characters that have special  meaning  (tradition-
+#        ally  the  forward slash is used).  The regular expression
 #        can contain whitespace.
 # 
 #        By default, matching is case-insensitive, and newlines are
-#        not treated as special characters. The  behavior  is  con-
-#        trolled  by  flags,  which are toggled by appending one or
+#        not  treated  as  special characters. The behavior is con-
+#        trolled by flags, which are toggled by  appending  one  or
 #        more of the following characters after the pattern:
 # 
 #        i (default: on)
-#               Toggles the  case  sensitivity  flag.  By  default,
+#               Toggles  the  case  sensitivity  flag.  By default,
 #               matching is case insensitive.
 # 
 #        m (default: off)
-#               Toggles  the PCRE_MULTILINE flag. When this flag is
-#               on, the ^ and $  metacharacters  match  immediately
-#               after  and  immediately before a newline character,
-#               respectively, in addition to matching at the  start
+#               Toggles the PCRE_MULTILINE flag. When this flag  is
+#               on,  the  ^  and $ metacharacters match immediately
+#               after and immediately before a  newline  character,
+#               respectively,  in addition to matching at the start
 #               and end of the subject string.
 # 
 #        s (default: on)
 #               Toggles the PCRE_DOTALL flag. When this flag is on,
 #               the .  metacharacter matches the newline character.
-#               With  Postfix  versions prior to 20020528, The flag
+#               With Postfix versions prior to 20020528,  The  flag
 #               is off by default, which is inconvenient for multi-
 #               line message header matching.
 # 
 #        x (default: off)
-#               Toggles  the  pcre extended flag. When this flag is
-#               on, whitespace in the  pattern  (other  than  in  a
+#               Toggles the pcre extended flag. When this  flag  is
+#               on,  whitespace  in  the  pattern  (other than in a
 #               character class) and characters between a # outside
-#               a character class and the  next  newline  character
-#               are  ignored.  An escaping backslash can be used to
-#               include a whitespace or # character as part of  the
+#               a  character  class  and the next newline character
+#               are ignored. An escaping backslash can be  used  to
+#               include  a whitespace or # character as part of the
 #               pattern.
 # 
 #        A (default: off)
-#               Toggles  the PCRE_ANCHORED flag.  When this flag is
-#               on, the pattern is forced to  be  "anchored",  that
+#               Toggles the PCRE_ANCHORED flag.  When this flag  is
+#               on,  the  pattern  is forced to be "anchored", that
 #               is, it is constrained to match only at the start of
-#               the string which is being  searched  (the  "subject
-#               string").  This  effect  can  also  be  achieved by
+#               the  string  which  is being searched (the "subject
+#               string"). This  effect  can  also  be  achieved  by
 #               appropriate constructs in the pattern itself.
 # 
 #        E (default: off)
-#               Toggles the  PCRE_DOLLAR_ENDONLY  flag.  When  this
-#               flag  is  on,  a  $  metacharacter  in  the pattern
-#               matches only at the  end  of  the  subject  string.
-#               Without  this  flag,  a dollar also matches immedi-
+#               Toggles  the  PCRE_DOLLAR_ENDONLY  flag.  When this
+#               flag is  on,  a  $  metacharacter  in  the  pattern
+#               matches  only  at  the  end  of the subject string.
+#               Without this flag, a dollar  also  matches  immedi-
 #               ately before the final character if it is a newline
 #               character (but not before any other newline charac-
-#               ters). This flag is ignored if PCRE_MULTILINE  flag
+#               ters).  This flag is ignored if PCRE_MULTILINE flag
 #               is set.
 # 
 #        U (default: off)
 #               Toggles the ungreedy matching flag.  When this flag
-#               is on, the  pattern  matching  engine  inverts  the
-#               "greediness"  of  the  quantifiers so that they are
-#               not greedy by default, but become  greedy  if  fol-
-#               lowed  by  "?".   This  flag can also set by a (?U)
+#               is  on,  the  pattern  matching  engine inverts the
+#               "greediness" of the quantifiers so  that  they  are
+#               not  greedy  by  default, but become greedy if fol-
+#               lowed by "?".  This flag can also  set  by  a  (?U)
 #               modifier within the pattern.
 # 
 #        X (default: off)
 #               Toggles the PCRE_EXTRA flag.  When this flag is on,
-#               any  backslash  in  a pattern that is followed by a
+#               any backslash in a pattern that is  followed  by  a
 #               letter that has no special meaning causes an error,
 #               thus reserving these combinations for future expan-
 #               sion.
 # 
-#        Each pattern is applied to the entire lookup  key  string.
-#        Depending  on  the  application,  that string is an entire
+#        Each  pattern  is applied to the entire lookup key string.
+#        Depending on the application, that  string  is  an  entire
 #        client hostname, an entire client IP address, or an entire
-#        mail  address.   Thus,  no parent domain or parent network
-#        search is done, and user@domain  mail  addresses  are  not
-#        broken  up  into  their user and domain constituent parts,
+#        mail address.  Thus, no parent domain  or  parent  network
+#        search  is  done,  and  user@domain mail addresses are not
+#        broken up into their user and  domain  constituent  parts,
 #        nor is user+foo broken up into user and foo.
 # 
-#        Patterns are applied in the  order  as  specified  in  the
-#        table,  until  a  pattern is found that matches the search
+#        Patterns  are  applied  in  the  order as specified in the
+#        table, until a pattern is found that  matches  the  search
 #        string.
 # 
-#        Substitution of substrings  from  the  matched  expression
-#        into  the result string is possible using the conventional
-#        perl syntax ($1, $2, etc.).   The  macros  in  the  result
-#        string  may  need  to  be  written as ${n} or $(n) if they
+#        Substitution  of  substrings  from  the matched expression
+#        into the result string is possible using the  conventional
+#        perl  syntax  ($1,  $2,  etc.).   The macros in the result
+#        string may need to be written as  ${n}  or  $(n)  if  they
 #        aren't followed by whitespace.
 # 
 # EXAMPLE SMTPD ACCESS MAP
index 1fd38bc1ea965a67396d92714a30f4a91e6992e8..4510145fe7b46c2717cbfaf999039da38666485e 100644 (file)
@@ -41,103 +41,100 @@ PCRE_TABLE(5)                                       PCRE_TABLE(5)
 
        <b>if</b> <b>/</b><i>pattern</i><b>/</b><i>flags</i>
 
-       <b>if</b> <b>!/</b><i>pattern</i><b>/</b><i>flags</i>
-
        <b>endif</b>  Match   the  search  string  against  the  patterns
               between <b>if</b> and <b>endif</b>, if and  only  if  the  search
-              string   matches  (does  not  match)  <i>pattern</i>.  The
-              <b>if</b>..<b>endif</b> can nest.
+              string matches <i>pattern</i>. The <b>if</b>..<b>endif</b> can nest.
 
-              Note: do not prepend whitespace to patterns  inside
+              Note:  do not prepend whitespace to patterns inside
               <b>if</b>..<b>endif</b>.
 
        Each  pattern  is  a  perl-like  regular  expression.  The
-       expression delimiter can be any character, except  whites-
-       pace  or  characters that have special meaning (tradition-
-       ally the forward slash is used).  The  regular  expression
+       expression  delimiter can be any character, except whites-
+       pace or characters that have special  meaning  (tradition-
+       ally  the  forward slash is used).  The regular expression
        can contain whitespace.
 
        By default, matching is case-insensitive, and newlines are
-       not treated as special characters. The  behavior  is  con-
-       trolled  by  flags,  which are toggled by appending one or
+       not  treated  as  special characters. The behavior is con-
+       trolled by flags, which are toggled by  appending  one  or
        more of the following characters after the pattern:
 
        <b>i</b> (default: on)
-              Toggles the  case  sensitivity  flag.  By  default,
+              Toggles  the  case  sensitivity  flag.  By default,
               matching is case insensitive.
 
        <b>m</b> (default: off)
-              Toggles  the PCRE_MULTILINE flag. When this flag is
-              on, the <b>^</b> and <b>$</b>  metacharacters  match  immediately
-              after  and  immediately before a newline character,
-              respectively, in addition to matching at the  start
+              Toggles the PCRE_MULTILINE flag. When this flag  is
+              on,  the  <b>^</b>  and <b>$</b> metacharacters match immediately
+              after and immediately before a  newline  character,
+              respectively,  in addition to matching at the start
               and end of the subject string.
 
        <b>s</b> (default: on)
               Toggles the PCRE_DOTALL flag. When this flag is on,
               the <b>.</b>  metacharacter matches the newline character.
-              With  Postfix  versions prior to 20020528, The flag
+              With Postfix versions prior to 20020528,  The  flag
               is off by default, which is inconvenient for multi-
               line message header matching.
 
        <b>x</b> (default: off)
-              Toggles  the  pcre extended flag. When this flag is
-              on, whitespace in the  pattern  (other  than  in  a
+              Toggles the pcre extended flag. When this  flag  is
+              on,  whitespace  in  the  pattern  (other than in a
               character class) and characters between a <b>#</b> outside
-              a character class and the  next  newline  character
-              are  ignored.  An escaping backslash can be used to
-              include a whitespace or <b>#</b> character as part of  the
+              a  character  class  and the next newline character
+              are ignored. An escaping backslash can be  used  to
+              include  a whitespace or <b>#</b> character as part of the
               pattern.
 
        <b>A</b> (default: off)
-              Toggles  the PCRE_ANCHORED flag.  When this flag is
-              on, the pattern is forced to  be  "anchored",  that
+              Toggles the PCRE_ANCHORED flag.  When this flag  is
+              on,  the  pattern  is forced to be "anchored", that
               is, it is constrained to match only at the start of
-              the string which is being  searched  (the  "subject
-              string").  This  effect  can  also  be  achieved by
+              the  string  which  is being searched (the "subject
+              string"). This  effect  can  also  be  achieved  by
               appropriate constructs in the pattern itself.
 
        <b>E</b> (default: off)
-              Toggles the  PCRE_DOLLAR_ENDONLY  flag.  When  this
-              flag  is  on,  a  <b>$</b>  metacharacter  in  the pattern
-              matches only at the  end  of  the  subject  string.
-              Without  this  flag,  a dollar also matches immedi-
+              Toggles  the  PCRE_DOLLAR_ENDONLY  flag.  When this
+              flag is  on,  a  <b>$</b>  metacharacter  in  the  pattern
+              matches  only  at  the  end  of the subject string.
+              Without this flag, a dollar  also  matches  immedi-
               ately before the final character if it is a newline
               character (but not before any other newline charac-
-              ters). This flag is ignored if PCRE_MULTILINE  flag
+              ters).  This flag is ignored if PCRE_MULTILINE flag
               is set.
 
        <b>U</b> (default: off)
               Toggles the ungreedy matching flag.  When this flag
-              is on, the  pattern  matching  engine  inverts  the
-              "greediness"  of  the  quantifiers so that they are
-              not greedy by default, but become  greedy  if  fol-
-              lowed  by  "?".   This  flag can also set by a (?U)
+              is  on,  the  pattern  matching  engine inverts the
+              "greediness" of the quantifiers so  that  they  are
+              not  greedy  by  default, but become greedy if fol-
+              lowed by "?".  This flag can also  set  by  a  (?U)
               modifier within the pattern.
 
        <b>X</b> (default: off)
               Toggles the PCRE_EXTRA flag.  When this flag is on,
-              any  backslash  in  a pattern that is followed by a
+              any backslash in a pattern that is  followed  by  a
               letter that has no special meaning causes an error,
               thus reserving these combinations for future expan-
               sion.
 
-       Each pattern is applied to the entire lookup  key  string.
-       Depending  on  the  application,  that string is an entire
+       Each  pattern  is applied to the entire lookup key string.
+       Depending on the application, that  string  is  an  entire
        client hostname, an entire client IP address, or an entire
-       mail  address.   Thus,  no parent domain or parent network
-       search is done, and <i>user@domain</i>  mail  addresses  are  not
-       broken  up  into  their <i>user</i> and <i>domain</i> constituent parts,
+       mail address.  Thus, no parent domain  or  parent  network
+       search  is  done,  and  <i>user@domain</i> mail addresses are not
+       broken up into their <i>user</i> and  <i>domain</i>  constituent  parts,
        nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
 
-       Patterns are applied in the  order  as  specified  in  the
-       table,  until  a  pattern is found that matches the search
+       Patterns  are  applied  in  the  order as specified in the
+       table, until a pattern is found that  matches  the  search
        string.
 
-       Substitution of substrings  from  the  matched  expression
-       into  the result string is possible using the conventional
-       perl syntax ($1, $2, etc.).   The  macros  in  the  result
-       string  may  need  to  be  written as ${n} or $(n) if they
+       Substitution  of  substrings  from  the matched expression
+       into the result string is possible using the  conventional
+       perl  syntax  ($1,  $2,  etc.).   The macros in the result
+       string may need to be written as  ${n}  or  $(n)  if  they
        aren't followed by whitespace.
 
 <b>EXAMPLE</b> <b>SMTPD</b> <b>ACCESS</b> <b>MAP</b>
index 350f249424f44407897df78b44b95cf6dbdc8e6d..b58ce5aca92afbb9f7dcba7549c35551e715df77 100644 (file)
@@ -62,28 +62,29 @@ SMTPD(8)                                                 SMTPD(8)
               with comments that Sendmail allows.
 
        <b>broken</b><i>_</i><b>sasl</b><i>_</i><b>auth</b><i>_</i><b>clients</b>
-              Support older Microsoft clients that  mis-implement
-              the AUTH protocol, and that expect an EHLO response
-              of "250 AUTH=list" instead of "250 AUTH list".
+              Support Microsoft clients that implement  an  older
+              version  of  the  AUTH protocol, and that expect an
+              EHLO response of "250 AUTH=list"  instead  of  "250
+              AUTH list".
 
        <b>smtpd</b><i>_</i><b>noop</b><i>_</i><b>commands</b>
               List of commands that are treated as NOOP (no oper-
-              ation)   commands,  without  any  parameter  syntax
-              checking and without any state change.   This  list
+              ation)  commands,  without  any  parameter   syntax
+              checking  and  without any state change.  This list
               overrides built-in command definitions.
 
 <b>Content</b> <b>inspection</b> <b>controls</b>
        <b>content</b><i>_</i><b>filter</b>
-              The  name of a mail delivery transport that filters
+              The name of a mail delivery transport that  filters
               mail and that either bounces mail or re-injects the
-              result  back into Postfix.  This parameter uses the
-              same syntax as the right-hand  side  of  a  Postfix
+              result back into Postfix.  This parameter uses  the
+              same  syntax  as  the  right-hand side of a Postfix
               transport table.
 
 <b>Authentication</b> <b>controls</b>
-       <b>enable</b><i>_</i><b>sasl</b><i>_</i><b>authentication</b>
-              Enable  per-session  authentication as per <a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a>
-              (SASL).  This functionality is available only  when
+       <b>smtpd</b><i>_</i><b>sasl</b><i>_</i><b>auth</b><i>_</i><b>enable</b>
+              Enable per-session authentication as per  <a href="http://www.faqs.org/rfcs/rfc2554.html">RFC  2554</a>
+              (SASL).   This functionality is available only when
               explicitly  selected  at  program  build  time  and
               explicitly enabled at runtime.
 
@@ -109,14 +110,14 @@ SMTPD(8)                                                 SMTPD(8)
                      Disallow anonymous logins.
 
        <b>smtpd</b><i>_</i><b>sender</b><i>_</i><b>login</b><i>_</i><b>maps</b>
-              Maps that specify the SASL login name that  owns  a
-              MAIL    FROM    sender   address.   Used   by   the
+              Maps  that  specify the SASL login name that owns a
+              MAIL   FROM   sender   address.   Used    by    the
               <b>reject</b><i>_</i><b>sender</b><i>_</i><b>login</b><i>_</i><b>mismatch</b>  sender  anti-spoofing
               restriction.
 
 <b>Miscellaneous</b>
        <b>always</b><i>_</i><b>bcc</b>
-              Address  to send a copy of each message that enters
+              Address to send a copy of each message that  enters
               the system.
 
        <b>authorized</b><i>_</i><b>verp</b><i>_</i><b>clients</b>
@@ -124,23 +125,23 @@ SMTPD(8)                                                 SMTPD(8)
               that are authorized to use the XVERP extension.
 
        <b>debug</b><i>_</i><b>peer</b><i>_</i><b>level</b>
-              Increment  in  verbose  logging level when a remote
+              Increment in verbose logging level  when  a  remote
               host  matches  a  pattern  in  the  <b>debug</b><i>_</i><b>peer</b><i>_</i><b>list</b>
               parameter.
 
        <b>debug</b><i>_</i><b>peer</b><i>_</i><b>list</b>
-              List  of  domain or network patterns. When a remote
-              host matches a pattern, increase the  verbose  log-
-              ging   level   by   the  amount  specified  in  the
+              List of domain or network patterns. When  a  remote
+              host  matches  a pattern, increase the verbose log-
+              ging  level  by  the  amount   specified   in   the
               <b>debug</b><i>_</i><b>peer</b><i>_</i><b>level</b> parameter.
 
        <b>default</b><i>_</i><b>verp</b><i>_</i><b>delimiters</b>
               The default VERP delimiter characters that are used
-              when   the   XVERP  command  is  specified  without
+              when  the  XVERP  command  is   specified   without
               explicit delimiters.
 
        <b>error</b><i>_</i><b>notice</b><i>_</i><b>recipient</b>
-              Recipient   of    protocol/policy/resource/software
+              Recipient    of   protocol/policy/resource/software
               error notices.
 
        <b>hopcount</b><i>_</i><b>limit</b>
@@ -149,18 +150,18 @@ SMTPD(8)                                                 SMTPD(8)
        <b>notify</b><i>_</i><b>classes</b>
               List of error classes. Of special interest are:
 
-              <b>policy</b> When  a  client  violates any policy, mail a
+              <b>policy</b> When a client violates any  policy,  mail  a
                      transcript of the entire SMTP session to the
                      postmaster.
 
               <b>protocol</b>
-                     When  a client violates the SMTP protocol or
+                     When a client violates the SMTP protocol  or
                      issues  an  unimplemented  command,  mail  a
                      transcript of the entire SMTP session to the
                      postmaster.
 
        <b>smtpd</b><i>_</i><b>banner</b>
-              Text that follows the <b>220</b> status code in  the  SMTP
+              Text  that  follows the <b>220</b> status code in the SMTP
               greeting banner.
 
        <b>smtpd</b><i>_</i><b>expansion</b><i>_</i><b>filter</b>
@@ -168,57 +169,57 @@ SMTPD(8)                                                 SMTPD(8)
               expansion of rbl template responses and other text.
 
        <b>smtpd</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
-              Restrict  the  number  of  recipients that the SMTP
+              Restrict the number of  recipients  that  the  SMTP
               server accepts per message delivery.
 
        <b>smtpd</b><i>_</i><b>timeout</b>
-              Limit the time to send a  server  response  and  to
+              Limit  the  time  to  send a server response and to
               receive a client request.
 
        <b>soft</b><i>_</i><b>bounce</b>
-              Change  hard (5xx) reject responses into soft (4xx)
-              reject responses.  This can be useful  for  testing
+              Change hard (5xx) reject responses into soft  (4xx)
+              reject  responses.   This can be useful for testing
               purposes.
 
        <b>verp</b><i>_</i><b>delimiter</b><i>_</i><b>filter</b>
-              The  characters that Postfix accepts as VERP delim-
+              The characters that Postfix accepts as VERP  delim-
               iter characters.
 
 <b>Known</b> <b>versus</b> <b>unknown</b> <b>recipients</b>
        <b>show</b><i>_</i><b>user</b><i>_</i><b>unknown</b><i>_</i><b>table</b><i>_</i><b>name</b>
-              Whether or not to reveal  the  table  name  in  the
-              "User  unknown"  responses.  The extra detail makes
-              trouble shooting easier but also  reveals  informa-
+              Whether  or  not  to  reveal  the table name in the
+              "User unknown" responses. The  extra  detail  makes
+              trouble  shooting  easier but also reveals informa-
               tion that is nobody elses business.
 
        <b>unknown</b><i>_</i><b>local</b><i>_</i><b>recipient</b><i>_</i><b>reject</b><i>_</i><b>code</b>
               The response code when a client specifies a recipi-
-              ent  whose   domain   matches   <b>$mydestination</b>   or
+              ent   whose   domain   matches   <b>$mydestination</b>  or
               <b>$inet</b><i>_</i><b>interfaces</b>,  while  <b>$local</b><i>_</i><b>recipient</b><i>_</i><b>maps</b>  is
-              non-empty and does not list the  recipient  address
+              non-empty  and  does not list the recipient address
               or address local-part.
 
        <b>unknown</b><i>_</i><b>relay</b><i>_</i><b>recipient</b><i>_</i><b>reject</b><i>_</i><b>code</b>
               The response code when a client specifies a recipi-
               ent  whose  domain  matches  <b>$relay</b><i>_</i><b>domains</b>,  while
-              <b>$relay</b><i>_</i><b>recipient</b><i>_</i><b>maps</b>  is  non-empty  and  does not
+              <b>$relay</b><i>_</i><b>recipient</b><i>_</i><b>maps</b> is  non-empty  and  does  not
               list the recipient address.
 
        <b>unknown</b><i>_</i><b>virtual</b><i>_</i><b>alias</b><i>_</i><b>reject</b><i>_</i><b>code</b>
               The response code when a client specifies a recipi-
-              ent  whose  domain  matches <b>$virtual</b><i>_</i><b>alias</b><i>_</i><b>domains</b>,
-              while  the  recipient  is  not  listed   in   <b>$vir-</b>
+              ent whose  domain  matches  <b>$virtual</b><i>_</i><b>alias</b><i>_</i><b>domains</b>,
+              while   the   recipient  is  not  listed  in  <b>$vir-</b>
               <b>tual</b><i>_</i><b>alias</b><i>_</i><b>maps</b>.
 
        <b>unknown</b><i>_</i><b>virtual</b><i>_</i><b>mailbox</b><i>_</i><b>reject</b><i>_</i><b>code</b>
               The response code when a client specifies a recipi-
-              ent whose domain matches  <b>$virtual</b><i>_</i><b>mailbox</b><i>_</i><b>domains</b>,
+              ent  whose domain matches <b>$virtual</b><i>_</i><b>mailbox</b><i>_</i><b>domains</b>,
               while the recipient is not listed in <b>$virtual</b><i>_</i><b>mail-</b>
               <b>box</b><i>_</i><b>maps</b>.
 
 <b>Resource</b> <b>controls</b>
        <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>
-              Limit the amount of memory in bytes  used  for  the
+              Limit  the  amount  of memory in bytes used for the
               handling of partial input lines.
 
        <b>message</b><i>_</i><b>size</b><i>_</i><b>limit</b>
@@ -226,8 +227,8 @@ SMTPD(8)                                                 SMTPD(8)
               ing on-disk storage for envelope information.
 
        <b>queue</b><i>_</i><b>minfree</b>
-              Minimal amount of free space in bytes in the  queue
-              file  system for the SMTP server to accept any mail
+              Minimal  amount of free space in bytes in the queue
+              file system for the SMTP server to accept any  mail
               at all.
 
        <b>smtpd</b><i>_</i><b>history</b><i>_</i><b>flush</b><i>_</i><b>threshold</b>
@@ -242,23 +243,23 @@ SMTPD(8)                                                 SMTPD(8)
 
        <b>smtpd</b><i>_</i><b>soft</b><i>_</i><b>error</b><i>_</i><b>limit</b>
               When an SMTP client has made this number of errors,
-              wait <i>error_count</i> seconds before responding  to  any
+              wait  <i>error_count</i>  seconds before responding to any
               client request.
 
        <b>smtpd</b><i>_</i><b>hard</b><i>_</i><b>error</b><i>_</i><b>limit</b>
-              Disconnect  after  a client has made this number of
+              Disconnect after a client has made this  number  of
               errors.
 
        <b>smtpd</b><i>_</i><b>junk</b><i>_</i><b>command</b><i>_</i><b>limit</b>
               Limit the number of times a client can issue a junk
-              command  such  as  NOOP,  VRFY, ETRN or RSET in one
-              SMTP session before it  is  penalized  with  tarpit
+              command such as NOOP, VRFY, ETRN  or  RSET  in  one
+              SMTP  session  before  it  is penalized with tarpit
               delays.
 
 <b>UCE</b> <b>control</b> <b>restrictions</b>
        <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>
-              List  of  Postfix features that use <i>domain.tld</i> pat-
-              terns  to  match  <i>sub.domain.tld</i>  (as  opposed   to
+              List of Postfix features that use  <i>domain.tld</i>  pat-
+              terns   to  match  <i>sub.domain.tld</i>  (as  opposed  to
               requiring <i>.domain.tld</i> patterns).
 
        <b>smtpd</b><i>_</i><b>client</b><i>_</i><b>restrictions</b>
@@ -266,19 +267,19 @@ SMTPD(8)                                                 SMTPD(8)
               tem.
 
        <b>smtpd</b><i>_</i><b>helo</b><i>_</i><b>required</b>
-              Require that clients introduce  themselves  at  the
+              Require  that  clients  introduce themselves at the
               beginning of an SMTP session.
 
        <b>smtpd</b><i>_</i><b>helo</b><i>_</i><b>restrictions</b>
-              Restrict  what client hostnames are allowed in <b>HELO</b>
+              Restrict what client hostnames are allowed in  <b>HELO</b>
               and <b>EHLO</b> commands.
 
        <b>smtpd</b><i>_</i><b>sender</b><i>_</i><b>restrictions</b>
-              Restrict what sender addresses are allowed in  <b>MAIL</b>
+              Restrict  what sender addresses are allowed in <b>MAIL</b>
               <b>FROM</b> commands.
 
        <b>smtpd</b><i>_</i><b>recipient</b><i>_</i><b>restrictions</b>
-              Restrict  what  recipient  addresses are allowed in
+              Restrict what recipient addresses  are  allowed  in
               <b>RCPT</b> <b>TO</b> commands.
 
        <b>smtpd</b><i>_</i><b>etrn</b><i>_</i><b>restrictions</b>
@@ -286,73 +287,73 @@ SMTPD(8)                                                 SMTPD(8)
               mands, and what clients may issue <b>ETRN</b> commands.
 
        <b>smtpd</b><i>_</i><b>data</b><i>_</i><b>restrictions</b>
-              Restrictions  on  the  <b>DATA</b> command. Currently, the
-              only  restriction  that   makes   sense   here   is
+              Restrictions on the <b>DATA</b>  command.  Currently,  the
+              only   restriction   that   makes   sense  here  is
               <b>reject</b><i>_</i><b>unauth</b><i>_</i><b>pipelining</b>.
 
        <b>allow</b><i>_</i><b>untrusted</b><i>_</i><b>routing</b>
-              Allow  untrusted  clients to specify addresses with
-              sender-specified routing.  Enabling this  opens  up
-              nasty  relay  loopholes involving trusted backup MX
+              Allow untrusted clients to specify  addresses  with
+              sender-specified  routing.   Enabling this opens up
+              nasty relay loopholes involving trusted  backup  MX
               hosts.
 
        <b>smtpd</b><i>_</i><b>restriction</b><i>_</i><b>classes</b>
-              Declares the name of zero or more  parameters  that
-              contain  a  list  of UCE restrictions. The names of
-              these parameters can then be used  instead  of  the
+              Declares  the  name of zero or more parameters that
+              contain a list of UCE restrictions.  The  names  of
+              these  parameters  can  then be used instead of the
               restriction lists that they represent.
 
        <b>smtpd</b><i>_</i><b>null</b><i>_</i><b>access</b><i>_</i><b>lookup</b><i>_</i><b>key</b>
-              The  lookup  key  to be used in SMTPD access tables
-              instead of the null sender address. A  null  sender
+              The lookup key to be used in  SMTPD  access  tables
+              instead  of  the null sender address. A null sender
               address cannot be looked up.
 
        <b>maps</b><i>_</i><b>rbl</b><i>_</i><b>domains</b> (deprecated)
-              List  of  DNS domains that publish the addresses of
+              List of DNS domains that publish the  addresses  of
               blacklisted hosts. This is used with the deprecated
               <b>reject</b><i>_</i><b>maps</b><i>_</i><b>rbl</b> restriction.
 
        <b>permit</b><i>_</i><b>mx</b><i>_</i><b>backup</b><i>_</i><b>networks</b>
-              Only  domains  whose  primary  MX  hosts  match the
-              listed  networks  are   eligible   for   the   <b>per-</b>
+              Only domains  whose  primary  MX  hosts  match  the
+              listed   networks   are   eligible   for  the  <b>per-</b>
               <b>mit</b><i>_</i><b>mx</b><i>_</i><b>backup</b> feature.
 
        <b>relay</b><i>_</i><b>domains</b>
-              Restrict  what  domains this mail system will relay
-              mail to. The domains are  routed  to  the  delivery
+              Restrict what domains this mail system  will  relay
+              mail  to.  The  domains  are routed to the delivery
               agent specified with the <b>relay</b><i>_</i><b>transport</b> setting.
 
 <b>UCE</b> <b>control</b> <b>responses</b>
        <b>access</b><i>_</i><b>map</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Response  code  when  a  client  violates an access
+              Response code when  a  client  violates  an  access
               database restriction.
 
        <b>default</b><i>_</i><b>rbl</b><i>_</i><b>reply</b>
               Default template reply when a request is RBL black-
-              listed.   This template is used by the <b>reject</b><i>_</i><b>rbl</b><i>_</i><b>*</b>
-              and   <b>reject</b><i>_</i><b>rhsbl</b><i>_</i><b>*</b>   restrictions.   See    also:
+              listed.  This template is used by the  <b>reject</b><i>_</i><b>rbl</b><i>_</i><b>*</b>
+              and    <b>reject</b><i>_</i><b>rhsbl</b><i>_</i><b>*</b>   restrictions.   See   also:
               <b>rbl</b><i>_</i><b>reply</b><i>_</i><b>maps</b> and <b>smtpd</b><i>_</i><b>expansion</b><i>_</i><b>filter</b>.
 
        <b>defer</b><i>_</i><b>code</b>
-              Response  code when a client request is rejected by
+              Response code when a client request is rejected  by
               the <b>defer</b> restriction.
 
        <b>invalid</b><i>_</i><b>hostname</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Response  code   when   a   client   violates   the
+              Response   code   when   a   client   violates  the
               <b>reject</b><i>_</i><b>invalid</b><i>_</i><b>hostname</b> restriction.
 
        <b>maps</b><i>_</i><b>rbl</b><i>_</i><b>reject</b><i>_</i><b>code</b>
               Response code when a request is RBL blacklisted.
 
        <b>rbl</b><i>_</i><b>reply</b><i>_</i><b>maps</b>
-              Table  with  template responses for RBL blacklisted
-              requests, indexed by RBL domain  name.  These  tem-
+              Table with template responses for  RBL  blacklisted
+              requests,  indexed  by  RBL domain name. These tem-
               plates   are   used   by   the   <b>reject</b><i>_</i><b>rbl</b><i>_</i><b>*</b>   and
-              <b>reject</b><i>_</i><b>rhsbl</b><i>_</i><b>*</b>     restrictions.     See      also:
+              <b>reject</b><i>_</i><b>rhsbl</b><i>_</i><b>*</b>      restrictions.     See     also:
               <b>default</b><i>_</i><b>rbl</b><i>_</i><b>reply</b> and <b>smtpd</b><i>_</i><b>expansion</b><i>_</i><b>filter</b>.
 
        <b>reject</b><i>_</i><b>code</b>
-              Response  code  when  the  client  matches a <b>reject</b>
+              Response code when  the  client  matches  a  <b>reject</b>
               restriction.
 
        <b>relay</b><i>_</i><b>domains</b><i>_</i><b>reject</b><i>_</i><b>code</b>
@@ -360,7 +361,7 @@ SMTPD(8)                                                 SMTPD(8)
               mail relay policy.
 
        <b>unknown</b><i>_</i><b>address</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Response   code   when   a   client   violates  the
+              Response  code   when   a   client   violates   the
               <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>address</b> restriction.
 
        <b>unknown</b><i>_</i><b>client</b><i>_</i><b>reject</b><i>_</i><b>code</b>
@@ -369,7 +370,7 @@ SMTPD(8)                                                 SMTPD(8)
               tion.
 
        <b>unknown</b><i>_</i><b>hostname</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Response  code   when   a   client   violates   the
+              Response   code   when   a   client   violates  the
               <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>hostname</b> restriction.
 
 <b>SEE</b> <b>ALSO</b>
@@ -379,7 +380,7 @@ SMTPD(8)                                                 SMTPD(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 de4fde8aaa8e2bc76856ac57291c82854cfa8bce..83d44d96c59d6f381e0041cf17c0930ce62d75c7 100644 (file)
@@ -38,11 +38,10 @@ are lines whose first non-whitespace character is a `#'.
 A logical line starts with non-whitespace text. A line that
 starts with whitespace continues a logical line.
 .IP "\fBif /\fIpattern\fB/\fIflags\fR"
-.IP "\fBif !/\fIpattern\fB/\fIflags\fR"
 .IP "\fBendif\fR"
 Match the search string against the patterns between \fBif\fR
-and \fBendif\fR, if and only if the search string matches (does
-not match) \fIpattern\fR. The \fBif\fR..\fBendif\fR can nest.
+and \fBendif\fR, if and only if the search string matches
+\fIpattern\fR. The \fBif\fR..\fBendif\fR can nest.
 .sp
 Note: do not prepend whitespace to patterns inside
 \fBif\fR..\fBendif\fR.
index e15f7919c60e2d37366230a16195c834fc0e311d..f3aec5ca21471321293847f1cc45f6cd750f9b7c 100644 (file)
@@ -73,7 +73,7 @@ a configuration change.
 Disallow non-RFC 821 style addresses in SMTP commands. For example,
 the RFC822-style address forms with comments that Sendmail allows.
 .IP \fBbroken_sasl_auth_clients\fR
-Support older Microsoft clients that mis-implement the AUTH
+Support Microsoft clients that implement an older version of the AUTH
 protocol, and that expect an EHLO response of "250 AUTH=list"
 instead of "250 AUTH list".
 .IP \fBsmtpd_noop_commands\fR
@@ -87,7 +87,7 @@ either bounces mail or re-injects the result back into Postfix.
 This parameter uses the same syntax as the right-hand side of
 a Postfix transport table.
 .SH "Authentication controls"
-.IP \fBenable_sasl_authentication\fR
+.IP \fBsmtpd_sasl_auth_enable\fR
 Enable per-session authentication as per RFC 2554 (SASL).
 This functionality is available only when explicitly selected
 at program build time and explicitly enabled at runtime.
index 01a3b7b81673196f8b156696a0562e53924c0491..9120cd4a9e801279d458aa82bde553b0ff975fca 100644 (file)
 #      A logical line starts with non-whitespace text. A line that
 #      starts with whitespace continues a logical line.
 # .IP "\fBif /\fIpattern\fB/\fIflags\fR"
-# .IP "\fBif !/\fIpattern\fB/\fIflags\fR"
 # .IP "\fBendif\fR"
 #      Match the search string against the patterns between \fBif\fR
-#      and \fBendif\fR, if and only if the search string matches (does
-#      not match) \fIpattern\fR. The \fBif\fR..\fBendif\fR can nest.
+#      and \fBendif\fR, if and only if the search string matches
+#      \fIpattern\fR. The \fBif\fR..\fBendif\fR can nest.
 # .sp
 #      Note: do not prepend whitespace to patterns inside
 #      \fBif\fR..\fBendif\fR.
index bd8451ea556de88dad1449febdac0ae00e4645d5..e7439d01876e3652c916155034936942878ac84e 100644 (file)
@@ -126,6 +126,7 @@ bounce_notify_util.o: ../../include/vstring.h
 bounce_notify_util.o: ../../include/vbuf.h
 bounce_notify_util.o: ../../include/vstream.h
 bounce_notify_util.o: ../../include/line_wrap.h
+bounce_notify_util.o: ../../include/stringops.h
 bounce_notify_util.o: ../../include/mail_queue.h
 bounce_notify_util.o: ../../include/quote_822_local.h
 bounce_notify_util.o: ../../include/quote_flags.h
index e98fbe4b3c3ff0040b2418cf4edc2f2339e5326d..50982e690154c4976890b9ffd177bc175fe85791 100644 (file)
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only, unless they include the same bugfix as a patch release.
   */
-#define MAIL_RELEASE_DATE      "20030905"
+#define MAIL_RELEASE_DATE      "20030913"
 
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "2.0.15"
+#define DEF_MAIL_VERSION       "2.0.16"
 extern char *var_mail_version;
 
  /*
index 41303b3bc98bcaa1a33bdafacbc01207c508342e..4b86772e8ade2a21bf62f28eb8aa60b81cf1011c 100644 (file)
@@ -130,6 +130,7 @@ lmtp_connect.o: ../../include/iostuff.h
 lmtp_connect.o: ../../include/timed_connect.h
 lmtp_connect.o: ../../include/stringops.h
 lmtp_connect.o: ../../include/host_port.h
+lmtp_connect.o: ../../include/sane_connect.h
 lmtp_connect.o: ../../include/mail_params.h
 lmtp_connect.o: ../../include/mail_proto.h
 lmtp_connect.o: ../../include/attr.h
index c17cc2123b3a03ac0eb52bf2c0661779264cfc24..9b1198f7a8ce19ce33a4322fd0b351d49bda40d8 100644 (file)
@@ -337,6 +337,10 @@ static int deliver_message(DELIVER_REQUEST *request, char **unused_argv)
            lmtp_quit(state);
            lmtp_chat_reset(state);
            state->session = lmtp_session_free(state->session);
+#ifdef USE_SASL_AUTH
+           if (var_lmtp_sasl_enable)
+               lmtp_sasl_cleanup(state);
+#endif
        }
 
        /*
@@ -346,6 +350,10 @@ static int deliver_message(DELIVER_REQUEST *request, char **unused_argv)
        else if (lmtp_rset(state) != 0) {
            lmtp_chat_reset(state);
            state->session = lmtp_session_free(state->session);
+#ifdef USE_SASL_AUTH
+           if (var_lmtp_sasl_enable)
+               lmtp_sasl_cleanup(state);
+#endif
        }
 
        /*
@@ -380,6 +388,10 @@ static int deliver_message(DELIVER_REQUEST *request, char **unused_argv)
         */
        else if (lmtp_lhlo(state) != 0) {
            state->session = lmtp_session_free(state->session);
+#ifdef USE_SASL_AUTH
+           if (var_lmtp_sasl_enable)
+               lmtp_sasl_cleanup(state);
+#endif
        }
 
        /*
index 419cb38d5b0059b67e8ab7332c8e91e2b0a9121b..2f9643970121d160f14bb9aabedef5fb65307cec 100644 (file)
@@ -53,7 +53,6 @@ typedef struct LMTP_STATE {
     sasl_callback_t *sasl_callbacks;   /* stateful callbacks */
 #endif
     int     sndbufsize;                        /* total window size */
-    int     sndbuffree;                        /* remaining window */
     int     reuse;                     /* connection being reused */
 } LMTP_STATE;
 
index 63321e4960da13422bd4f7e706e72a91677364bb..36c19246cf1c7465c4ad62cef45c0ddab88e4ff7 100644 (file)
@@ -93,6 +93,7 @@
 #include <timed_connect.h>
 #include <stringops.h>
 #include <host_port.h>
+#include <sane_connect.h>
 
 /* Global library. */
 
@@ -221,7 +222,7 @@ static LMTP_SESSION *lmtp_connect_sock(int sock, struct sockaddr * sa, int len,
        non_blocking(sock, BLOCKING);
        errno = saved_errno;
     } else {
-       conn_stat = connect(sock, sa, len);
+       conn_stat = sane_connect(sock, sa, len);
     }
     if (conn_stat < 0) {
        vstring_sprintf(why, "connect to %s[%s]: %m",
index 7f2b455ab84ab3d07acc4b2b83a17892fdebe678..81f0e07acaa1111d790811f4b8e5e1787ad40d95 100644 (file)
@@ -245,11 +245,6 @@ int     lmtp_lhlo(LMTP_STATE *state)
     if (msg_verbose)
        msg_info("server features: 0x%x", state->features);
 
-#ifdef USE_SASL_AUTH
-    if (var_lmtp_sasl_enable && (state->features & LMTP_FEATURE_AUTH))
-       return (lmtp_sasl_helo_login(state));
-#endif
-
     /*
      * We use LMTP command pipelining if the server said it supported it.
      * Since we use blocking I/O, RFC 2197 says that we should inspect the
@@ -275,6 +270,11 @@ int     lmtp_lhlo(LMTP_STATE *state)
     } else
        state->sndbufsize = 0;
 
+#ifdef USE_SASL_AUTH
+    if (var_lmtp_sasl_enable && (state->features & LMTP_FEATURE_AUTH))
+       return (lmtp_sasl_helo_login(state));
+#endif
+
     return (0);
 }
 
@@ -704,8 +704,8 @@ static int lmtp_loop(LMTP_STATE *state, int send_state, int recv_state)
        /*
         * Copy the next command to the buffer and update the sender state.
         */
-       if (state->sndbuffree > 0)
-           state->sndbuffree -= VSTRING_LEN(next_command) + 2;
+       if (sndbuffree > 0)
+           sndbuffree -= VSTRING_LEN(next_command) + 2;
        lmtp_chat_cmd(state, "%s", vstring_str(next_command));
        send_state = next_state;
        send_rcpt = next_rcpt;
index 60e622fcabddc69557f23cd1116cc2a51cad49c7..db4a778cfcad7b1ed8d51c1abd39ee75237926d0 100644 (file)
@@ -36,7 +36,7 @@
 /*     authentication.
 /*
 /*     lmtp_sasl_passwd_lookup() looks up the username/password
-/*     for the current SMTP server. The result is zero in case
+/*     for the current LMTP server. The result is zero in case
 /*     of failure.
 /*
 /*     lmtp_sasl_authenticate() implements the SASL authentication
@@ -47,7 +47,7 @@
 /*     suceeds.
 /*
 /*     lmtp_sasl_cleanup() cleans up. It must be called at the
-/*     end of every SMTP session that uses SASL authentication.
+/*     end of every LMTP session that uses SASL authentication.
 /*     This routine is a noop for non-SASL sessions.
 /*
 /*     Arguments:
index 9f25f814959325bac282429cb7a2434729d3d774..f3cadc0b388e6ea971ca5ae14f9f5a2a6a9540d4 100644 (file)
@@ -80,7 +80,6 @@ LMTP_STATE *lmtp_state_alloc(void)
     lmtp_sasl_connect(state);
 #endif
     state->sndbufsize = 0;
-    state->sndbuffree = 0;
     state->reuse = 0;
     return (state);
 }
index 205767d766a41510b29117027d0bf233df691894..d510098143accc873b0184cebb78d24d18753afd 100644 (file)
@@ -137,6 +137,7 @@ smtp_connect.o: ../../include/iostuff.h
 smtp_connect.o: ../../include/timed_connect.h
 smtp_connect.o: ../../include/stringops.h
 smtp_connect.o: ../../include/host_port.h
+smtp_connect.o: ../../include/sane_connect.h
 smtp_connect.o: ../../include/mail_params.h
 smtp_connect.o: ../../include/own_inet_addr.h
 smtp_connect.o: ../../include/dns.h
index 35e9a5247a066019b4eac58ee6a529aabe41ba19..2fe78eec1a1e9b32145a24005ae122633965580d 100644 (file)
 #include <timed_connect.h>
 #include <stringops.h>
 #include <host_port.h>
+#include <sane_connect.h>
 
 /* Global library. */
 
@@ -208,7 +209,7 @@ static SMTP_SESSION *smtp_connect_addr(DNS_RR *addr, unsigned port,
        non_blocking(sock, BLOCKING);
        errno = saved_errno;
     } else {
-       conn_stat = connect(sock, (struct sockaddr *) & sin, sizeof(sin));
+       conn_stat = sane_connect(sock, (struct sockaddr *) & sin, sizeof(sin));
     }
     if (conn_stat < 0) {
        vstring_sprintf(why, "connect to %s[%s]: %m",
index e1ff5739806c9f5f01fcad3de846d786d7e6c989..4fd11947101cba6dc949bf9ec1b46dc803952879 100644 (file)
@@ -59,7 +59,7 @@
 /*     Disallow non-RFC 821 style addresses in SMTP commands. For example,
 /*     the RFC822-style address forms with comments that Sendmail allows.
 /* .IP \fBbroken_sasl_auth_clients\fR
-/*     Support older Microsoft clients that mis-implement the AUTH
+/*     Support Microsoft clients that implement an older version of the AUTH
 /*     protocol, and that expect an EHLO response of "250 AUTH=list"
 /*     instead of "250 AUTH list".
 /* .IP \fBsmtpd_noop_commands\fR
@@ -73,7 +73,7 @@
 /*     This parameter uses the same syntax as the right-hand side of
 /*     a Postfix transport table.
 /* .SH "Authentication controls"
-/* .IP \fBenable_sasl_authentication\fR
+/* .IP \fBsmtpd_sasl_auth_enable\fR
 /*     Enable per-session authentication as per RFC 2554 (SASL).
 /*     This functionality is available only when explicitly selected
 /*     at program build time and explicitly enabled at runtime.
@@ -1586,13 +1586,6 @@ static void smtpd_service(VSTREAM *stream, char *unused_service, char **argv)
     smtpd_state_init(&state, stream);
     msg_info("connect from %s[%s]", state.name, state.addr);
 
-    /*
-     * XXX non_blocking() aborts upon error.
-     */
-#ifdef BROKEN_READ_SELECT_ON_BLOCKING_SOCKET
-    non_blocking(vstream_fileno(stream), NON_BLOCKING);
-#endif
-
     /*
      * See if we need to turn on verbose logging for this client.
      */
index 186538bb6d824e587898048bcc87448484d0595f..c541cdbaa57743365378e39a1d32e1365d9f51d4 100644 (file)
@@ -103,6 +103,7 @@ qmqp-source.o: ../../include/mymalloc.h
 qmqp-source.o: ../../include/events.h
 qmqp-source.o: ../../include/find_inet.h
 qmqp-source.o: ../../include/netstring.h
+qmqp-source.o: ../../include/sane_connect.h
 qmqp-source.o: ../../include/mail_date.h
 qmqp-source.o: ../../include/qmqp_proto.h
 smtp-sink.o: smtp-sink.c
@@ -119,6 +120,7 @@ smtp-sink.o: ../../include/events.h
 smtp-sink.o: ../../include/mymalloc.h
 smtp-sink.o: ../../include/msg_vstream.h
 smtp-sink.o: ../../include/stringops.h
+smtp-sink.o: ../../include/sane_accept.h
 smtp-sink.o: ../../include/smtp_stream.h
 smtp-source.o: smtp-source.c
 smtp-source.o: ../../include/sys_defs.h
@@ -135,5 +137,6 @@ smtp-source.o: ../../include/iostuff.h
 smtp-source.o: ../../include/mymalloc.h
 smtp-source.o: ../../include/events.h
 smtp-source.o: ../../include/find_inet.h
+smtp-source.o: ../../include/sane_connect.h
 smtp-source.o: ../../include/smtp_stream.h
 smtp-source.o: ../../include/mail_date.h
index 66fd33854e3e8b63a3a597263fb45112fbce2983..3b7a572c2cd42717dd61a2662d5a51d8b319d318 100644 (file)
@@ -83,6 +83,7 @@
 #include <find_inet.h>
 #include <iostuff.h>
 #include <netstring.h>
+#include <sane_connect.h>
 
 /* Global library. */
 
@@ -306,7 +307,7 @@ static void start_connect(SESSION *session)
     session->stream = vstream_fdopen(fd, O_RDWR);
     event_enable_write(fd, connect_done, (char *) session);
     netstring_setup(session->stream, var_timeout);
-    if (connect(fd, sa, sa_length) < 0 && errno != EINPROGRESS)
+    if (sane_connect(fd, sa, sa_length) < 0 && errno != EINPROGRESS)
        fail_connect(session);
 }
 
index ac3fac7f554b3fcb5931ff43a5367760bba13f5e..552c40edd21a25e0b1b3174072de7f4258ee4aa6 100644 (file)
@@ -98,6 +98,7 @@
 #include <iostuff.h>
 #include <msg_vstream.h>
 #include <stringops.h>
+#include <sane_accept.h>
 
 /* Global library. */
 
@@ -496,7 +497,7 @@ static void connect_event(int unused_event, char *context)
     SINK_STATE *state;
     int     fd;
 
-    if ((fd = accept(sock, &sa, &len)) >= 0) {
+    if ((fd = sane_accept(sock, &sa, &len)) >= 0) {
        if (msg_verbose)
            msg_info("connect (%s)",
 #ifdef AF_LOCAL
index 9eafa9a187b20985caff93e55f80fc848966f747..959c99337e31a00fdec66d8add01fe869e8e30a1 100644 (file)
 #include <events.h>
 #include <find_inet.h>
 #include <iostuff.h>
+#include <sane_connect.h>
 
 /* Global library. */
 
@@ -411,7 +412,7 @@ static void start_connect(SESSION *session)
     session->stream = vstream_fdopen(fd, O_RDWR);
     event_enable_write(fd, connect_done, (char *) session);
     smtp_timeout_setup(session->stream, var_timeout);
-    if (connect(fd, sa, sa_length) < 0 && errno != EINPROGRESS)
+    if (sane_connect(fd, sa, sa_length) < 0 && errno != EINPROGRESS)
        fail_connect(session);
 }
 
index 98c0cf2d2bb60f7bba3ff70d4f812b3622ccbbb1..d1d841bb5458b64a0739279626eb22d5d9922471 100644 (file)
@@ -26,7 +26,7 @@ SRCS  = alldig.c argv.c argv_split.c attr_print0.c attr_print64.c \
        unix_connect.c unix_listen.c unix_trigger.c unsafe.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 strcasecmp.c nvtable.c host_port.c
+       write_wait.c strcasecmp.c nvtable.c host_port.c sane_connect.c
 OBJS   = alldig.o argv.o argv_split.o attr_print0.o attr_print64.o \
        attr_scan0.o attr_scan64.o base64_code.o basename.o binhash.o \
        chroot_uid.o clean_env.o close_on_exec.o concatenate.o ctable.o \
@@ -54,7 +54,7 @@ OBJS  = alldig.o argv.o argv_split.o attr_print0.o attr_print64.o \
        unix_connect.o unix_listen.o unix_trigger.o unsafe.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 nvtable.o $(STRCASE) host_port.o
+       write_wait.o nvtable.o host_port.o sane_connect.o $(STRCASE)
 HDRS   = argv.h attr.h base64_code.h binhash.h chroot_uid.h clean_env.h \
        connect.h ctable.h dict.h dict_db.h dict_dbm.h dict_env.h \
        dict_ht.h dict_ldap.h dict_mysql.h dict_ni.h dict_nis.h \
@@ -72,7 +72,7 @@ HDRS  = argv.h attr.h base64_code.h binhash.h chroot_uid.h clean_env.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 \
-       nvtable.h host_port.h
+       nvtable.h host_port.h sane_connect.h
 TESTSRC        = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
        stream_test.c dup2_pass_on_exec.c
 WARN   = -W -Wformat -Wimplicit -Wmissing-prototypes \
@@ -808,6 +808,7 @@ inet_connect.o: msg.h
 inet_connect.o: find_inet.h
 inet_connect.o: inet_util.h
 inet_connect.o: iostuff.h
+inet_connect.o: sane_connect.h
 inet_connect.o: connect.h
 inet_connect.o: timed_connect.h
 inet_listen.o: inet_listen.c
@@ -919,6 +920,7 @@ msg_syslog.o: stringops.h
 msg_syslog.o: msg.h
 msg_syslog.o: msg_output.h
 msg_syslog.o: msg_syslog.h
+msg_syslog.o: safe.h
 msg_vstream.o: msg_vstream.c
 msg_vstream.o: sys_defs.h
 msg_vstream.o: vstream.h
@@ -1039,6 +1041,10 @@ sane_accept.o: sane_accept.c
 sane_accept.o: sys_defs.h
 sane_accept.o: msg.h
 sane_accept.o: sane_accept.h
+sane_connect.o: sane_connect.c
+sane_connect.o: sys_defs.h
+sane_connect.o: msg.h
+sane_connect.o: sane_connect.h
 sane_link.o: sane_link.c
 sane_link.o: sys_defs.h
 sane_link.o: msg.h
@@ -1146,9 +1152,11 @@ timed_connect.o: timed_connect.c
 timed_connect.o: sys_defs.h
 timed_connect.o: msg.h
 timed_connect.o: iostuff.h
+timed_connect.o: sane_connect.h
 timed_connect.o: timed_connect.h
 timed_read.o: timed_read.c
 timed_read.o: sys_defs.h
+timed_read.o: msg.h
 timed_read.o: iostuff.h
 timed_wait.o: timed_wait.c
 timed_wait.o: sys_defs.h
@@ -1157,6 +1165,7 @@ timed_wait.o: posix_signals.h
 timed_wait.o: timed_wait.h
 timed_write.o: timed_write.c
 timed_write.o: sys_defs.h
+timed_write.o: msg.h
 timed_write.o: iostuff.h
 translit.o: translit.c
 translit.o: sys_defs.h
@@ -1177,6 +1186,7 @@ unix_connect.o: unix_connect.c
 unix_connect.o: sys_defs.h
 unix_connect.o: msg.h
 unix_connect.o: iostuff.h
+unix_connect.o: sane_connect.h
 unix_connect.o: connect.h
 unix_connect.o: timed_connect.h
 unix_listen.o: unix_listen.c
index 152e498461e117dba8d908e8e4c17763d4f7f53d..3c76734cdda4f9663c47f24ac0966725f11eaaf2 100644 (file)
@@ -63,6 +63,7 @@
 #include "find_inet.h"
 #include "inet_util.h"
 #include "iostuff.h"
+#include "sane_connect.h"
 #include "connect.h"
 #include "timed_connect.h"
 
@@ -114,7 +115,7 @@ int     inet_connect(const char *addr, int block_mode, int timeout)
      */
     else {
        non_blocking(sock, block_mode);
-       if (connect(sock, (struct sockaddr *) & sin, sizeof(sin)) < 0
+       if (sane_connect(sock, (struct sockaddr *) & sin, sizeof(sin)) < 0
            && errno != EINPROGRESS) {
            close(sock);
            return (-1);
index 91347c95ab44bbf06a98a4401edbba48858cc711..2a846b39b8ddaad234038f6a8b9d596789dbd573 100644 (file)
@@ -116,5 +116,8 @@ int     inet_listen(const char *addr, int backlog, int block_mode)
 
 int     inet_accept(int fd)
 {
-    return (sane_accept(fd, (struct sockaddr *) 0, (SOCKADDR_SIZE *) 0));
+    struct sockaddr_in sin;
+    SOCKADDR_SIZE len = sizeof(sin);
+
+    return (sane_accept(fd, (struct sockaddr *) & sin, &len));
 }
index fb93014572ade21ed3c31050eda2748f33037b2e..5af7cb950da55b685274f01c930960e3d856945a 100644 (file)
@@ -49,6 +49,7 @@
 #include <errno.h>
 #include <syslog.h>
 #include <string.h>
+#include <time.h>
 
 /* Application-specific. */
 
@@ -57,6 +58,7 @@
 #include "msg.h"
 #include "msg_output.h"
 #include "msg_syslog.h"
+#include "safe.h"
 
  /*
   * Stay a little below the 2048-byte limit of older syslog()
@@ -167,6 +169,13 @@ void    msg_syslog_init(const char *name, int logopt, int facility)
 {
     static int first_call = 1;
 
+    /*
+     * XXX If this program is set-gid, then TZ must not be trusted.
+     * This scrubbing code is in the wrong place.
+     */
+    if (unsafe())
+       putenv("TZ=");
+    tzset();
     openlog(name, LOG_NDELAY | logopt, facility);
     if (first_call) {
        first_call = 0;
index a28e5bf93313950f51d80d18c284375928e71aad..30a3d8533e1413e68567cd523591305619446d53 100644 (file)
@@ -13,6 +13,9 @@
 /* DESCRIPTION
 /*     sane_accept() implements the accept(2) socket call, and maps
 /*     known harmless error results to EAGAIN.
+/*
+/*     If the buf and len arguments are not null, then additional
+/*     workarounds may be enabled that depend on the socket type.
 /* BUGS
 /*     Bizarre systems may have other harmless error results. Such
 /*     systems encourage programers to ignore error results, and
@@ -89,5 +92,21 @@ int     sane_accept(int sock, struct sockaddr * sa, SOCKADDR_SIZE *len)
            }
        }
     }
+
+    /*
+     * XXX Solaris select() produces false read events, so that read() blocks
+     * forever on a blocking socket, and fails with EAGAIN on a non-blocking
+     * socket. Turning on keepalives will fix a blocking socket provided that
+     * the kernel's keepalive timer expires before the Postfix watchdog
+     * timer.
+     */
+#if defined(BROKEN_READ_SELECT_ON_TCP_SOCKET) && defined(SO_KEEPALIVE)
+    else if (sa != 0 && sa->sa_family == AF_INET) {
+       int     on = 1;
+
+       (void) setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE,
+                         (char *) &on, sizeof(on));
+    }
+#endif
     return (fd);
 }
diff --git a/postfix/src/util/sane_connect.c b/postfix/src/util/sane_connect.c
new file mode 100644 (file)
index 0000000..cdb2874
--- /dev/null
@@ -0,0 +1,63 @@
+/*++
+/* NAME
+/*     sane_connect 3
+/* SUMMARY
+/*     sanitize connect() results
+/* SYNOPSIS
+/*     #include <sane_connect.h>
+/*
+/*     int     sane_connect(sock, buf, len)
+/*     int     sock;
+/*     struct sockaddr *buf;
+/*     SOCKADDR_SIZE *len;
+/* DESCRIPTION
+/*     sane_connect() implements the accept(2) socket call, and maps
+/*     known harmless error results to EAGAIN.
+/* BUGS
+/*     Bizarre systems may have other harmless error results. Such
+/*     systems encourage programers to ignore error results, and
+/*     penalizes programmers who code defensively.
+/* 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
+/*--*/
+
+/* System library. */
+
+#include "sys_defs.h"
+#include <sys/socket.h>
+#include <errno.h>
+
+/* Utility library. */
+
+#include "msg.h"
+#include "sane_connect.h"
+
+/* sane_connect - sanitize connect() results */
+
+int     sane_connect(int sock, struct sockaddr * sa, SOCKADDR_SIZE len)
+{
+
+    /*
+     * XXX Solaris select() produces false read events, so that read() blocks
+     * forever on a blocking socket, and fails with EAGAIN on a non-blocking
+     * socket. Turning on keepalives will fix a blocking socket provided that
+     * the kernel's keepalive timer expires before the Postfix watchdog
+     * timer.
+     */
+#if defined(BROKEN_READ_SELECT_ON_TCP_SOCKET) && defined(SO_KEEPALIVE)
+    if (sa->sa_family == AF_INET) {
+       int     on = 1;
+
+       (void) setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE,
+                         (char *) &on, sizeof(on));
+    }
+#endif
+    return (connect(sock, sa, len));
+}
diff --git a/postfix/src/util/sane_connect.h b/postfix/src/util/sane_connect.h
new file mode 100644 (file)
index 0000000..1f023b0
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _SANE_CONNECT_H_
+#define _SANE_CONNECT_H_
+
+/*++
+/* NAME
+/*     sane_connect 3h
+/* SUMMARY
+/*     sanitize connect() results
+/* SYNOPSIS
+/*     #include <sane_connect.h>
+/* DESCRIPTION
+/* .nf
+
+ /* External interface. */
+
+extern int sane_connect(int, struct sockaddr *, SOCKADDR_SIZE);
+
+/* 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
index 739818adf5c57b6c4ba171a166f5df7d5482e1d2..ea568a132c5e87145e26c05c18014433f72bba51 100644 (file)
@@ -261,7 +261,7 @@ extern int opterr;
 #define LOCAL_CONNECT  stream_connect
 #define LOCAL_TRIGGER  stream_trigger
 #define HAS_VOLATILE_LOCKS
-#define BROKEN_READ_SELECT_ON_BLOCKING_SOCKET
+#define BROKEN_READ_SELECT_ON_TCP_SOCKET
 /*
  * Allow build environment to override paths.
  */
index c40fe3e6311c00f9717988c6e4162a0520485af1..ee4e150b1269720e01d498608ea7ecf089fe35fd 100644 (file)
@@ -59,6 +59,7 @@
 
 #include "msg.h"
 #include "iostuff.h"
+#include "sane_connect.h"
 #include "timed_connect.h"
 
 /* timed_connect - connect with deadline */
@@ -78,7 +79,7 @@ int     timed_connect(int sock, struct sockaddr * sa, int len, int timeout)
     /*
      * Start the connection, and handle all possible results.
      */
-    if (connect(sock, sa, len) == 0)
+    if (sane_connect(sock, sa, len) == 0)
        return (0);
     if (errno != EINPROGRESS)
        return (-1);
index 0890f7e1cb0eff25def975c9ded993f3b7b70513..5ae4525431d76354ae2bfad8ad362e17f469ed00 100644 (file)
@@ -50,6 +50,7 @@
 
 #include "msg.h"
 #include "iostuff.h"
+#include "sane_connect.h"
 #include "connect.h"
 #include "timed_connect.h"
 
@@ -99,7 +100,7 @@ int     unix_connect(const char *addr, int block_mode, int timeout)
      */
     else {
        non_blocking(sock, block_mode);
-       if (connect(sock, (struct sockaddr *) & sun, sizeof(sun)) < 0
+       if (sane_connect(sock, (struct sockaddr *) & sun, sizeof(sun)) < 0
            && errno != EINPROGRESS) {
            close(sock);
            return (-1);