]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.0.5-20030301
authorWietse Venema <wietse@porcupine.org>
Sat, 1 Mar 2003 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:45 +0000 (06:28 +0000)
38 files changed:
postfix/HISTORY
postfix/README_FILES/FILTER_README
postfix/RELEASE_NOTES
postfix/conf/transport
postfix/html/postalias.1.html
postfix/html/postmap.1.html
postfix/html/proxymap.8.html
postfix/html/spawn.8.html
postfix/html/transport.5.html
postfix/man/man1/postalias.1
postfix/man/man1/postmap.1
postfix/man/man5/transport.5
postfix/man/man8/proxymap.8
postfix/proto/transport
postfix/src/cleanup/cleanup.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/global/maps.c
postfix/src/lmtp/lmtp.c
postfix/src/local/local.c
postfix/src/nqmgr/qmgr.c
postfix/src/pipe/pipe.c
postfix/src/postalias/postalias.c
postfix/src/postmap/postmap.c
postfix/src/proxymap/proxymap.c
postfix/src/qmgr/qmgr.c
postfix/src/qmqpd/qmqpd.c
postfix/src/smtp/smtp.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd_chat.c
postfix/src/spawn/spawn.c
postfix/src/trivial-rewrite/trivial-rewrite.c
postfix/src/util/dict.c
postfix/src/util/dict.h
postfix/src/util/dict_open.c
postfix/src/util/match_list.c
postfix/src/util/sys_defs.h
postfix/src/virtual/virtual.c

index ea741cb8b77719483b96bba8dfd9e4f50e80d2ef..79b0a655f8ddf63911847b92963d597600231fac 100644 (file)
@@ -7854,6 +7854,40 @@ Apologies for any names omitted.
        did not eliminate virtual expansion duplicates with the
        same original recipient. File: cleanup/cleanup_out_recipient.c.
 
+20030223
+
+       Cleanup: added postmap/postalias -p option (do not inherit
+       the source file permissions when creating a new file), for
+       completeness.  A feature that can't be turned off is a bug.
+       Files:  postmap/postmap.c, postalias/postalias.c.
+
+       Bugfix: smtpd_hard/soft_error_limit off-by-one error, so
+       that the real limit was one larger than the configured
+       value.  File: smtpd/smtpd.c, smtpd/smtpd_chat.c.
+
+20030226
+
+       Safety: proxymap server defense against potential deadlock
+       when some library routine wants to open a proxied table.
+       Instead, proxymap opens the requested table directly. File:
+       proxymap/proxymap.c.
+
+       Portability: updated AIX 5.x system dependent definitions.
+       File: util/sys_defs.h.
+
+20030227
+
+       Bugfix: added mynetworks to the list of proxy_read_maps
+       parameter settings that are pre-authorized to use proxied
+       table lookups.  File: global/mail_params.h.
+
+       Cleanup: daemons now log what table has changed before
+       restarting. Files: dict.c, and anything that invoked
+       dict_changed().
+
+       Cleanup: more consistency in the naming of lookup table
+       handles as generated by maps(3) and by match_list(3).
+
 Open problems:
 
        Med: make qmgr recipient bounce/defer activity asynchronous
index 63f99ee9af19f9fc8e66d26dd6b681780b8f40d7..e59ccfa510d41e82214acc752b2e53a242b2e52f 100644 (file)
@@ -343,9 +343,9 @@ new parameter:
 # cleanup service (defined further below).
 #
 smtp      inet  n       -       n       -       -       smtpd
-    -o cleanup_service=pre-cleanup
+    -o cleanup_service_name=pre-cleanup
 pickup    fifo  n       -       n       60      1       pickup
-    -o cleanup_service=pre-cleanup
+    -o cleanup_service_name=pre-cleanup
 #
 # ------------------------------------------------------------------
 #
index f4765c11fbe03646bf05a8373ca3b09d730b67b7..b4004cf8eae607c67f815a13cece47da01f830bd 100644 (file)
@@ -22,6 +22,15 @@ snapshot release).  Patches change the patchlevel and the release
 date. Snapshots change only the release date, unless they include
 the same bugfixes as a patch release.
 
+Incompatible changes with Postfix snapshot 2.0.3-20030227
+=========================================================
+
+The smtpd_hard_error_limit and smtpd_soft_error_limit values now
+behave as documented, that is, smtpd_hard_error_limit=1 causes
+Postfix to disconnect upon the first client error. Previously,
+there was an off-by-one error causing Postfix to change behavior
+after smtpd_hard/soft_error_limit+1 errors.
+
 Incompatible changes with Postfix snapshot 2.0.3-20030125
 =========================================================
 
index 73c15dbce62ed3a17505036b16dbe730dce2b9cd..3ae93a7f07ae89b113c464e5aa750d23a7d45412 100644 (file)
 #        dependent. In the case of SMTP, specify host:service for a
 #        non-default  server port, and use [host] or [host]:port in
 #        order to disable MX (mail exchanger) DNS lookups.  The  []
-#        form  can  also be used with IP addresses instead of host-
-#        names.
+#        form is required when you specify an IP address instead of
+#        a hostname.
 # 
 #        A null transport and null nexthop  result  means  "do  not
 #        change":  use  the delivery transport and nexthop informa-
index b19ca66ecd45fcdd9dfc8aa81d259e0975a521e9..e8a582d77723bb0aa2179b5b9564a52a79ff8d78 100644 (file)
@@ -5,7 +5,7 @@ POSTALIAS(1)                                         POSTALIAS(1)
        postalias - Postfix alias database maintenance
 
 <b>SYNOPSIS</b>
-       <b>postalias</b> [<b>-Nfinorvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
+       <b>postalias</b> [<b>-Nfinoprvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
        [<i>file_type</i>:]<i>file_name</i> ...
 
 <b>DESCRIPTION</b>
@@ -24,45 +24,53 @@ POSTALIAS(1)                                         POSTALIAS(1)
        the entire database, in order to avoid surprises in  spec-
        tator programs.
 
+       The  format  of  Postfix alias input files is described in
+       <a href="aliases.5.html"><b>aliases</b>(5)</a>.
+
        Options:
 
-       <b>-N</b>     Include  the terminating null character that termi-
-              nates lookup keys and values. By  default,  Postfix
+       <b>-N</b>     Include the terminating null character that  termi-
+              nates  lookup  keys and values. By default, Postfix
               does whatever is the default for the host operating
               system.
 
        <b>-c</b> <i>config_dir</i>
-              Read the <b>main.cf</b> configuration file  in  the  named
+              Read  the  <b>main.cf</b>  configuration file in the named
               directory  instead  of  the  default  configuration
               directory.
 
-       <b>-d</b> <i>key</i> Search the specified maps for <i>key</i>  and  remove  one
-              entry  per  map.   The exit status is zero when the
+       <b>-d</b> <i>key</i> Search  the  specified  maps for <i>key</i> and remove one
+              entry per map.  The exit status is  zero  when  the
               requested information was found.
 
               If a key value of <b>-</b> is specified, the program reads
               key values from the standard input stream. The exit
-              status is zero when at least one of  the  requested
+              status  is  zero when at least one of the requested
               keys was found.
 
        <b>-f</b>     Do not fold the lookup key to lower case while cre-
               ating or querying a map.
 
-       <b>-i</b>     Incremental mode. Read entries from standard  input
+       <b>-i</b>     Incremental  mode. Read entries from standard input
               and  do  not  truncate  an  existing  database.  By
-              default, <b>postalias</b> creates a new database from  the
+              default,  <b>postalias</b> creates a new database from the
               entries in <i>file_name</i>.
 
-       <b>-n</b>     Don't  include  the terminating null character that
-              terminates lookup  keys  and  values.  By  default,
-              Postfix  does  whatever is the default for the host
+       <b>-n</b>     Don't include the terminating null  character  that
+              terminates  lookup  keys  and  values.  By default,
+              Postfix does whatever is the default for  the  host
               operating system.
 
-       <b>-o</b>     Do not release root privileges  when  processing  a
-              non-root  input  file.  By default, <b>postalias</b> drops
-              root privileges and runs as the source  file  owner
+       <b>-o</b>     Do  not  release  root privileges when processing a
+              non-root input file. By  default,  <b>postalias</b>  drops
+              root  privileges  and runs as the source file owner
               instead.
 
+       <b>-p</b>     Do not inherit the file access permissions from the
+              input file when creating a new file.  Instead, cre-
+              ate a new  file  with  default  access  permissions
+              (mode 0644).
+
        <b>-q</b> <i>key</i> Search  the  specified  maps  for <i>key</i> and print the
               first value found on the  standard  output  stream.
               The exit status is zero when the requested informa-
@@ -153,6 +161,7 @@ POSTALIAS(1)                                         POSTALIAS(1)
 
 <b>SEE</b> <b>ALSO</b>
        <a href="aliases.5.html">aliases(5)</a> format of alias database input file.
+       local(5) Postfix local delivery agent.
        <a href="sendmail.1.html">sendmail(1)</a> mail posting and compatibility interface.
 
 <b>LICENSE</b>
index e589047c1ce75e6a6b49cd84292e05996efb2a74..0873220c98a933a89766785824640ea23feb8489 100644 (file)
@@ -5,7 +5,7 @@ POSTMAP(1)                                             POSTMAP(1)
        postmap - Postfix lookup table management
 
 <b>SYNOPSIS</b>
-       <b>postmap</b> [<b>-Nfinorvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
+       <b>postmap</b> [<b>-Nfinoprvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
        [<i>file_type</i>:]<i>file_name</i> ...
 
 <b>DESCRIPTION</b>
@@ -24,6 +24,7 @@ POSTMAP(1)                                             POSTMAP(1)
        the entire table, in order to avoid surprises in spectator
        programs.
 
+<b>INPUT</b> <b>FILE</b> <b>FORMAT</b>
        The format of a lookup table input file is as follows:
 
        <b>o</b>      A table entry has the form
@@ -45,8 +46,7 @@ POSTMAP(1)                                             POSTMAP(1)
        whitespace. The <i>key</i> is mapped to lowercase to make mapping
        lookups case insensitive.
 
-       Options:
-
+<b>COMMAND-LINE</b> <b>ARGUMENTS</b>
        <b>-N</b>     Include the terminating null character that  termi-
               nates  lookup  keys and values. By default, Postfix
               does whatever is the default for the host operating
@@ -84,25 +84,30 @@ POSTMAP(1)                                             POSTMAP(1)
               privileges  and  runs  as  the  source  file  owner
               instead.
 
-       <b>-q</b> <i>key</i> Search the specified maps for  <i>key</i>  and  print  the
-              first  value  found  on the standard output stream.
+       <b>-p</b>     Do not inherit the file access permissions from the
+              input file when creating a new file.  Instead, cre-
+              ate a new  file  with  default  access  permissions
+              (mode 0644).
+
+       <b>-q</b> <i>key</i> Search  the  specified  maps  for <i>key</i> and print the
+              first value found on the  standard  output  stream.
               The exit status is zero when the requested informa-
               tion was found.
 
               If a key value of <b>-</b> is specified, the program reads
-              key values  from  the  standard  input  stream  and
-              prints  one  line  of <i>key</i> <i>value</i> output for each key
-              that was found. The exit status  is  zero  when  at
+              key  values  from  the  standard  input  stream and
+              prints one line of <i>key</i> <i>value</i> output  for  each  key
+              that  was  found.  The  exit status is zero when at
               least one of the requested keys was found.
 
-       <b>-r</b>     When  updating a table, do not warn about duplicate
+       <b>-r</b>     When updating a table, do not warn about  duplicate
               entries; silently replace them.
 
        <b>-v</b>     Enable verbose logging for debugging purposes. Mul-
-              tiple  <b>-v</b>  options  make  the software increasingly
+              tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
-       <b>-w</b>     When updating a table, do not warn about  duplicate
+       <b>-w</b>     When  updating a table, do not warn about duplicate
               entries; silently ignore them.
 
        Arguments:
@@ -110,28 +115,28 @@ POSTMAP(1)                                             POSTMAP(1)
        <i>file_type</i>
               The type of database to be produced.
 
-              <b>btree</b>  The  output  file  is  a  btree  file, named
-                     <i>file_name</i><b>.db</b>.  This  is  available  only  on
+              <b>btree</b>  The output  file  is  a  btree  file,  named
+                     <i>file_name</i><b>.db</b>.   This  is  available  only on
                      systems with support for <b>db</b> databases.
 
-              <b>dbm</b>    The  output  consists  of  two  files, named
-                     <i>file_name</i><b>.pag</b> and  <i>file_name</i><b>.dir</b>.   This  is
-                     available  only  on systems with support for
+              <b>dbm</b>    The output  consists  of  two  files,  named
+                     <i>file_name</i><b>.pag</b>  and  <i>file_name</i><b>.dir</b>.   This is
+                     available only on systems with  support  for
                      <b>dbm</b> databases.
 
-              <b>hash</b>   The output file  is  a  hashed  file,  named
-                     <i>file_name</i><b>.db</b>.   This  is  available  only on
+              <b>hash</b>   The  output  file  is  a  hashed file, named
+                     <i>file_name</i><b>.db</b>.  This  is  available  only  on
                      systems with support for <b>db</b> databases.
 
-              Use the command <b>postconf</b> <b>-m</b> to find out what  types
-              of  database your Postfix installation can support.
+              Use  the command <b>postconf</b> <b>-m</b> to find out what types
+              of database your Postfix installation can  support.
 
-              When no <i>file_type</i> is specified, the  software  uses
-              the     database    type    specified    via    the
+              When  no  <i>file_type</i> is specified, the software uses
+              the    database    type    specified    via     the
               <b>default</b><i>_</i><b>database</b><i>_</i><b>type</b> configuration parameter.
 
        <i>file_name</i>
-              The name of  the  lookup  table  source  file  when
+              The  name  of  the  lookup  table  source file when
               rebuilding a database.
 
 <b>DIAGNOSTICS</b>
@@ -139,8 +144,8 @@ POSTMAP(1)                                             POSTMAP(1)
        stream. No output means no problems. Duplicate entries are
        skipped and are flagged with a warning.
 
-       <b>postmap</b>  terminates  with zero exit status in case of suc-
-       cess (including successful <b>postmap</b> <b>-q</b> lookup)  and  termi-
+       <b>postmap</b> terminates with zero exit status in case  of  suc-
+       cess  (including  successful <b>postmap</b> <b>-q</b> lookup) and termi-
        nates with non-zero exit status in case of failure.
 
 <b>ENVIRONMENT</b>
@@ -152,20 +157,20 @@ POSTMAP(1)                                             POSTMAP(1)
 
 <b>CONFIGURATION</b> <b>PARAMETERS</b>
        <b>default</b><i>_</i><b>database</b><i>_</i><b>type</b>
-              Default  output  database  type.  On many UNIX sys-
-              tems, the default database type is either  <b>hash</b>  or
+              Default output database type.  On  many  UNIX  sys-
+              tems,  the  default database type is either <b>hash</b> or
               <b>dbm</b>.
 
        <b>berkeley</b><i>_</i><b>db</b><i>_</i><b>create</b><i>_</i><b>buffer</b><i>_</i><b>size</b>
-              Amount  of buffer memory to be used when creating a
+              Amount of buffer memory to be used when creating  a
               Berkeley DB <b>hash</b> or <b>btree</b> lookup table.
 
        <b>berkeley</b><i>_</i><b>db</b><i>_</i><b>read</b><i>_</i><b>buffer</b><i>_</i><b>size</b>
-              Amount of buffer memory to be used when  reading  a
+              Amount  of  buffer memory to be used when reading a
               Berkeley DB <b>hash</b> or <b>btree</b> lookup table.
 
 <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 12dad01ac99cea9415482781369812eb422fca16..4ea05c0960300511f3bdb7489fad7bf2513e03b3 100644 (file)
@@ -29,10 +29,10 @@ PROXYMAP(8)                                           PROXYMAP(8)
               tions" errors. The solution:
 
               virtual_alias_maps =
-                  proxy:mysql:/etc/postfix/virtual.cf
+                  proxy:mysql:/etc/postfix/virtual_alias.cf
 
               The total number of connections is limited  by  the
-              number of proxymap server server processes.
+              number of proxymap server processes.
 
        The proxymap server implements the following requests:
 
index 34b3427981f28f0d876f505b714b59893eff71b0..cf7d27797fd5c01bb928e7c2f8ed25ff086a21d0 100644 (file)
@@ -1,5 +1,4 @@
 <html> <head> </head> <body> <pre>
-
 SPAWN(8)                                                 SPAWN(8)
 
 <b>NAME</b>
@@ -98,6 +97,5 @@ SPAWN(8)                                                 SPAWN(8)
        P.O. Box 704
        Yorktown Heights, NY 10598, USA
 
-                                                                1
-
+                                                         SPAWN(8)
 </pre> </body> </html>
index 774c557f5d1c8e07ef621829beed77724b8e0b88..3d63496b84119a315a13aee61a746e913d45acaa 100644 (file)
@@ -102,8 +102,8 @@ TRANSPORT(5)                                         TRANSPORT(5)
        dependent. In the case of SMTP, specify <i>host</i>:<i>service</i> for a
        non-default  server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
        order to disable MX (mail exchanger) DNS lookups.  The  []
-       form  can  also be used with IP addresses instead of host-
-       names.
+       form is required when you specify an IP address instead of
+       a hostname.
 
        A null <i>transport</i> and null <i>nexthop</i>  result  means  "do  not
        change":  use  the delivery transport and nexthop informa-
index e7fc82ef0216c962f35e14e444c52740fa96a4ad..5ad1dae2eaa8bef5c2d54c1f2ae174ad62491e90 100644 (file)
@@ -9,7 +9,7 @@ Postfix alias database maintenance
 .na
 .nf
 .fi
-\fBpostalias\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
+\fBpostalias\fR [\fB-Nfinoprvw\fR] [\fB-c \fIconfig_dir\fR]
 [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
 [\fIfile_type\fR:]\fIfile_name\fR ...
 .SH DESCRIPTION
@@ -28,6 +28,9 @@ postponed, and an exclusive, advisory, lock is placed on the
 entire database, in order to avoid surprises in spectator
 programs.
 
+The format of Postfix alias input files is described in
+\fBaliases\fR(5).
+
 Options:
 .IP \fB-N\fR
 Include the terminating null character that terminates lookup keys
@@ -58,6 +61,10 @@ the host operating system.
 Do not release root privileges when processing a non-root
 input file. By default, \fBpostalias\fR drops root privileges
 and runs as the source file owner instead.
+.IP \fB-p\fR
+Do not inherit the file access permissions from the input file
+when creating a new file.  Instead, create a new file with default
+access permissions (mode 0644).
 .IP "\fB-q \fIkey\fR"
 Search the specified maps for \fIkey\fR and print the first value
 found on the standard output stream. The exit status is zero
@@ -146,6 +153,7 @@ RFC 822 (ARPA Internet Text Messages)
 .na
 .nf
 aliases(5) format of alias database input file.
+local(5) Postfix local delivery agent.
 sendmail(1) mail posting and compatibility interface.
 .SH LICENSE
 .na
index 9c6400b195ad75954f7f5af1bae2c6d3db7d6610..b66ec181a4e663399ef015edb075fbce4c8850a7 100644 (file)
@@ -9,7 +9,7 @@ Postfix lookup table management
 .na
 .nf
 .fi
-\fBpostmap\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
+\fBpostmap\fR [\fB-Nfinoprvw\fR] [\fB-c \fIconfig_dir\fR]
 [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
 [\fIfile_type\fR:]\fIfile_name\fR ...
 .SH DESCRIPTION
@@ -29,7 +29,11 @@ While the table update is in progress, signal delivery is
 postponed, and an exclusive, advisory, lock is placed on the
 entire table, in order to avoid surprises in spectator
 programs.
-
+.SH INPUT FILE FORMAT
+.na
+.nf
+.ad
+.fi
 The format of a lookup table input file is as follows:
 .IP \(bu
 A table entry has the form
@@ -48,8 +52,11 @@ surrounding white space is stripped off. Unlike with Postfix alias
 databases, quotes cannot be used to protect lookup keys that contain
 special characters such as `#' or whitespace. The \fIkey\fR is mapped
 to lowercase to make mapping lookups case insensitive.
-
-Options:
+.SH COMMAND-LINE ARGUMENTS
+.na
+.nf
+.ad
+.fi
 .IP \fB-N\fR
 Include the terminating null character that terminates lookup keys
 and values. By default, Postfix does whatever is the default for
@@ -79,6 +86,10 @@ the host operating system.
 Do not release root privileges when processing a non-root
 input file. By default, \fBpostmap\fR drops root privileges
 and runs as the source file owner instead.
+.IP \fB-p\fR
+Do not inherit the file access permissions from the input file
+when creating a new file.  Instead, create a new file with default
+access permissions (mode 0644).
 .IP "\fB-q \fIkey\fR"
 Search the specified maps for \fIkey\fR and print the first value
 found on the standard output stream. The exit status is zero
index f244a96c1e7c4fc1dafe5b9c64dea2bd01cf18c7..e4c69f3728ecc600af8517122dc02c418dc2db29 100644 (file)
@@ -102,7 +102,7 @@ The interpretation of the nexthop field is transport
 dependent. In the case of SMTP, specify \fIhost\fR:\fIservice\fR for a
 non-default server port, and use [\fIhost\fR] or [\fIhost\fR]:\fIport\fR
 in order to disable MX (mail exchanger) DNS lookups. The [] form
-can also be used with IP addresses instead of hostnames.
+is required when you specify an IP address instead of a hostname.
 
 A null \fItransport\fR and null \fInexthop\fR result means "do
 not change": use the delivery transport and nexthop information
index b36119748a419a03abd4204ee5b2f0187910cfe8..a801de872740a253ec51bddcfda5b0526aed3add 100644 (file)
@@ -33,10 +33,10 @@ in "too many connections" errors. The solution:
 .sp
 virtual_alias_maps =
 .ti +4
-proxy:mysql:/etc/postfix/virtual.cf
+proxy:mysql:/etc/postfix/virtual_alias.cf
 .sp
 The total number of connections is limited by the number of
-proxymap server server processes.
+proxymap server processes.
 .PP
 The proxymap server implements the following requests:
 .IP "\fBPROXY_REQ_OPEN\fI maptype:mapname flags\fR"
index 243a4dcecfb535176eea0bdc15c2c512e4ad9e10..e9ca553a0c1658a1cb24385ec22db3a5aff25129 100644 (file)
@@ -90,7 +90,7 @@
 #      dependent. In the case of SMTP, specify \fIhost\fR:\fIservice\fR for a
 #      non-default server port, and use [\fIhost\fR] or [\fIhost\fR]:\fIport\fR
 #      in order to disable MX (mail exchanger) DNS lookups. The [] form
-#      can also be used with IP addresses instead of hostnames.
+#      is required when you specify an IP address instead of a hostname.
 #
 #      A null \fItransport\fR and null \fInexthop\fR result means "do
 #      not change": use the delivery transport and nexthop information
index ba7b6bf326385e7343d4d084159e0a401f61b6ff..78baa9b0520a3c95bd15673ec50c483edb2faa40 100644 (file)
@@ -311,8 +311,10 @@ static void cleanup_sig(int sig)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 9f8e01e41bec650fa59dc4b2cf7c69e1bb9e5e74..5fda0d9de0b9c0a749730ebb8a4e1b5e0eeaa37c 100644 (file)
@@ -1345,7 +1345,8 @@ extern int var_local_rcpt_code;
                                " $" VAR_SEND_CANON_MAPS \
                                " $" VAR_RCPT_CANON_MAPS \
                                " $" VAR_RELOCATED_MAPS \
-                               " $" VAR_TRANSPORT_MAPS
+                               " $" VAR_TRANSPORT_MAPS \
+                               " $" VAR_MYNETWORKS
 extern char *var_proxy_read_maps;
 
  /*
index 0b630c3bc08766c98d5f497ab32b3d654486d906..2a57f519c24ec09f6b6843f827a9ba8c2d80dcc9 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      "20030219"
+#define MAIL_RELEASE_DATE      "20030301"
 
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "2.0.4-" MAIL_RELEASE_DATE
+#define DEF_MAIL_VERSION       "2.0.5-" MAIL_RELEASE_DATE
 extern char *var_mail_version;
 
  /*
index c9f6a05c4a84ef7777fadcdcb380ace76f5a4cd2..fc7dedc32a224a6fdadbdebe1632c4169582929e 100644 (file)
 
 /* maps_create - initialize */
 
-MAPS   *maps_create(const char *title, const char *map_names, int flags)
+MAPS   *maps_create(const char *title, const char *map_names, int dict_flags)
 {
     const char *myname = "maps_create";
     char   *temp;
@@ -130,13 +130,16 @@ MAPS   *maps_create(const char *title, const char *map_names, int flags)
        bufp = temp = mystrdup(map_names);
        map_type_name_flags = vstring_alloc(10);
 
+#define OPEN_FLAGS     O_RDONLY
+
        while ((map_type_name = mystrtok(&bufp, sep)) != 0) {
-           vstring_sprintf(map_type_name_flags, "%s:%o", map_type_name, flags);
+           vstring_sprintf(map_type_name_flags, "%s(%o,%o)",
+                           map_type_name, OPEN_FLAGS, dict_flags);
            if ((dict = dict_handle(vstring_str(map_type_name_flags))) == 0)
-               dict = dict_open(map_type_name, O_RDONLY, flags);
-           if ((dict->flags & flags) != flags)
+               dict = dict_open(map_type_name, OPEN_FLAGS, dict_flags);
+           if ((dict->flags & dict_flags) != dict_flags)
                msg_panic("%s: map %s has flags 0%o, want flags 0%o",
-                         myname, map_type_name, dict->flags, flags);
+                         myname, map_type_name, dict->flags, dict_flags);
            dict_register(vstring_str(map_type_name_flags), dict);
            argv_add(maps->argv, vstring_str(map_type_name_flags), ARGV_END);
        }
index c17cc2123b3a03ac0eb52bf2c0661779264cfc24..e1f36e45a6a951abef91f9ba93082c848009e8a3 100644 (file)
@@ -498,8 +498,10 @@ static void cleanup(void)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        cleanup();
        exit(0);
     }
index d6019f441f6f453a925daf9821a2993bb94d466e..0aff9f290c35b254a62376bd66b6379373cc1cc1 100644 (file)
@@ -654,8 +654,10 @@ static void local_mask_init(void)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index cd1e72b1e5d1224e24c8245f5167b99bbc8be8f0..1c37cdef4d6a5ccc74a52eb1335fa2a39629c756 100644 (file)
@@ -473,8 +473,10 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 8dc0fe7f04950cde78dbd2aeaf6ec6406fd7abdc..5a0de2882e0a073c61f93e68aab452b5c7794d27 100644 (file)
@@ -941,8 +941,10 @@ static void pipe_service(VSTREAM *client_stream, char *service, char **argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 4a88d6e25d6c47de6879f101679cf556599fcd13..82364b8ad616ef7534a446bb2984574ba8167f50 100644 (file)
@@ -5,7 +5,7 @@
 /*     Postfix alias database maintenance
 /* SYNOPSIS
 /* .fi
-/*     \fBpostalias\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
+/*     \fBpostalias\fR [\fB-Nfinoprvw\fR] [\fB-c \fIconfig_dir\fR]
 /*             [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
 /*             [\fIfile_type\fR:]\fIfile_name\fR ...
 /* DESCRIPTION
@@ -22,6 +22,9 @@
 /*     entire database, in order to avoid surprises in spectator
 /*     programs.
 /*
+/*     The format of Postfix alias input files is described in
+/*     \fBaliases\fR(5).
+/*
 /*     Options:
 /* .IP \fB-N\fR
 /*     Include the terminating null character that terminates lookup keys
 /*     Do not release root privileges when processing a non-root
 /*     input file. By default, \fBpostalias\fR drops root privileges
 /*     and runs as the source file owner instead.
+/* .IP \fB-p\fR
+/*     Do not inherit the file access permissions from the input file
+/*     when creating a new file.  Instead, create a new file with default
+/*     access permissions (mode 0644).
 /* .IP "\fB-q \fIkey\fR"
 /*     Search the specified maps for \fIkey\fR and print the first value
 /*     found on the standard output stream. The exit status is zero
 /*     RFC 822 (ARPA Internet Text Messages)
 /* SEE ALSO
 /*     aliases(5) format of alias database input file.
+/*     local(5) Postfix local delivery agent.
 /*     sendmail(1) mail posting and compatibility interface.
 /* LICENSE
 /* .ad
 #define STR    vstring_str
 
 #define POSTALIAS_FLAG_AS_OWNER        (1<<0)  /* open dest as owner of source */
+#define POSTALIAS_FLAG_SAVE_PERM       (1<<1)  /* copy access permission
+                                                * from source */
 
 /* postalias - create or update alias database */
 
@@ -215,7 +225,7 @@ static void postalias(char *map_type, char *path_name, int postalias_flags,
     /*
      * Turn off group/other read permissions as indicated in the source file.
      */
-    if (S_ISREG(st.st_mode))
+    if ((postalias_flags & POSTALIAS_FLAG_SAVE_PERM) && S_ISREG(st.st_mode))
        saved_mask = umask(022 | (~st.st_mode & 077));
 
     /*
@@ -237,7 +247,7 @@ static void postalias(char *map_type, char *path_name, int postalias_flags,
     /*
      * And restore the umask, in case it matters.
      */
-    if (S_ISREG(st.st_mode))
+    if ((postalias_flags & POSTALIAS_FLAG_SAVE_PERM) && S_ISREG(st.st_mode))
        umask(saved_mask);
 
     /*
@@ -498,7 +508,7 @@ int     main(int argc, char **argv)
     int     fd;
     char   *slash;
     struct stat st;
-    int     postalias_flags = POSTALIAS_FLAG_AS_OWNER;
+    int     postalias_flags = POSTALIAS_FLAG_AS_OWNER | POSTALIAS_FLAG_SAVE_PERM;
     int     open_flags = O_RDWR | O_CREAT | O_TRUNC;
     int     dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_KEY;
     char   *query = 0;
@@ -538,7 +548,7 @@ int     main(int argc, char **argv)
     /*
      * Parse JCL.
      */
-    while ((ch = GETOPT(argc, argv, "Nc:d:finoq:rvw")) > 0) {
+    while ((ch = GETOPT(argc, argv, "Nc:d:finopq:rvw")) > 0) {
        switch (ch) {
        default:
            usage(argv[0]);
@@ -569,6 +579,9 @@ int     main(int argc, char **argv)
        case 'o':
            postalias_flags &= ~POSTALIAS_FLAG_AS_OWNER;
            break;
+       case 'p':
+           postalias_flags &= ~POSTALIAS_FLAG_SAVE_PERM;
+           break;
        case 'q':
            if (query || delkey)
                msg_fatal("specify only one of -q or -d");
index cd3d6887e0079487f8edc4c4f63bbc125564f8e5..2c425e5c45319f19775c0831e6e31673d09d2c19 100644 (file)
@@ -5,7 +5,7 @@
 /*     Postfix lookup table management
 /* SYNOPSIS
 /* .fi
-/*     \fBpostmap\fR [\fB-Nfinorvw\fR] [\fB-c \fIconfig_dir\fR]
+/*     \fBpostmap\fR [\fB-Nfinoprvw\fR] [\fB-c \fIconfig_dir\fR]
 /*             [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
 /*             [\fIfile_type\fR:]\fIfile_name\fR ...
 /* DESCRIPTION
@@ -23,7 +23,9 @@
 /*     postponed, and an exclusive, advisory, lock is placed on the
 /*     entire table, in order to avoid surprises in spectator
 /*     programs.
-/*
+/* INPUT FILE FORMAT
+/* .ad
+/* .fi
 /*     The format of a lookup table input file is as follows:
 /* .IP \(bu
 /*     A table entry has the form
@@ -42,8 +44,9 @@
 /*     databases, quotes cannot be used to protect lookup keys that contain
 /*     special characters such as `#' or whitespace. The \fIkey\fR is mapped
 /*     to lowercase to make mapping lookups case insensitive.
-/*
-/*     Options:
+/* COMMAND-LINE ARGUMENTS
+/* .ad
+/* .fi
 /* .IP \fB-N\fR
 /*     Include the terminating null character that terminates lookup keys
 /*     and values. By default, Postfix does whatever is the default for
 /*     Do not release root privileges when processing a non-root
 /*     input file. By default, \fBpostmap\fR drops root privileges
 /*     and runs as the source file owner instead.
+/* .IP \fB-p\fR
+/*     Do not inherit the file access permissions from the input file
+/*     when creating a new file.  Instead, create a new file with default
+/*     access permissions (mode 0644).
 /* .IP "\fB-q \fIkey\fR"
 /*     Search the specified maps for \fIkey\fR and print the first value
 /*     found on the standard output stream. The exit status is zero
 #define STR    vstring_str
 
 #define POSTMAP_FLAG_AS_OWNER  (1<<0)  /* open dest as owner of source */
+#define POSTMAP_FLAG_SAVE_PERM (1<<1)  /* copy access permission from source */
 
 /* postmap - create or update mapping database */
 
@@ -221,7 +229,7 @@ static void postmap(char *map_type, char *path_name, int postmap_flags,
     /*
      * Turn off group/other read permissions as indicated in the source file.
      */
-    if (S_ISREG(st.st_mode))
+    if ((postmap_flags & POSTMAP_FLAG_SAVE_PERM) && S_ISREG(st.st_mode))
        saved_mask = umask(022 | (~st.st_mode & 077));
 
     /*
@@ -243,7 +251,7 @@ static void postmap(char *map_type, char *path_name, int postmap_flags,
     /*
      * And restore the umask, in case it matters.
      */
-    if (S_ISREG(st.st_mode))
+    if ((postmap_flags & POSTMAP_FLAG_SAVE_PERM) && S_ISREG(st.st_mode))
        umask(saved_mask);
 
     /*
@@ -448,7 +456,7 @@ int     main(int argc, char **argv)
     int     fd;
     char   *slash;
     struct stat st;
-    int     postmap_flags = POSTMAP_FLAG_AS_OWNER;
+    int     postmap_flags = POSTMAP_FLAG_AS_OWNER | POSTMAP_FLAG_SAVE_PERM;
     int     open_flags = O_RDWR | O_CREAT | O_TRUNC;
     int     dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_KEY;
     char   *query = 0;
@@ -488,7 +496,7 @@ int     main(int argc, char **argv)
     /*
      * Parse JCL.
      */
-    while ((ch = GETOPT(argc, argv, "Nc:d:finoq:rvw")) > 0) {
+    while ((ch = GETOPT(argc, argv, "Nc:d:finopq:rvw")) > 0) {
        switch (ch) {
        default:
            usage(argv[0]);
@@ -519,6 +527,9 @@ int     main(int argc, char **argv)
        case 'o':
            postmap_flags &= ~POSTMAP_FLAG_AS_OWNER;
            break;
+       case 'p':
+           postmap_flags &= ~POSTMAP_FLAG_SAVE_PERM;
+           break;
        case 'q':
            if (query || delkey)
                msg_fatal("specify only one of -q or -d");
index 0caed2983eb6554c55dbe3ad0f6e313f9ae2d68d..618d585959e89ead5588b8459efb2fc00da76375 100644 (file)
 /* .sp
 /*     virtual_alias_maps =
 /* .ti +4
-/*     proxy:mysql:/etc/postfix/virtual.cf
+/*     proxy:mysql:/etc/postfix/virtual_alias.cf
 /* .sp
 /*     The total number of connections is limited by the number of
-/*     proxymap server server processes.
+/*     proxymap server processes.
 /* .PP
 /*     The proxymap server implements the following requests:
 /* .IP "\fBPROXY_REQ_OPEN\fI maptype:mapname flags\fR"
@@ -332,6 +332,18 @@ static void proxymap_service(VSTREAM *client_stream, char *unused_service,
     vstream_fflush(client_stream);
 }
 
+/* dict_proxy_open - intercept remote map request from inside library */
+
+DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
+{
+    if (msg_verbose)
+       msg_info("dict_proxy_open(%s, 0%o, 0%o) called from internal routine",
+                map, open_flags, dict_flags);
+    while (strncmp(map, PROXY_COLON, PROXY_COLON_LEN) == 0)
+       map += PROXY_COLON_LEN;
+    return (dict_open(map, open_flags, dict_flags));
+}
+
 /* post_jail_init - initialization after privilege drop */
 
 static void post_jail_init(char *unused_name, char **unused_argv)
@@ -371,8 +383,10 @@ static void post_jail_init(char *unused_name, char **unused_argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("some lookup table has changed -- restarting");
+    const char *table;
+
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 9ecfa116b5cc41bf5c1a725fd7cf0c3dbdb86bc9..63a8e2dbaa9ead23c8aa545c84aaa51e7184774c 100644 (file)
@@ -425,8 +425,10 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index a125c52accc0c981096b75859b28dc6ab98cd832..4fe2cc8bda528767035e9f90ee3c8578206a250b 100644 (file)
@@ -662,8 +662,10 @@ static void qmqpd_service(VSTREAM *stream, char *unused_service, char **argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("lookup table has changed -- exiting");
+    const char *table;
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 420006b02d2051e3ef4dfcca46ec1e1b3fe87b46..8e8e9519beae24f4cf78d091c6f9f83a970963f6 100644 (file)
@@ -416,8 +416,10 @@ static void pre_init(char *unused_name, char **unused_argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 03a4d2c7adfb16d341733e4253ceb3f8afdc1ade..e5514116b098bb5749f905879fc1b9c8fa583342 100644 (file)
@@ -1000,6 +1000,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
     int     prev_rec_type;
     int     first = 1;
     VSTRING *why = 0;
+    int     saved_err;
 
     /*
      * Sanity checks. With ESMTP command pipelining the client can send DATA
@@ -1160,12 +1161,13 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
     /*
      * Cleanup. The client may send another MAIL command.
      */
+    saved_err = state->err;
     chat_reset(state, var_smtpd_hist_thrsh);
     mail_reset(state);
     rcpt_reset(state);
     if (why)
        vstring_free(why);
-    return (state->err);
+    return (saved_err);
 }
 
 /* rset_cmd - process RSET */
@@ -1479,7 +1481,7 @@ static void smtpd_proto(SMTPD_STATE *state)
        }
 
        for (;;) {
-           if (state->error_count > var_smtpd_hard_erlim) {
+           if (state->error_count >= var_smtpd_hard_erlim) {
                state->reason = "too many errors";
                state->error_mask |= MAIL_ERROR_PROTOCOL;
                smtpd_chat_reply(state, "421 Error: too many errors");
@@ -1604,8 +1606,10 @@ static void smtpd_service(VSTREAM *stream, char *unused_service, char **argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("lookup table has changed -- exiting");
+    const char *table;
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 1769336691598ed26a002cbf29a730ce2378feab..2bb42adae1b1de17fd859de08af3ec23c2ada4ab 100644 (file)
@@ -157,7 +157,7 @@ void    smtpd_chat_reply(SMTPD_STATE *state, char *format,...)
      * sleep-on-anything slows down clients that make an excessive number of
      * errors within a session.
      */
-    if (state->error_count > var_smtpd_soft_erlim)
+    if (state->error_count >= var_smtpd_soft_erlim)
        sleep(delay = (state->error_count > var_smtpd_err_sleep ?
                       state->error_count : var_smtpd_err_sleep));
     else if (STR(state->buffer)[0] == '4' || STR(state->buffer)[0] == '5')
index b63a63b78370a06a93843f98231b2c5c014e85d0..d33824a8d44b03c5c1147b534359f8ab98ba7ddb 100644 (file)
@@ -281,8 +281,10 @@ static void spawn_service(VSTREAM *client_stream, char *service, char **argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index 759e8e3170e91837e1ca3e504fe1a7eafe226ea1..3b80db5dc2a2241335089689ada0dc9ea7e36ef8 100644 (file)
@@ -284,8 +284,10 @@ static void rewrite_service(VSTREAM *stream, char *unused_service, char **argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }
index e19587781f4a06f78b9beea19387774bfcef93bc..538dbc95bf25f166f0767f1e27e35d2795f84fb8 100644 (file)
@@ -47,7 +47,7 @@
 /*     void    (*action)(dict_name, dict_handle, context)
 /*     char    *context;
 /*
-/*     int     dict_changed()
+/*     const char *dict_changed_name()
 /* AUXILIARY FUNCTIONS
 /*     void    dict_load_file(dict_name, path)
 /*     const char *dict_name;
 /* .IP "char *context"
 /*     Application context from the caller.
 /* .PP
-/*     dict_changed() returns non-zero when any dictionary needs to
+/*     dict_changed_name() returns non-zero when any dictionary needs to
 /*     be re-opened because it has changed or because it was unlinked.
+/*     A non-zero result is the name of a changed dictionary.
 /*
 /*     dict_load_file() reads name-value entries from the named file.
 /*     Lines that begin with whitespace are concatenated to the preceding
@@ -493,16 +494,16 @@ void    dict_walk(DICT_WALK_ACTION action, char *ptr)
     myfree((char *) ht_info_list);
 }
 
-/* dict_changed - see if any dictionary has changed */
+/* dict_changed_name - see if any dictionary has changed */
 
-int     dict_changed(void)
+const char *dict_changed_name(void)
 {
-    char   *myname = "dict_changed";
+    char   *myname = "dict_changed_name";
     struct stat st;
     HTABLE_INFO **ht_info_list;
     HTABLE_INFO **ht;
     HTABLE_INFO *h;
-    int     status;
+    const char *status;
     DICT   *dict;
 
     ht_info_list = htable_list(dict_table);
@@ -514,8 +515,16 @@ int     dict_changed(void)
            msg_warn("%s: table %s: null time stamp", myname, h->key);
        if (fstat(dict->stat_fd, &st) < 0)
            msg_fatal("%s: fstat: %m", myname);
-       status = (st.st_mtime != dict->mtime || st.st_nlink == 0);
+       if (st.st_mtime != dict->mtime || st.st_nlink == 0)
+           status = h->key;
     }
     myfree((char *) ht_info_list);
     return (status);
 }
+
+/* dict_changed - backwards compatibility */
+
+int     dict_changed(void)
+{
+    return (dict_changed_name() != 0);
+}
index 6f30e2fd7adce7f6a451307705cf6523c3df9dd8..5dfea824e90f2046f5c7029b82e0985d05b7056b 100644 (file)
@@ -109,6 +109,7 @@ extern void dict_open_register(const char *, DICT *(*) (const char *, int, int))
 typedef void (*DICT_WALK_ACTION) (const char *, DICT *, char *);
 extern void dict_walk(DICT_WALK_ACTION, char *);
 extern int dict_changed(void);
+extern const char *dict_changed_name(void);
 
 /* LICENSE
 /* .ad
index f949502835d6ee9bdbc25d0c641165f511aa50d8..1ce24cb9b8eb3b14f2b4c087c17dd20f902798b9 100644 (file)
@@ -395,7 +395,7 @@ int     main(int argc, char **argv)
            vstream_fflush(VSTREAM_OUT);
            continue;
        }
-       if (dict_changed())
+       if (dict_changed_name())
            msg_warn("dictionary has changed");
        key = vstring_str(unescape(keybuf, mystrtok(&bufp, " =")));
        value = mystrtok(&bufp, " =");
index 3d9e71c3f00dcdf1eeb77406b3e8f573ba40cb78..074c8f33c7834cf465b82f8144f4e64d264a909e 100644 (file)
@@ -106,7 +106,15 @@ static ARGV *match_list_parse(ARGV *list, char *string)
     char   *bp = string;
     char   *pattern;
     char   *cp;
+    char   *map_type_name;
+    char   *map_type_name_flags;
 
+    /*
+     * XXX We do not support ! before /filename, because the file contents
+     * are expanded in-line. Fixing this requires separating the operator (!)
+     * from its operands (file content) so that the operator can apply to a
+     * group of operands.
+     */
     while ((pattern = mystrtok(&bp, delim)) != 0) {
        if (*pattern == '/') {                  /* /file/name */
            if (buf == 0)
@@ -119,12 +127,19 @@ static ARGV *match_list_parse(ARGV *list, char *string)
            if (vstream_fclose(fp))
                msg_fatal("%s: read file %s: %m", myname, pattern);
        } else if (strchr(pattern, ':') != 0) { /* type:table */
-           for (cp = pattern; *cp == '!'; cp++)
+           if (buf == 0)
+               buf = vstring_alloc(10);
+#define OPEN_FLAGS     O_RDONLY
+#define DICT_FLAGS     DICT_FLAG_LOCK
+#define STR(x)         vstring_str(x)
+           for (map_type_name = pattern; *map_type_name == '!'; map_type_name++)
                 /* void */ ;
-           if (dict_handle(pattern) == 0)
-               dict_register(pattern,
-                             dict_open(pattern, O_RDONLY, DICT_FLAG_LOCK));
-           argv_add(list, pattern, (char *) 0);
+           vstring_sprintf(buf, "%s(%o,%o)", pattern, OPEN_FLAGS, DICT_FLAGS);
+           map_type_name_flags = STR(buf) + (map_type_name - pattern);
+           if (dict_handle(map_type_name_flags) == 0)
+               dict_register(map_type_name_flags,
+                             dict_open(map_type_name, OPEN_FLAGS, DICT_FLAGS));
+           argv_add(list, STR(buf), (char *) 0);
        } else {                                /* other pattern */
            argv_add(list, pattern, (char *) 0);
        }
index d1735d9f8faf269dde62d85a5b635a3b66b3dd80..e084d5cfb2275188eebbfb09f4d890b5b74fe482 100644 (file)
@@ -334,10 +334,19 @@ extern int opterr;
 #define SUPPORTED
 #include <sys/types.h>
 #define MISSING_SETENV
+#define USE_PATHS_H
+#ifndef _PATH_BSHELL
 #define _PATH_BSHELL   "/bin/sh"
+#endif
+#ifndef _PATH_MAILDIR
 #define _PATH_MAILDIR   "/var/spool/mail"      /* paths.h lies */
+#endif
+#ifndef _PATH_DEFPATH
 #define _PATH_DEFPATH  "/usr/bin:/usr/ucb"
+#endif
+#ifndef _PATH_STDPATH
 #define _PATH_STDPATH  "/usr/bin:/usr/sbin:/usr/ucb"
+#endif
 #define HAS_FCNTL_LOCK
 #define INTERNAL_LOCK  MYFLOCK_STYLE_FCNTL
 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
@@ -349,14 +358,12 @@ extern int opterr;
 #define HAS_NIS
 #define HAS_SA_LEN
 #define GETTIMEOFDAY(t)        gettimeofday(t,(struct timezone *) 0)
-#define RESOLVE_H_NEEDS_STDIO_H
 #define ROOT_PATH      "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
-#define SOCKADDR_SIZE  size_t
-#define SOCKOPT_SIZE   size_t
+#define SOCKADDR_SIZE  socklen_t
+#define SOCKOPT_SIZE   socklen_t
 #define USE_STATVFS
 #define STATVFS_IN_SYS_STATVFS_H
-#define STRCASECMP_IN_STRINGS_H
-#define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
+#define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
 #define NATIVE_MAILQ_PATH "/usr/sbin/mailq"
 #define NATIVE_NEWALIAS_PATH "/usr/sbin/newaliases"
 #define NATIVE_COMMAND_DIR "/usr/sbin"
index e0896f0b0418086f0c06b013b156d45c30714605..86690fae8159d710b54f7c0b812f6ff684c60904 100644 (file)
@@ -395,8 +395,10 @@ static void local_service(VSTREAM *stream, char *service, char **argv)
 
 static void pre_accept(char *unused_name, char **unused_argv)
 {
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
+    const char *table;
+    if ((table = dict_changed_name()) != 0) {
+       msg_info("table %s has changed -- restarting", table);
        exit(0);
     }
 }