]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-19990627
authorWietse Venema <wietse@porcupine.org>
Sun, 27 Jun 1999 05:00:00 +0000 (00:00 -0500)
committerWietse Venema <wietse@porcupine.org>
Thu, 17 Jan 2013 03:55:07 +0000 (22:55 -0500)
127 files changed:
postfix/.indent.pro
postfix/0README
postfix/HISTORY
postfix/LICENSE
postfix/MYSQL_README [new file with mode: 0644]
postfix/Makefile.in
postfix/RELEASE_NOTES
postfix/ULTRIX_README [new file with mode: 0644]
postfix/bin/.keep [changed mode: 0644->0755]
postfix/bounce/.indent.pro
postfix/bounce/Makefile.in
postfix/cleanup/.indent.pro
postfix/cleanup/Makefile.in
postfix/cleanup/cleanup_envelope.c
postfix/cleanup/cleanup_extracted.c
postfix/cleanup/cleanup_map11.c
postfix/cleanup/cleanup_message.c
postfix/cleanup/cleanup_out.c
postfix/cleanup/cleanup_skip.c
postfix/conf/LICENSE
postfix/conf/main.cf
postfix/conf/main.cf.default [deleted file]
postfix/conf/postfix-script-nosgid
postfix/conf/postfix-script-sgid
postfix/conf/sample-local.cf
postfix/dns/.indent.pro
postfix/dns/Makefile.in
postfix/error/.indent.pro
postfix/error/Makefile.in
postfix/fsstone/.indent.pro
postfix/fsstone/Makefile.in
postfix/global/.indent.pro
postfix/global/Makefile.in
postfix/global/dot_lockfile.c
postfix/global/dot_lockfile_as.c [new file with mode: 0644]
postfix/global/dot_lockfile_as.h [new file with mode: 0644]
postfix/global/mail_params.c
postfix/global/mail_params.h
postfix/global/mail_version.h
postfix/global/pipe_command.c
postfix/html/Makefile.in
postfix/html/faq.html
postfix/html/local.8.html
postfix/html/postalias.1.html
postfix/html/uce.html
postfix/libexec/.keep [changed mode: 0644->0755]
postfix/local/.indent.pro
postfix/local/Makefile.in
postfix/local/alias.c
postfix/local/command.c
postfix/local/deliver_attr.c
postfix/local/dotforward.c
postfix/local/feature.c [deleted file]
postfix/local/file.c
postfix/local/forward.c
postfix/local/local.c
postfix/local/local.h
postfix/local/mailbox.c
postfix/local/maildir.c
postfix/local/recipient.c
postfix/local/token.c
postfix/makedefs
postfix/man/Makefile.in
postfix/man/man1/postalias.1
postfix/man/man8/local.8
postfix/master/.indent.pro
postfix/master/Makefile.in
postfix/master/master_spawn.c
postfix/pickup/.indent.pro
postfix/pickup/Makefile.in
postfix/pipe/.indent.pro
postfix/pipe/Makefile.in
postfix/postalias/.indent.pro
postfix/postalias/Makefile.in
postfix/postalias/postalias.c
postfix/postcat/.indent.pro
postfix/postcat/Makefile.in
postfix/postconf/.indent.pro
postfix/postconf/Makefile.in
postfix/postdrop/.indent.pro
postfix/postdrop/Makefile.in
postfix/postfix/.indent.pro
postfix/postfix/Makefile.in
postfix/postkick/.indent.pro
postfix/postkick/Makefile.in
postfix/postlock/.indent.pro
postfix/postlock/Makefile.in
postfix/postlog/.indent.pro
postfix/postlog/Makefile.in
postfix/postmap/.indent.pro
postfix/postmap/Makefile.in
postfix/postsuper/.indent.pro
postfix/postsuper/Makefile.in
postfix/qmgr/.indent.pro
postfix/qmgr/Makefile.in
postfix/sendmail/.indent.pro
postfix/sendmail/Makefile.in
postfix/showq/.indent.pro
postfix/showq/Makefile.in
postfix/smtp/.indent.pro
postfix/smtp/Makefile.in
postfix/smtp/smtp.h
postfix/smtp/smtp_chat.c
postfix/smtp/smtp_connect.c
postfix/smtp/smtp_proto.c
postfix/smtp/smtp_session.c
postfix/smtp/smtp_trouble.c
postfix/smtpd/.indent.pro
postfix/smtpd/Makefile.in
postfix/smtpd/smtpd.c
postfix/smtpd/smtpd_check.c
postfix/smtpstone/.indent.pro
postfix/smtpstone/Makefile.in
postfix/trivial-rewrite/.indent.pro
postfix/trivial-rewrite/Makefile.in
postfix/util/.indent.pro
postfix/util/Makefile.in
postfix/util/dict_mysql.c [new file with mode: 0644]
postfix/util/dict_mysql.h [new file with mode: 0644]
postfix/util/dict_open.c
postfix/util/doze.c
postfix/util/dup2_pass_on_exec.c [new file with mode: 0644]
postfix/util/fsspace.c
postfix/util/sys_compat.c
postfix/util/sys_defs.h
postfix/util/timed_connect.h
postfix/util/vstream_popen.c

index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 0ba0a5255e78307bc4a6c6f737ca0869ff1ecfab..6f501299781afba434fd851e00d9cca2606e0a93 100644 (file)
@@ -39,8 +39,8 @@ On-line resources devoted to the Postfix mail system
 
 Web sites:
 
+    http://www.postfix.org/            current release information
     http://www.ibm.com/alphaworks/     the original distribution site
-    http://www.postfix.org/            post-release information
 
 Mail addresses (please do NOT send mail to my address at work):
 
@@ -81,14 +81,17 @@ an absolute path) for UNIX-style on-line manual pages.  These pages
 are also available through the HTML interface, which allows you to
 navigate faster.
 
+The RELEASE_NOTES file describes new features, and lists incompatible
+changes with respect to previous Postfix versions.
+
+The INSTALL file provides a step-by-step guide for building and
+installing Postfix on many popular UNIX platforms.
+
 The COMPATIBILITY file lists features that Postfix does or does
 not yet implement, and how well it works with other software.
 
 The HISTORY file gives a detailed log of changes to the software.
 
-The INSTALL file provides a step-by-step guide for building and
-installing Postfix on many popular UNIX platforms.
-
 The PORTING file discusses how to go about porting Postfix to other
 UNIX platforms. Some people are looking into a port to Windows NT.
 We'll see. This software uses every trick in the book that I learned
@@ -125,6 +128,7 @@ Postfix daemons:
 
     bounce/            Bounce or defer mail
     cleanup/           Canonicalize and enqueue mail
+    error/             Trivial error mailer
     local/             Local delivery
     master/            Postfix resident superserver
     pickup/            Local pickup
@@ -142,7 +146,8 @@ Test programs:
 
 Miscellaneous:
 
-    bin/               Installed programs
+    bin/               Postfix command executables
     conf/              Sample configuration files
     include/           Installed include files
     lib/               Installed object libraries
+    libexec/           Postfix daemon executables
index cc6a04edf141f738b52d2b7820c4fac24a2ce686..4c8056521da1deb9d1149a36e241aa655aafd22a 100644 (file)
@@ -1977,7 +1977,8 @@ Apologies for any names omitted.
 19990121
 
        Feature: pickup (again) logs uid and sender address.
-       On repeated request by Scott Cotton, Internet, IC Group, Inc.
+       On repeated request by Scott Cotton, Internet Consultants
+       Group, Inc.
 
        Portability: doze() function for systems without usleep().
 
@@ -2796,8 +2797,93 @@ Apologies for any names omitted.
        user@[ip_address] regardless of destination. Eric Cholet
        had the honor of suffering from this one.
 
-1990601
+19990527
+
+       More SMTP client logging for easier debugging: the smtp
+       client now logs hostname[ip.addr], and logs every failed
+       attempt to reach an MX host, not just the last one.
+
+19990601
 
        Bugfix: emit a blank line before a MIME boundary; the line
        is part of the boundary. File: bounce/bounce_notify_service.c.
        Wolfgang Segmuller, IBM Research.
+
+19990610
+
+       Bugfix: the "is this the loopback interface" test was
+       broken.  Reported by Claus Fischer @microworld.com.
+       File: smtp/smtp_connect.c.
+
+       Usability: added helpful warnings about restrictions that
+       are being ignored after check_relay_domains, etc.
+
+       Portability: Reliant Unix support by Gert-Jan Looy, Siemens,
+       the Netherlands.
+
+19990611
+
+       Robustness: the postfix-script start-up procedure now
+       detects a missing master program, avoiding misleading
+       warnings that the mail system is already running.  Fix
+       suggested by David E. Smith @technopagan.org.
+
+       Portability: Mac OS X Server Port by Mark Miller @swoon.net.
+
+       Feature: on systems that use dotlock files for mailbox
+       locking, the local delivery agent now will attempt to use
+       dotlock files when delivering to user-specified files.
+       Dotlock files for user-specified destinations are created
+       with the privileges of the user. For backwards compatibility,
+       Postfix will attempt to create dotlocks for user-specified
+       destinations only when the user has parent directory write
+       permission.
+
+       Feature: specify "expand_owner_alias = yes" in order to
+       use the right-hand side of an owner- alias, instead of
+       using the left-hand side address. Needed by Juergen Georgi.
+
+19990622
+
+       Bugfix: the local delivery agent did not set user attributes
+       when delivering to root, so that forward_path did not expand
+       properly. Found by Jozsef Kadlecsik, KFKI Research Institute
+       for Particle and Nuclear Physics, Hungary.  File:
+       local/dotforward.c.
+
+       Bugfix: the unix:passwd.byname mechanism is not suitable
+       for smtpd access control - the user name would have to end
+       in @, or the access control software would have to be
+       changed. Removed the example from the RELEASE_NOTES file.
+
+19990623
+
+       Bugfix: the smtp server did not reset the error flag after
+       ".". Found by James Ponder, Oaktree Internet Solutions Ltd.
+       File: smtpd/smtpd.c.
+
+       Bugfix: fencepost error in the doze() routine (an usleep()
+       replacement for systems without one). Found by Simon J Mudd.
+       File: util/doze.c.
+
+19990624
+
+       Portability: support for AIX 3.2.5 (!) by Florian Lohoff
+       @rfc822.org.
+
+       Portability: Ultrix 4.3 support by Christian von Roques
+       @pond.sub.org.
+
+       Feature: mysql support by Scott Cotton and Joshua Marcus,
+       Internet Consultants Group, Inc. Files: util/dict_myqsl.*.
+
+19990627
+
+       Bugfix: Postfix is now distributed under the new IBM Public
+       License (version 1, dated June 14, 1999).
+
+       Feature: the Delivered-To: header can be turned off for
+       delivery to command or file/mailbox. The default setting
+       is:  "prepend_delivered_header = command, file, forward".
+       Turning off the Delivered-To: header when forwarding mail
+       is not recommended.
index 5e83ceb25d9a095ba705b9d8c6d8458f21d91ea5..2f1ba0c2f36e00b67e93b7f5123d3c9e98fa94ab 100644 (file)
-Please read this carefully.  You must agree to the following terms and
-conditions before installing the Secure Mailer or any related
-documentation ("Software").  If you do not agree to these terms
-and conditions, you may not install or use the Software.
-
-Permission to reproduce and create derivative works from the Software
-("Software Derivative Works") is hereby granted to you under the
-copyrights of International Business Machines Corporation ("IBM").  IBM
-also grants you the right to distribute the Software and Software
-Derivative Works.
-
-You grant IBM a world-wide, royalty-free right to use, copy,
-distribute, sublicense and prepare derivative works based upon any
-feedback, including materials, error corrections, Software Derivatives,
-enhancements, suggestions and the like that you provide to IBM relating
-to the Software.
-
-IBM licenses the Software to you on an "AS IS" basis, without warranty
-of any kind.  IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES OR
-CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, NON
-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.  You are solely
-responsible for determining the appropriateness of using this Software
-and assume all risks associated with the use and distribution of this
-Software, including but not limited to the risks of program errors,
-damage to or loss of data, programs or equipment, and unavailability or
-interruption of operations.  IBM WILL NOT BE LIABLE FOR ANY DIRECT
-DAMAGES OR FOR ANY SPECIAL, INCIDENTAL, OR  INDIRECT DAMAGES OR FOR ANY
-ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS),
-EVEN IF IBM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  IBM
-will not be liable for the loss of, or damage to, your records or data,
-or any damages claimed by you based on a third party claim.  You may
-not use the name "IBM" or any other IBM trademark without the prior
-written consent of IBM.
-
-You agree to distribute the Software and any Software Derivatives under
-a license agreement that: 1) is sufficient to notify all licensees of
-the Software and Software Derivatives that IBM assumes no liability for
-any claim that may arise regarding the Software or Software
-Derivatives, and 2) that disclaims all warranties, both express and
-implied, from IBM regarding the Software and Software Derivatives.  (If
-you include this Agreement with any distribution of the Software or
-Software Derivatives you will have met this requirement.)  You agree
-that you will not delete any copyright notices in the Software.
-
-In the event an intellectual property claim is made or appears likely
-to be made with respect to the Software, you agree to permit IBM to
-enable you to continue to use the Software, or to modify it, or replace
-it with software that is at least functionally equivalent.  If IBM
-determines that none of these alternatives is reasonably available, you
-agree, at IBM's request, upon notice to you, to discontinue further
-distribution of the Software and to delete or destroy all copies of the
-Software you possess.  This is IBM's entire obligation to you regarding
-any claim of infringement.
-
-This Agreement is the exclusive statement of your rights in the
-Software as provided by IBM. Except for the licenses granted to you in
-the second paragraph above, no other licenses are granted hereunder, by
-estoppel, implication or otherwise.
+IBM PUBLIC LICENSE VERSION 1.0 6/14/1999 - SECURE MAILER
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS IBM PUBLIC
+LICENSE ("AGREEMENT").  ANY USE, REPRODUCTION OR DISTRIBUTION OF THE
+PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1.  DEFINITIONS
+
+"Contribution" means:  
+    a) in the case of International Business Machines Corporation ("IBM"), 
+       the Original Program, and 
+    b) in the case of each Contributor, 
+       i)  changes to the Program, and
+       ii) additions to the Program;
+           where such changes and/or additions to the Program originate
+           from and are distributed by that particular Contributor.  
+           A Contribution 'originates' from a Contributor if it was added 
+           to the Program by such Contributor itself or anyone acting on 
+           such Contributor's behalf.  
+    Contributions do not include additions to the Program which:
+       (i)  are separate modules of software distributed in conjunction 
+            with the Program under their own license agreement, and 
+       (ii) are not derivative works of the Program.
+
+"Contributor" means IBM and any other entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which
+are necessarily infringed by the use or sale of its Contribution alone
+or when combined with the Program.
+
+"Original Program" means the original version of the software accompanying
+this Agreement as released by IBM, including source code, object code
+and documentation, if any.
+
+"Program" means the Original Program and Contributions.
+
+"Recipient" means anyone who receives the Program under this Agreement, 
+including all Contributors.
+
+2.  GRANT OF RIGHTS
+
+    a) Subject to the terms of this Agreement, each Contributor hereby
+    grants Recipient a non-exclusive, worldwide, royalty-free copyright
+    license to reproduce, prepare derivative works of, publicly display,
+    publicly perform, distribute and sublicense the Contribution of such
+    Contributor, if any, and such derivative works, in source code and
+    object code form.
+
+    b) Subject to the terms of this Agreement, each Contributor hereby
+    grants Recipient a non-exclusive, worldwide, royalty-free patent
+    license under Licensed Patents to make, use, sell, offer to sell,
+    import and otherwise transfer the Contribution of such Contributor,
+    if any, in source code and object code form.  This patent license
+    shall apply to the combination of the Contribution and the Program
+    if, at the time the Contribution is added by the Contributor, such
+    addition of the Contribution causes such combination to be covered
+    by the Licensed Patents.  The patent license shall not apply to any
+    other combinations which include the Contribution.  No hardware per
+    se is licensed hereunder.
+
+    c) Recipient understands that although each Contributor grants the
+    licenses to its Contributions set forth herein, no assurances are
+    provided by any Contributor that the Program does not infringe the
+    patent or other intellectual property rights of any other entity.
+    Each Contributor disclaims any liability to Recipient for claims
+    brought by any other entity based on infringement of intellectual
+    property rights or otherwise.  As a condition to exercising the rights
+    and licenses granted hereunder, each Recipient hereby assumes sole
+    responsibility to secure any other intellectual property rights
+    needed, if any.  For example, if a third party patent license
+    is required to allow Recipient to distribute the Program, it is
+    Recipient's responsibility to acquire that license before distributing
+    the Program.
+
+    d) Each Contributor represents that to its knowledge it has sufficient
+    copyright rights in its Contribution, if any, to grant the copyright
+    license set forth in this Agreement.
+
+3.  REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form 
+under its own license agreement, provided that:
+    a) it complies with the terms and conditions of this Agreement; and
+    b) its license agreement:
+       i)   effectively disclaims on behalf of all Contributors all
+            warranties and conditions, express and implied, including
+            warranties or conditions of title and non-infringement, and
+            implied warranties or conditions of merchantability and fitness
+            for a particular purpose;
+       ii)  effectively excludes on behalf of all Contributors all 
+            liability for damages, including direct, indirect, special, 
+            incidental and consequential damages, such as lost profits; 
+       iii) states that any provisions which differ from this Agreement 
+            are offered by that Contributor alone and not by any other 
+            party; and
+       iv)  states that source code for the Program is available from 
+            such Contributor, and informs licensees how to obtain it in a 
+            reasonable manner on or through a medium customarily used for 
+            software exchange. 
+
+When the Program is made available in source code form:
+    a) it must be made available under this Agreement; and 
+    b) a copy of this Agreement must be included with each copy of the 
+       Program.  
+
+Each Contributor must include the following in a conspicuous location 
+in the Program: 
+
+    Copyright (c) {date here}, International Business Machines Corporation 
+    and others. All Rights Reserved.  
+
+In addition, each Contributor must identify itself as the originator of
+its Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution. 
+
+4.  COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities
+with respect to end users, business partners and the like.  While this
+license is intended to facilitate the commercial use of the Program, the
+Contributor who includes the Program in a commercial product offering
+should do so in a manner which does not create potential liability for
+other Contributors.   Therefore, if a Contributor includes the Program in
+a commercial product offering, such Contributor ("Commercial Contributor")
+hereby agrees to defend and indemnify every other Contributor
+("Indemnified Contributor") against any losses, damages and costs
+(collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor
+in connection with its distribution of the Program in a commercial
+product offering.  The obligations in this section do not apply to any
+claims or Losses relating to any actual or alleged intellectual property
+infringement.  In order to qualify, an Indemnified Contributor must:
+    a) promptly notify the Commercial Contributor in writing of such claim,
+and 
+    b) allow the Commercial Contributor to control, and cooperate with
+       the Commercial Contributor in, the defense and any related 
+       settlement negotiations.  The Indemnified Contributor may 
+       participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X.  That Contributor is then a Commercial
+Contributor.  If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone.  Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those performance
+claims and warranties, and if a court requires any other Contributor to
+pay any damages as a result, the Commercial Contributor must pay those
+damages.
+
+5.  NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
+ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
+EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
+CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
+PARTICULAR PURPOSE. Each Recipient is solely responsible for determining
+the appropriateness of using and distributing the Program and assumes
+all risks associated with its exercise of rights under this Agreement,
+including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. 
+
+6.  DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION
+OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7.  GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with
+respect to a patent applicable to software (including a cross-claim or
+counterclaim in a lawsuit), then any patent licenses granted by that
+Contributor to such Recipient under this Agreement shall terminate
+as of the date such litigation is filed.  In addition, If Recipient
+institutes patent litigation against any entity (including a cross-claim
+or counterclaim in a lawsuit) alleging that the Program itself (excluding
+combinations of the Program with other software or hardware) infringes
+such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails
+to comply with any of the material terms or conditions of this Agreement
+and does not cure such failure in a reasonable period of time after
+becoming aware of such noncompliance.  If all Recipient's rights under
+this Agreement terminate, Recipient agrees to cease use and distribution
+of the Program as soon as reasonably practicable.  However, Recipient's
+obligations under this Agreement and any licenses granted by Recipient
+relating to the Program shall continue and survive. 
+
+IBM may publish new versions (including revisions) of this Agreement
+from time to time.  Each new version of the Agreement will be given a
+distinguishing version number.  The Program (including Contributions)
+may always be distributed subject to the version of the Agreement under
+which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including
+its Contributions) under the new version. No one other than IBM has the
+right to modify this Agreement.  Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise.  All rights in the
+Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to
+this Agreement will bring a legal action under this Agreement more than
+one year after the cause of action arose.  Each party waives its rights
+to a jury trial in any resulting litigation. 
diff --git a/postfix/MYSQL_README b/postfix/MYSQL_README
new file mode 100644 (file)
index 0000000..97735bd
--- /dev/null
@@ -0,0 +1,89 @@
+[Code contributed by Scott Cotton and Joshua Marcus, IC Group, Inc.]
+
+We've written code to add a mysql map type.  It utilizes the mysql
+client library, which can be obtained from:
+
+                  http://www.tcx.se/download.html
+
+In order to build postfix with mysql map support, you will need to add 
+-DHAS_MYSQL and -I for the directory containing the mysql headers, and 
+the mysqlclient library (and libm) to AUXLIBS, for example:
+
+make -f Makefile.init makefiles \
+       'CCARGS=-DHAS_MYSQL -I/some/where/include/mysql' \
+       'AUXLIBS=/some/where/lib/mysql/libmysqlclient.a -lm'
+
+then, just run 'make'.
+
+Postfix installations which may benefit from using mysql map types
+include sites that have a need for instantaneous updates of
+forwarding, and sites that may benefit from having mail exchangers
+reference a networked database, possibly working in conjunction with a
+customer database of sorts.
+
+Once postfix is built with mysql support, you can specify a map type
+in main.cf like this:
+
+alias_maps = mysql:/etc/postfix/mysql-aliases.cf
+
+The file /etc/postfix/mysql-aliases.cf specifies lots of information
+telling postfix how to reference the mysql database.  An example mysql 
+map config file follows:
+
+#
+# mysql config file for alias lookups on postfix
+# comments are ok.
+#
+
+# the user name and password to log into the mysql server
+user = someone
+password = some_passwordd 
+
+# the database name on the servers
+dbname = customer_database
+
+# the table name
+table = mxaliases
+
+#
+select_field = forw_addr
+where_field = alias
+
+# you may specify additional_conditions here
+additional_conditions = and status = 'paid'
+
+# the above variables will result in a query of
+# the form: 
+# select forw_addr from mxaliases where alias = '$lookup' and status = 'paid'
+# ($lookup is escaped so if it contains single quotes or other odd
+# characters, it will not cause a parse error in the sql).
+#
+# the hosts that postfix will try to connect to
+# and query from (in the order listed)
+hosts = host1.some.domain host2.some.domain
+
+# end mysql config file
+
+Some notes:
+
+This configuration interface setup allows for multiple mysql
+databases: you can use one for a virtual table, one for an access
+table, and one for an aliases table if you want.
+
+Since sites that have a need for multiple mail exchangers may enjoy
+the convenience of using a networked mailer database, but do not want 
+to introduce a single point of failure to their system, we've included 
+the ability to have postfix reference multiple hosts for access to a
+single mysql map.  This will work if sites set up mirrored mysql
+databases on two or more hosts.  Whenever queries fail with an error
+at one host, the rest of the hosts will be tried in order.  Each host
+that is in an error state will undergo a reconnection attempt every so 
+often, and if no mysql server hosts are reachable, then mail will be
+deferred until atleast one of those hosts is reachable.
+
+Performance of postfix with mysql has not been thoroughly tested,
+however, we have found it to be stable.  Busy mail servers using mysql
+maps will generate lots of concurrent mysql clients, so the mysql
+server(s) should be run with this fact in mind.  Any further
+performance information, in addition to any feedback is most welcome.
+
index af7264a69f7f9c1a40217d23ae0f033e21f50c92..008a183c27d9b91addd9219d596f0f300a48249b 100644 (file)
@@ -13,7 +13,7 @@ makefiles Makefiles:
         (set -e; echo "[$$i]"; cd $$i; rm -f Makefile; \
         $(MAKE) -f Makefile.in Makefile); \
        done;
-       rm -f Makefile; (set -e; sh makedefs; cat Makefile.in) >Makefile
+       rm -f Makefile; (set -e; $(SHELL) makedefs; cat Makefile.in) >Makefile
 
 update printfck:
        set -e; for i in $(DIRS); do \
@@ -36,7 +36,7 @@ tidy: clean
        cp Makefile.init Makefile
        -rm -f *core */*core .nfs* .pure bin/* lib/* include/* libexec/* \
        */.nfs* */.pure *.out */*.out */*.db */*.a *~ */*~ *- */*- *.orig \
-       */*.orig *.bak */*.bak make.err
+       */*.orig *.bak */*.bak make.err conf/main.cf.default
        find . -type s -print | xargs rm -f
        find . -type d -print | xargs chmod 755
        find . -type f -print | xargs chmod a+r
index 9744e68cfe0a3967dd7bf35e0227dc3fdc1cdde0..cfa6d220fba347b4bc00c0703a09f46aeb1445b2 100644 (file)
@@ -1,3 +1,34 @@
+Incompatible changes with snapshot-19990627:
+============================================
+
+- On systems that use user.lock files to protect system mailboxes
+against simultaneous updates, Postfix now uses /file/name.lock
+files while delivering to files specified in aliases/forward/include
+files. This is a no-op when the recipient lacks directory write
+permission.
+
+Major changes with snapshot-19990627:
+=====================================
+
+Several bugfixes, none related to security.  See the HISTORY file
+for a complete list of changes.
+
+- Postfix is now distributed under IBM Public License Version 1.0
+(June 14, 1999), which does not carry the controversial termination
+clause. The new license does have a requirement that contributors
+make source code available.
+
+- The ugly Delivered-To: header can now be turned off selectively.
+The default setting is:  "prepend_delivered_header = command, file,
+forward".  Turning off the Delivered-To:  header when forwarding
+mail is not recommended.
+
+- mysql client support by Scott Cotton and Joshua Marcus, Internet
+Consultants Group, Inc. See the file MYSQL_README for instructions.
+
+- Portability to the Mac OS X Server, Reliant Unix, AIX 3.2.5 and
+Ultrix 4.3.
+
 Incompatible changes with postfix-19990601:
 ===========================================
 
@@ -167,11 +198,6 @@ queues.
 - Workaround for BSD select() collisions that cause performance
 problems on large BSD systems.
 
-- Use "$alias_maps, unix:passwd.byname" in smtpd access tables to
-recognize known local users. We're almost there with stopping
-unknown users at the RCPT TO command - the syntax for virtual maps
-and sendmail access tables is too different.
-
 - Several questionable but useful features to capture mail:
 "always_bcc = address" to capture a copy of every message that
 enters the system, and "luser_relay = address" to capture mail for
diff --git a/postfix/ULTRIX_README b/postfix/ULTRIX_README
new file mode 100644 (file)
index 0000000..ef43fe6
--- /dev/null
@@ -0,0 +1,34 @@
+To: wietse@porcupine.org (Wietse Venema)
+Subject: postfix-19990317-pl05 on Ultrix4.3a
+From: Christian von Roques <roques@pond.sub.org>
+Date: 02 Jun 1999 18:44:34 +0200
+Message-ID: <87iu96wo0d.fsf_-_@scalar.pond.sub.org>
+
+I've upgraded the MTA of our DECstation-3100 running Ultrix4.3a to
+postfix-19990317-pl05 and am sending you the patches I needed to get
+it running under Ultrix.
+
+ ...
+
+ o One of the bugs of Ultrix's /bin/sh is that shell-variables set in
+   arguments of `:' expand to garbage if expanded in here-documents.
+   Using a different shell helps.  I needed to replace all calls of
+   ``sh .../makedefs'' by ``$(SHELL) .../makedefs'' in all the
+   Makefile.in and am now able to use 
+
+       make SHELL=/bin/sh5 or zsh.
+
+ ...
+
+ o Ultrix's FD_SET_SIZE is 4096, but getdtablesize() returns 64 by
+   default, if not increased when building a new kernel.  getrlimit()
+   doesn't know RLIMIT_NOFILE.  This makes event_init() always log
+   the warning: `could allocate space for only 64 open files'.
+
+   I just reduced the threshold from 256 to 64, but this is not good.
+   The initial problem still remains: How to disable this warning on
+   Ultrix without making the source ugly?  
+
+[I have updated util/sys_defs.h, and by default set FD_SETSIZE to
+100.  This should be sufficient for a workstation. No-one would
+run a major mail hub on Ultrix 4. -- Wietse]
old mode 100644 (file)
new mode 100755 (executable)
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index f8e31328635f9f56985df361334c66eb00c160bd..f2070a7ce4eac1f50671185bb654a9bba78d60d4 100644 (file)
@@ -21,7 +21,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 2ee78f30ee578189df0aed93f168ae9304ab1e93..717854cec4e33b8a0800dc0ebdc4efba7a740e7f 100644 (file)
@@ -25,7 +25,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
@@ -117,6 +117,8 @@ cleanup_extracted.o: ../include/mymalloc.h
 cleanup_extracted.o: ../include/cleanup_user.h
 cleanup_extracted.o: ../include/record.h
 cleanup_extracted.o: ../include/rec_type.h
+cleanup_extracted.o: ../include/mail_params.h
+cleanup_extracted.o: ../include/ext_prop.h
 cleanup_extracted.o: cleanup.h
 cleanup_extracted.o: ../include/maps.h
 cleanup_extracted.o: ../include/dict.h
index e7c29bf1c8189bf9c7364d3a8597bbf916636e23..dab3525e04317bb69e876bc9e903caf9fbfff06f 100644 (file)
@@ -78,7 +78,8 @@ void    cleanup_envelope(void)
        }
        if (type == REC_TYPE_MESG) {
            if (cleanup_sender == 0 || cleanup_time == 0) {
-               msg_warn("missing sender or time envelope record");
+               msg_warn("%s: missing sender or time envelope record",
+                        cleanup_queue_id);
                cleanup_errs |= CLEANUP_STAT_BAD;
            } else {
                if (warn_time == 0 && var_delay_warn_time > 0)
@@ -90,7 +91,8 @@ void    cleanup_envelope(void)
            break;
        }
        if (strchr(REC_TYPE_ENVELOPE, type) == 0) {
-           msg_warn("unexpected record type %d in envelope", type);
+           msg_warn("%s: unexpected record type %d in envelope",
+                    cleanup_queue_id, type);
            cleanup_errs |= CLEANUP_STAT_BAD;
            break;
        }
@@ -117,7 +119,8 @@ void    cleanup_envelope(void)
                cleanup_sender = mystrdup(STR(clean_addr));
        } else if (type == REC_TYPE_RCPT) {
            if (cleanup_sender == 0) {          /* protect showq */
-               msg_warn("envelope recipient precedes sender");
+               msg_warn("%s: envelope recipient precedes sender",
+                        cleanup_queue_id);
                cleanup_errs |= CLEANUP_STAT_BAD;
                break;
            }
index 3bd442b79bdfe95c986ef0868a4489a5d4b23e91..1057273f5669049854904b063a24f7f53ed44273 100644 (file)
@@ -90,7 +90,8 @@ void    cleanup_extracted(void)
        } else if (type == REC_TYPE_END) {
            break;
        } else {
-           msg_warn("unexpected record type %d in extracted segment", type);
+           msg_warn("%s: unexpected record type %d in extracted segment",
+                    cleanup_queue_id, type);
            cleanup_errs |= CLEANUP_STAT_BAD;
            if (type >= 0)
                cleanup_skip();
index 0680191a87eecb80f95678e52ee4407671f78a04..96069324a90217dc2e66b0fe438f311ee7173bae 100644 (file)
@@ -103,8 +103,8 @@ void    cleanup_map11_external(VSTRING *addr, MAPS *maps, int propagate)
     for (count = 0; count < MAX_RECURSION; count++) {
        if ((new_addr = mail_addr_map(maps, STR(addr), propagate)) != 0) {
            if (new_addr->argc > 1)
-               msg_warn("multi-valued %s entry for %s",
-                        maps->title, STR(addr));
+               msg_warn("%s: multi-valued %s entry for %s",
+                        cleanup_queue_id, maps->title, STR(addr));
            saved_addr = mystrdup(STR(addr));
            vstring_strcpy(addr, new_addr->argv[0]);
            expand_to_self = !strcasecmp(saved_addr, STR(addr));
index 592a8696d3f7f916d15f083a73567944e5db8830..2a862e54cc3cee641d2845a07a98cf30656873f0 100644 (file)
@@ -391,7 +391,8 @@ void    cleanup_message(void)
            break;
        }
        if (strchr(REC_TYPE_CONTENT, type) == 0) {
-           msg_warn("%s: unexpected record type %d", myname, type);
+           msg_warn("%s: %s: unexpected record type %d",
+                    cleanup_queue_id, myname, type);
            cleanup_errs |= CLEANUP_STAT_BAD;
            break;
        }
index dd51383e6a950229f4ea4edab3472638a5be296b..7be237040813e84a5a6b8100b78f9b0f8efb2b3d 100644 (file)
@@ -84,7 +84,8 @@ void    cleanup_out(int type, char *string, int len)
     if (CLEANUP_OUT_OK()) {
        if (rec_put(cleanup_dst, type, string, len) < 0) {
            if (errno == EFBIG) {
-               msg_warn("queue file size limit exceeded");
+               msg_warn("%s: queue file size limit exceeded",
+                        cleanup_queue_id);
                cleanup_errs |= CLEANUP_STAT_SIZE;
            } else {
                msg_warn("%s: write queue file: %m", cleanup_queue_id);
index 00f73aa4b9778943e5f21a4564f668dbcd5d6c2b..d9d22ed5cc2794525cf7c5ea7ef60630d88c5bc2 100644 (file)
@@ -46,7 +46,7 @@ void    cleanup_skip(void)
 {
     int     type;
 
-    msg_warn("skipping further client input");
+    msg_warn("%s: skipping further client input", cleanup_queue_id);
 
     /*
      * XXX Rely on the front-end programs to enforce record size limits.
index 5e83ceb25d9a095ba705b9d8c6d8458f21d91ea5..2f1ba0c2f36e00b67e93b7f5123d3c9e98fa94ab 100644 (file)
-Please read this carefully.  You must agree to the following terms and
-conditions before installing the Secure Mailer or any related
-documentation ("Software").  If you do not agree to these terms
-and conditions, you may not install or use the Software.
-
-Permission to reproduce and create derivative works from the Software
-("Software Derivative Works") is hereby granted to you under the
-copyrights of International Business Machines Corporation ("IBM").  IBM
-also grants you the right to distribute the Software and Software
-Derivative Works.
-
-You grant IBM a world-wide, royalty-free right to use, copy,
-distribute, sublicense and prepare derivative works based upon any
-feedback, including materials, error corrections, Software Derivatives,
-enhancements, suggestions and the like that you provide to IBM relating
-to the Software.
-
-IBM licenses the Software to you on an "AS IS" basis, without warranty
-of any kind.  IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES OR
-CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, NON
-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.  You are solely
-responsible for determining the appropriateness of using this Software
-and assume all risks associated with the use and distribution of this
-Software, including but not limited to the risks of program errors,
-damage to or loss of data, programs or equipment, and unavailability or
-interruption of operations.  IBM WILL NOT BE LIABLE FOR ANY DIRECT
-DAMAGES OR FOR ANY SPECIAL, INCIDENTAL, OR  INDIRECT DAMAGES OR FOR ANY
-ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS),
-EVEN IF IBM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  IBM
-will not be liable for the loss of, or damage to, your records or data,
-or any damages claimed by you based on a third party claim.  You may
-not use the name "IBM" or any other IBM trademark without the prior
-written consent of IBM.
-
-You agree to distribute the Software and any Software Derivatives under
-a license agreement that: 1) is sufficient to notify all licensees of
-the Software and Software Derivatives that IBM assumes no liability for
-any claim that may arise regarding the Software or Software
-Derivatives, and 2) that disclaims all warranties, both express and
-implied, from IBM regarding the Software and Software Derivatives.  (If
-you include this Agreement with any distribution of the Software or
-Software Derivatives you will have met this requirement.)  You agree
-that you will not delete any copyright notices in the Software.
-
-In the event an intellectual property claim is made or appears likely
-to be made with respect to the Software, you agree to permit IBM to
-enable you to continue to use the Software, or to modify it, or replace
-it with software that is at least functionally equivalent.  If IBM
-determines that none of these alternatives is reasonably available, you
-agree, at IBM's request, upon notice to you, to discontinue further
-distribution of the Software and to delete or destroy all copies of the
-Software you possess.  This is IBM's entire obligation to you regarding
-any claim of infringement.
-
-This Agreement is the exclusive statement of your rights in the
-Software as provided by IBM. Except for the licenses granted to you in
-the second paragraph above, no other licenses are granted hereunder, by
-estoppel, implication or otherwise.
+IBM PUBLIC LICENSE VERSION 1.0 6/14/1999 - SECURE MAILER
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS IBM PUBLIC
+LICENSE ("AGREEMENT").  ANY USE, REPRODUCTION OR DISTRIBUTION OF THE
+PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1.  DEFINITIONS
+
+"Contribution" means:  
+    a) in the case of International Business Machines Corporation ("IBM"), 
+       the Original Program, and 
+    b) in the case of each Contributor, 
+       i)  changes to the Program, and
+       ii) additions to the Program;
+           where such changes and/or additions to the Program originate
+           from and are distributed by that particular Contributor.  
+           A Contribution 'originates' from a Contributor if it was added 
+           to the Program by such Contributor itself or anyone acting on 
+           such Contributor's behalf.  
+    Contributions do not include additions to the Program which:
+       (i)  are separate modules of software distributed in conjunction 
+            with the Program under their own license agreement, and 
+       (ii) are not derivative works of the Program.
+
+"Contributor" means IBM and any other entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which
+are necessarily infringed by the use or sale of its Contribution alone
+or when combined with the Program.
+
+"Original Program" means the original version of the software accompanying
+this Agreement as released by IBM, including source code, object code
+and documentation, if any.
+
+"Program" means the Original Program and Contributions.
+
+"Recipient" means anyone who receives the Program under this Agreement, 
+including all Contributors.
+
+2.  GRANT OF RIGHTS
+
+    a) Subject to the terms of this Agreement, each Contributor hereby
+    grants Recipient a non-exclusive, worldwide, royalty-free copyright
+    license to reproduce, prepare derivative works of, publicly display,
+    publicly perform, distribute and sublicense the Contribution of such
+    Contributor, if any, and such derivative works, in source code and
+    object code form.
+
+    b) Subject to the terms of this Agreement, each Contributor hereby
+    grants Recipient a non-exclusive, worldwide, royalty-free patent
+    license under Licensed Patents to make, use, sell, offer to sell,
+    import and otherwise transfer the Contribution of such Contributor,
+    if any, in source code and object code form.  This patent license
+    shall apply to the combination of the Contribution and the Program
+    if, at the time the Contribution is added by the Contributor, such
+    addition of the Contribution causes such combination to be covered
+    by the Licensed Patents.  The patent license shall not apply to any
+    other combinations which include the Contribution.  No hardware per
+    se is licensed hereunder.
+
+    c) Recipient understands that although each Contributor grants the
+    licenses to its Contributions set forth herein, no assurances are
+    provided by any Contributor that the Program does not infringe the
+    patent or other intellectual property rights of any other entity.
+    Each Contributor disclaims any liability to Recipient for claims
+    brought by any other entity based on infringement of intellectual
+    property rights or otherwise.  As a condition to exercising the rights
+    and licenses granted hereunder, each Recipient hereby assumes sole
+    responsibility to secure any other intellectual property rights
+    needed, if any.  For example, if a third party patent license
+    is required to allow Recipient to distribute the Program, it is
+    Recipient's responsibility to acquire that license before distributing
+    the Program.
+
+    d) Each Contributor represents that to its knowledge it has sufficient
+    copyright rights in its Contribution, if any, to grant the copyright
+    license set forth in this Agreement.
+
+3.  REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form 
+under its own license agreement, provided that:
+    a) it complies with the terms and conditions of this Agreement; and
+    b) its license agreement:
+       i)   effectively disclaims on behalf of all Contributors all
+            warranties and conditions, express and implied, including
+            warranties or conditions of title and non-infringement, and
+            implied warranties or conditions of merchantability and fitness
+            for a particular purpose;
+       ii)  effectively excludes on behalf of all Contributors all 
+            liability for damages, including direct, indirect, special, 
+            incidental and consequential damages, such as lost profits; 
+       iii) states that any provisions which differ from this Agreement 
+            are offered by that Contributor alone and not by any other 
+            party; and
+       iv)  states that source code for the Program is available from 
+            such Contributor, and informs licensees how to obtain it in a 
+            reasonable manner on or through a medium customarily used for 
+            software exchange. 
+
+When the Program is made available in source code form:
+    a) it must be made available under this Agreement; and 
+    b) a copy of this Agreement must be included with each copy of the 
+       Program.  
+
+Each Contributor must include the following in a conspicuous location 
+in the Program: 
+
+    Copyright (c) {date here}, International Business Machines Corporation 
+    and others. All Rights Reserved.  
+
+In addition, each Contributor must identify itself as the originator of
+its Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution. 
+
+4.  COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities
+with respect to end users, business partners and the like.  While this
+license is intended to facilitate the commercial use of the Program, the
+Contributor who includes the Program in a commercial product offering
+should do so in a manner which does not create potential liability for
+other Contributors.   Therefore, if a Contributor includes the Program in
+a commercial product offering, such Contributor ("Commercial Contributor")
+hereby agrees to defend and indemnify every other Contributor
+("Indemnified Contributor") against any losses, damages and costs
+(collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor
+in connection with its distribution of the Program in a commercial
+product offering.  The obligations in this section do not apply to any
+claims or Losses relating to any actual or alleged intellectual property
+infringement.  In order to qualify, an Indemnified Contributor must:
+    a) promptly notify the Commercial Contributor in writing of such claim,
+and 
+    b) allow the Commercial Contributor to control, and cooperate with
+       the Commercial Contributor in, the defense and any related 
+       settlement negotiations.  The Indemnified Contributor may 
+       participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X.  That Contributor is then a Commercial
+Contributor.  If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone.  Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those performance
+claims and warranties, and if a court requires any other Contributor to
+pay any damages as a result, the Commercial Contributor must pay those
+damages.
+
+5.  NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
+ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
+EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
+CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
+PARTICULAR PURPOSE. Each Recipient is solely responsible for determining
+the appropriateness of using and distributing the Program and assumes
+all risks associated with its exercise of rights under this Agreement,
+including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. 
+
+6.  DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION
+OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7.  GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with
+respect to a patent applicable to software (including a cross-claim or
+counterclaim in a lawsuit), then any patent licenses granted by that
+Contributor to such Recipient under this Agreement shall terminate
+as of the date such litigation is filed.  In addition, If Recipient
+institutes patent litigation against any entity (including a cross-claim
+or counterclaim in a lawsuit) alleging that the Program itself (excluding
+combinations of the Program with other software or hardware) infringes
+such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails
+to comply with any of the material terms or conditions of this Agreement
+and does not cure such failure in a reasonable period of time after
+becoming aware of such noncompliance.  If all Recipient's rights under
+this Agreement terminate, Recipient agrees to cease use and distribution
+of the Program as soon as reasonably practicable.  However, Recipient's
+obligations under this Agreement and any licenses granted by Recipient
+relating to the Program shall continue and survive. 
+
+IBM may publish new versions (including revisions) of this Agreement
+from time to time.  Each new version of the Agreement will be given a
+distinguishing version number.  The Program (including Contributions)
+may always be distributed subject to the version of the Agreement under
+which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including
+its Contributions) under the new version. No one other than IBM has the
+right to modify this Agreement.  Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise.  All rights in the
+Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to
+this Agreement will bring a legal action under this Agreement more than
+one year after the cause of action arose.  Each party waives its rights
+to a jury trial in any resulting litigation. 
index 79e998acc9a240efb00a180bc14265a80e5314b7..46e964de2d00d6618f94d9ee10557c47e386fe5b 100644 (file)
@@ -192,6 +192,18 @@ program_directory = /some/where/postfix/bin
 #alias_database = hash:/etc/aliases
 #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
 
+# DELIVERED-TO
+#
+# The prepend_delivered_header controls when Postfix should prepend
+# a Delivered-To: message header.
+#
+# By default, Postfix prepends a Delivered-To: header when forwarding
+# mail and when delivering to file (mailbox) or command.  Turning off
+# the Delivered-To: header when forwarding mail is not recommended.
+#
+# prepend_delivered_header = command, file, forward
+# prepend_delivered_header = forward
+
 # ADDRESS EXTENSIONS (e.g., user+foo)
 #
 # The recipient_delimiter parameter specifies the separator between
diff --git a/postfix/conf/main.cf.default b/postfix/conf/main.cf.default
deleted file mode 100644 (file)
index f95f192..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-2bounce_notice_recipient = postmaster
-access_map_reject_code = 554
-alias_database = hash:/etc/aliases
-alias_maps = hash:/etc/aliases
-allow_mail_to_commands = alias,forward
-allow_mail_to_files = alias,forward
-allow_percent_hack = yes
-always_bcc = 
-append_at_myorigin = yes
-append_dot_mydomain = yes
-best_mx_transport = 
-biff = yes
-bounce_notice_recipient = postmaster
-bounce_size_limit = 50000
-canonical_maps = 
-command_directory = $program_directory
-command_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
-command_time_limit = 1000
-daemon_directory = $program_directory
-daemon_timeout = 18000
-debug_peer_level = 2
-debug_peer_list = 
-default_database_type = hash
-default_destination_concurrency_limit = 10
-default_destination_recipient_limit = 50
-default_privs = nobody
-default_process_limit = 50
-default_transport = smtp
-defer_transports = 
-delay_notice_recipient = postmaster
-delay_warning_time = 0
-deliver_lock_attempts = 5
-deliver_lock_delay = 1
-disable_dns_lookups = no
-dont_remove = 0
-double_bounce_sender = double-bounce
-duplicate_filter_limit = 1000
-empty_address_recipient = MAILER-DAEMON
-error_notice_recipient = postmaster
-fallback_relay = 
-fallback_transport = 
-fork_attempts = 5
-fork_delay = 1
-forward_path = $home/.forward${recipient_delimiter}${extension},$home/.forward
-hash_queue_depth = 2
-hash_queue_names = defer
-header_checks = 
-header_size_limit = 102400
-home_mailbox = 
-hopcount_limit = 50
-ignore_mx_lookup_error = no
-inet_interfaces = all
-initial_destination_concurrency = 5
-invalid_hostname_reject_code = 501
-ipc_idle = 100
-ipc_timeout = 3600
-line_length_limit = 2048
-local_command_shell = 
-local_destination_concurrency_limit = $default_destination_concurrency_limit
-local_destination_recipient_limit = $default_destination_recipient_limit
-luser_relay = 
-mail_name = Postfix
-mail_owner = postfix
-mail_spool_directory = /var/mail
-mail_version = Beta-19990601
-mailbox_command = 
-mailbox_transport = 
-maps_rbl_domains = rbl.maps.vix.com
-maps_rbl_reject_code = 554
-masquerade_domains = 
-masquerade_exceptions = 
-max_idle = 100
-max_use = 100
-maximal_backoff_time = 4000
-maximal_queue_lifetime = 5
-message_size_limit = 10240000
-minimal_backoff_time = 1000
-mydestination = $myhostname, localhost.$mydomain
-myorigin = $myhostname
-non_fqdn_reject_code = 504
-notify_classes = resource,software
-owner_request_special = yes
-process_id_directory = pid
-program_directory = /usr/libexec/postfix
-propagate_unmatched_extensions = canonical, virtual
-qmgr_message_active_limit = 1000
-qmgr_message_recipient_limit = 10000
-queue_directory = /var/spool/postfix
-queue_minfree = 0
-queue_run_delay = 1000
-recipient_canonical_maps = 
-recipient_delimiter = 
-recipient_feature_delimiter = 
-reject_code = 554
-relay_domains = $mydestination, $virtual_maps
-relay_domains_reject_code = 554
-relayhost = 
-relocated_maps = 
-sender_canonical_maps = 
-service_throttle_time = 60
-smtp_connect_timeout = 0
-smtp_data_done_timeout = 600
-smtp_data_init_timeout = 120
-smtp_data_xfer_timeout = 180
-smtp_destination_concurrency_limit = $default_destination_concurrency_limit
-smtp_destination_recipient_limit = $default_destination_recipient_limit
-smtp_helo_timeout = 300
-smtp_mail_timeout = 300
-smtp_quit_timeout = 300
-smtp_rcpt_timeout = 300
-smtp_skip_4xx_greeting = no
-smtp_skip_quit_response = yes
-smtpd_banner = $myhostname ESMTP $mail_name
-smtpd_client_restrictions = 
-smtpd_delay_reject = yes
-smtpd_error_sleep_time = 5
-smtpd_etrn_restrictions = 
-smtpd_hard_error_limit = 100
-smtpd_helo_required = no
-smtpd_helo_restrictions = 
-smtpd_recipient_limit = 1000
-smtpd_recipient_restrictions = permit_mynetworks,check_relay_domains
-smtpd_sender_restrictions = 
-smtpd_soft_error_limit = 10
-smtpd_timeout = 300
-soft_bounce = no
-stale_lock_time = 500
-sun_mailtool_compatibility = no
-swap_bangpath = yes
-transport_maps = 
-transport_retry_time = 60
-trigger_timeout = 10
-unknown_address_reject_code = 450
-unknown_client_reject_code = 450
-unknown_hostname_reject_code = 450
-virtual_maps = 
index c0786dff7ee978e5acf79b6d02a71384bc5ba5d5..471856d1f79702bf32d1317a6791b8acd2d24dd6 100755 (executable)
@@ -66,6 +66,10 @@ cd $daemon_directory || {
        $FATAL no Postfix daemon directory $daemon_directory!
        exit 1
 }
+test -x master || {
+       $FATAL no Postfix master program $daemon_directory/master!
+       exit 1
+}
 cd $config_directory || {
        $FATAL no Postfix configuration directory $config_directory!
        exit 1
index 68327e61036208c5e3fd8c83387aaa35c99d94e8..2ba58b979127438d89c6937bc2dde925d33d673f 100755 (executable)
@@ -66,6 +66,10 @@ cd $daemon_directory || {
        $FATAL no Postfix daemon directory $daemon_directory!
        exit 1
 }
+test -x master || {
+       $FATAL no Postfix master program $daemon_directory/master!
+       exit 1
+}
 cd $config_directory || {
        $FATAL no Postfix configuration directory $config_directory!
        exit 1
index e46b20592ec947343a40e2e414c74603c5047389..b07c1c9d65c59106057e4b992892bcb731a14ce2 100644 (file)
@@ -149,3 +149,15 @@ local_destination_concurrency_limit = 2
 # effect.
 #
 local_destination_recipient_limit = 1
+
+# DELIVERED-TO
+#
+# The prepend_delivered_header controls when Postfix should prepend 
+# a Delivered-To: message header.  
+#
+# By default, Postfix prepends a Delivered-To: header when forwarding
+# mail and when delivering to file (mailbox) and command. Turning off
+# the Delivered-To: header when forwarding mail is not recommended.
+#
+# prepend_delivered_header = command, file, forward
+# prepend_delivered_header = forward
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index f44595382a0a9438f91d305025eb9d2045d1e0be..5deff368a7b94176f1b4bcdafae1c4478fc7919a 100644 (file)
@@ -20,7 +20,7 @@ INC_DIR       = ../include
 all: $(LIB)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 62f013b27d8de68ff76d8a1118bdeabba37aa00d..5e0542b9c044f3fc5f1e5997a7e1116c93da06ce 100644 (file)
@@ -19,7 +19,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 21d5d58dee0051151bb01fcb5646161dc18f0cc0..92dbdc3f63ad1e7af749913b161284797ba5b1a5 100644 (file)
@@ -18,7 +18,7 @@ LIBS  = ../lib/libglobal.a ../lib/libutil.a
 all:   $(PROG)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 fsstone: fsstone.o $(LIBS)
        $(CC) $(CFLAGS) -o $@ fsstone.o $(LIBS) $(SYSLIBS)
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index cc1c3b7ccaaaf18bf4a11a7b75737570ed30ed8a..887f2af4133b7634cbb5204203bffcff4f471ed2 100644 (file)
@@ -16,7 +16,8 @@ SRCS  = been_here.c bounce.c canon_addr.c cleanup_strerror.c clnt_stream.c \
        recipient_list.c record.c remove.c resolve_clnt.c resolve_local.c \
        rewrite_clnt.c sent.c smtp_stream.c split_addr.c string_list.c \
        sys_exits.c timed_ipc.c tok822_find.c tok822_node.c tok822_parse.c \
-       tok822_resolve.c tok822_rewrite.c tok822_tree.c ext_prop.c
+       tok822_resolve.c tok822_rewrite.c tok822_tree.c ext_prop.c \
+       dot_lockfile_as.c
 OBJS   = been_here.o bounce.o canon_addr.o cleanup_strerror.o clnt_stream.o \
        debug_peer.o debug_process.o defer.o deliver_completed.o \
        deliver_flock.o deliver_pass.o deliver_request.o domain_list.o \
@@ -34,7 +35,8 @@ OBJS  = been_here.o bounce.o canon_addr.o cleanup_strerror.o clnt_stream.o \
        recipient_list.o record.o remove.o resolve_clnt.o resolve_local.o \
        rewrite_clnt.o sent.o smtp_stream.o split_addr.o string_list.o \
        sys_exits.o timed_ipc.o tok822_find.o tok822_node.o tok822_parse.o \
-       tok822_resolve.o tok822_rewrite.o tok822_tree.o ext_prop.o
+       tok822_resolve.o tok822_rewrite.o tok822_tree.o ext_prop.o \
+       dot_lockfile_as.o
 HDRS   = been_here.h bounce.h canon_addr.h cleanup_user.h clnt_stream.h \
        config.h debug_peer.h debug_process.h defer.h deliver_completed.h \
        deliver_flock.h deliver_pass.h deliver_request.h domain_list.h \
@@ -48,7 +50,7 @@ HDRS  = been_here.h bounce.h canon_addr.h cleanup_user.h clnt_stream.h \
        quote_822_local.h rec_streamlf.h rec_type.h recipient_list.h \
        record.h resolve_clnt.h resolve_local.h rewrite_clnt.h sent.h \
        smtp_stream.h split_addr.h string_list.h sys_exits.h timed_ipc.h \
-       tok822.h ext_prop.h
+       tok822.h ext_prop.h dot_lockfile_as.h
 TESTSRC        = rec2stream.c stream2rec.c recdump.c
 WARN   = -W -Wformat -Wimplicit -Wmissing-prototypes \
        -Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
@@ -72,7 +74,7 @@ MAKES =
 all: $(LIB)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
@@ -330,6 +332,14 @@ dot_lockfile.o: ../include/stringops.h
 dot_lockfile.o: ../include/mymalloc.h
 dot_lockfile.o: mail_params.h
 dot_lockfile.o: dot_lockfile.h
+dot_lockfile_as.o: dot_lockfile_as.c
+dot_lockfile_as.o: ../include/sys_defs.h
+dot_lockfile_as.o: ../include/msg.h
+dot_lockfile_as.o: ../include/set_eugid.h
+dot_lockfile_as.o: dot_lockfile.h
+dot_lockfile_as.o: ../include/vstring.h
+dot_lockfile_as.o: ../include/vbuf.h
+dot_lockfile_as.o: dot_lockfile_as.h
 ext_prop.o: ext_prop.c
 ext_prop.o: ../include/sys_defs.h
 ext_prop.o: ../include/name_mask.h
index 599343679de0346b1f25f3b17b7e149af7daacfa..6921298d8ce229473804e930a5626f7f6d4bc243 100644 (file)
@@ -107,6 +107,7 @@ int     dot_lockfile(const char *path, VSTRING *why)
                if (unlink(lock_file) < 0)
                    if (errno != ENOENT)
                        break;
+       errno = EEXIST;
     }
     if (status && why)
        vstring_sprintf(why, "unable to create lock file %s: %m", lock_file);
diff --git a/postfix/global/dot_lockfile_as.c b/postfix/global/dot_lockfile_as.c
new file mode 100644 (file)
index 0000000..7ee84d9
--- /dev/null
@@ -0,0 +1,99 @@
+/*++
+/* NAME
+/*     dot_lockfile_as 3
+/* SUMMARY
+/*     dotlock file as user
+/* SYNOPSIS
+/*     #include <dot_lockfile_as.h>
+/*
+/*     int     dot_lockfile_as(path, why, euid, egid)
+/*     const char *path;
+/*     VSTRING *why;
+/*     uid_t   euid;
+/*     gid_t   egid;
+/*
+/*     void    dot_unlockfile_as(path, euid, egid)
+/*     const char *path;
+/*     uid_t   euid;
+/*     gid_t   egid;
+/* DESCRIPTION
+/*     dot_lockfile_as() and dot_unlockfile_as() are wrappers around
+/*     the dot_lockfile() and dot_unlockfile() routines. The routines
+/*     change privilege to the designated privilege, perform the
+/*     requested operation, and restore privileges.
+/* DIAGNOSTICS
+/*     Fatal error: no permission to change privilege level.
+/* SEE ALSO
+/*     dot_lockfile(3) dotlock file management
+/*     set_eugid(3) switch effective rights
+/* 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 <unistd.h>
+
+/* Utility library. */
+
+#include "msg.h"
+#include "set_eugid.h"
+#include "dot_lockfile.h"
+#include "dot_lockfile_as.h"
+
+/* dot_lockfile_as - dotlock file as user */
+
+int     dot_lockfile_as(const char *path, VSTRING *why, uid_t euid, gid_t egid)
+{
+    uid_t   saved_euid = geteuid();
+    gid_t   saved_egid = getegid();
+    int     result;
+
+    /*
+     * Switch to the target user privileges.
+     */
+    set_eugid(euid, egid);
+
+    /*
+     * Lock that file.
+     */
+    result = dot_lockfile(path, why);
+
+    /*
+     * Restore saved privileges.
+     */
+    set_eugid(saved_euid, saved_egid);
+
+    return (result);
+}
+
+/* dot_unlockfile_as - dotlock file as user */
+
+void     dot_unlockfile_as(const char *path, uid_t euid, gid_t egid)
+{
+    uid_t   saved_euid = geteuid();
+    gid_t   saved_egid = getegid();
+
+    /*
+     * Switch to the target user privileges.
+     */
+    set_eugid(euid, egid);
+
+    /*
+     * Lock that file.
+     */
+    dot_unlockfile(path);
+
+    /*
+     * Restore saved privileges.
+     */
+    set_eugid(saved_euid, saved_egid);
+}
diff --git a/postfix/global/dot_lockfile_as.h b/postfix/global/dot_lockfile_as.h
new file mode 100644 (file)
index 0000000..539a70a
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _DOT_LOCKFILE_AS_H_INCLUDED_
+#define _DOT_LOCKFILE_AS_H_INCLUDED_
+
+/*++
+/* NAME
+/*     dot_lockfile_as 3h
+/* SUMMARY
+/*     dotlock file management
+/* SYNOPSIS
+/*     #include <dot_lockfile_as.h>
+/* DESCRIPTION
+/* .nf
+
+ /*
+  * Utility library.
+  */
+#include <vstring.h>
+
+ /*
+  * External interface.
+  */
+extern int dot_lockfile_as(const char *, VSTRING *, uid_t, gid_t);
+extern void dot_unlockfile_as(const char *, uid_t, gid_t);
+
+/* 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 a98e2b01879895800efdab64250af32f260f07fc..00d15ef8f86187151ba30d843a3a5100fe0e2e84 100644 (file)
@@ -272,7 +272,7 @@ void    mail_params_init()
        VAR_MAX_IDLE, DEF_MAX_IDLE, &var_idle_limit, 1, 0,
        VAR_IPC_TIMEOUT, DEF_IPC_TIMEOUT, &var_ipc_timeout, 1, 0,
        VAR_DONT_REMOVE, DEF_DONT_REMOVE, &var_dont_remove, 0, 0,
-       VAR_LINE_LIMIT, DEF_LINE_LIMIT, &var_line_limit, 1024, 0,
+       VAR_LINE_LIMIT, DEF_LINE_LIMIT, &var_line_limit, 512, 0,
        VAR_MESSAGE_LIMIT, DEF_MESSAGE_LIMIT, &var_message_limit, 0, 0,
        VAR_IPC_IDLE, DEF_IPC_IDLE, &var_ipc_idle_limit, 1, 0,
        VAR_HASH_QUEUE_DEPTH, DEF_HASH_QUEUE_DEPTH, &var_hash_queue_depth, 1, 0,
index 517e6fc5a76c0b90ecad3f9e5418186dbbaa20ae..ca210bf3cdc6ad5779f96da553dfb3db7d19f03f 100644 (file)
@@ -342,9 +342,13 @@ abcdefghijklmnopqrstuvwxyz\
 ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 extern char *var_cmd_exp_filter;
 
-#define VAR_RCPT_FDELIM                "recipient_feature_delimiter"
-#define DEF_RCPT_FDELIM                ""
-extern char *var_rcpt_fdelim;
+#define VAR_DELIVER_HDR                "prepend_delivered_header"
+#define DEF_DELIVER_HDR                "command, file, forward"
+extern char *var_deliver_hdr;
+
+#define VAR_EXP_OWN_ALIAS              "expand_owner_alias"
+#define DEF_EXP_OWN_ALIAS              0
+extern bool var_exp_own_alias;
 
  /*
   * Queue manager: maximal size of the duplicate expansion filter. By
index bdc0155791dfdd5f215411b97f5035ab86e8af57..1533094f15ba6a1cc12d8cef341928ff24fc473c 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Beta-19990601"
+#define DEF_MAIL_VERSION       "Snapshot-19990627"
 extern char *var_mail_version;
 
 /* LICENSE
index 9d3bd5abd6987d5688ef1e9c3f99d6b689b76556..f697a19e045f59c2d9f9b8ce8bf7b056c506aa8a 100644 (file)
@@ -368,9 +368,9 @@ int     pipe_command(VSTREAM *src, VSTRING *why,...)
         */
        close(cmd_in_pipe[1]);
        close(cmd_out_pipe[0]);
-       if (dup2(cmd_in_pipe[0], STDIN_FILENO) < 0
-           || dup2(cmd_out_pipe[1], STDOUT_FILENO) < 0
-           || dup2(cmd_out_pipe[1], STDERR_FILENO) < 0)
+       if (DUP2(cmd_in_pipe[0], STDIN_FILENO) < 0
+           || DUP2(cmd_out_pipe[1], STDOUT_FILENO) < 0
+           || DUP2(cmd_out_pipe[1], STDERR_FILENO) < 0)
            msg_fatal("%s: dup2: %m", myname);
        close(cmd_in_pipe[0]);
        close(cmd_out_pipe[1]);
index 7180aced682d15e9c805de9711fda44637151aa1..70cbbba4afc60816511cafdc326c8055a60c1a40 100644 (file)
@@ -13,7 +13,7 @@ CONFIG        = access.5.html aliases.5.html canonical.5.html relocated.5.html \
 update:        $(DAEMONS) $(COMMANDS) $(CONFIG)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 clean:
        echo clean
index 0564efbd2fac47941a2996c6b5ffdf29e570ea91..d942cb7afffb0614f232fff49608cd7b51a7de25 100644 (file)
@@ -531,19 +531,32 @@ making Postfix more secure than ordinary mailers.
 
 <a name="delivered"><h2>Getting rid of Delivered-To:</h2> </a>
 
-Some people will complain about the ugly <b>Delivered-To:</b> 
-message header that Postfix prepends to their mail.
+Some people will complain about the ugly <b>Delivered-To:</b>
+message header that Postfix prepends to their mail.  By default,
+Postfix prepends this header when forwarding mail, and when delivering
+to file (mailbox) or command. The purpose is to stop mail forwarding
+loops as early as possible, that is, before they have a chance to
+happen.  But the header is ugly, no question about it.
 
 <p>
 
-With the Postfix architecture, <b>Delivered-To:</b> is required to
-prevent mail forwarding loops.  Fortunately, many mail user agents
-have per-user or even system-wide configuration files that can be
-set up to suppress specific message headers (for example <b>~/.mailrc</b>
-and <b>/usr/lib/Mail.rc</b>).
+Solutions, ranging from fighting symptoms to turning off the
+<b>Delivered-To:</b> header:
 
 <p>
 
+<ul>
+
+<li>
+
+Fortunately, many mail user agents have per-user or even system-wide
+configuration files that can be set up to suppress specific message
+headers (for example <b>~/.mailrc</b> and <b>/usr/lib/Mail.rc</b>).
+
+<p>
+
+<li>
+
 With mailing lists, <b>Delivered-To:</b> can get in the way when
 the list exploder uses a "secret" alias that should not be shown
 in outbound mail. The recommended solution is to use a regular
@@ -584,6 +597,17 @@ Postfix source directory.
 
 <p>
 
+<li>
+
+The <b>prepend_delivered_header</b> configuration parameter controls
+when <b>Delivered-To:</b> is prepended. The default setting is
+<b>command, file, forward</b>.  <i>Turning off <b>Delivered-To:</b>
+when forwarding mail is not recommended</i>.
+
+</ul>
+
+<p>
+
 See also the FAQ item for problems with the <b>majordomo</b> <a
 href="#approve">approve</a> command.
 
index 3440d9bee2a6a2a12f4ca89e91ccbaa18d83e589..11f21fcc39be0f4080cf8cb82be1c6e9bb37ba68 100644 (file)
@@ -120,11 +120,11 @@ LOCAL(8)                                                 LOCAL(8)
 
        In the case of UNIX-style mailbox delivery, the <b>local</b> dae-
        mon prepends a "<b>From</b> <i>sender</i> <i>time_stamp</i>" envelope header to
-       each  message,  prepends  a  <b>Delivered-To:</b> header with the
-       envelope recipient address, prepends a <b>Return-Path:</b> header
-       with  the  envelope sender address, prepends a &gt; character
-       to lines beginning with "<b>From</b>  ",  and  appends  an  empty
-       line.   The  mailbox  is locked for exclusive access while
+       each  message,  prepends  an optional <b>Delivered-To:</b> header
+       with the envelope recipient address,  prepends  a  <b>Return-</b>
+       <b>Path:</b>  header with the envelope sender address, prepends a
+       &gt; character to lines beginning with "<b>From</b> ",  and  appends
+       an empty line.  The mailbox is locked for exclusive access
 
 
 
@@ -137,34 +137,35 @@ LOCAL(8)                                                 LOCAL(8)
 LOCAL(8)                                                 LOCAL(8)
 
 
-       delivery is in progress. In case of problems,  an  attempt
-       is made to truncate the mailbox to its original length.
+       while delivery is in progress. In  case  of  problems,  an
+       attempt  is  made  to truncate the mailbox to its original
+       length.
 
        In the case of <b>maildir</b> delivery, the local daemon prepends
-       a <b>Delivered-To:</b> header with the envelope recipient address
-       and  prepends  a  <b>Return-Path:</b>  header  with  the envelope
-       sender address.
+       an optional <b>Delivered-To:</b> header with the envelope recipi-
+       ent address and prepends a <b>Return-Path:</b>  header  with  the
+       envelope sender address.
 
 <b>EXTERNAL</b> <b>COMMAND</b> <b>DELIVERY</b>
-       The   <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>commands</b>    configuration    parameter
-       restricts  delivery to external commands. The default set-
-       ting (<b>alias,</b>  <b>forward</b>)  forbids  command  destinations  in
+       The    <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>commands</b>    configuration   parameter
+       restricts delivery to external commands. The default  set-
+       ting  (<b>alias,</b>  <b>forward</b>)  forbids  command  destinations in
        <b>:include:</b> files.
 
-       The  command  is  executed directly where possible. Assis-
-       tance by the shell (<b>/bin/sh</b> on UNIX systems) is used  only
-       when  the command contains shell magic characters, or when
+       The command is executed directly  where  possible.  Assis-
+       tance  by the shell (<b>/bin/sh</b> on UNIX systems) is used only
+       when the command contains shell magic characters, or  when
        the command invokes a shell built-in command.
 
-       A limited amount of command output  (standard  output  and
-       standard  error) is captured for inclusion with non-deliv-
-       ery status reports.  A command is forcibly  terminated  if
-       it  does  not  complete within <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b> seconds.
-       Command exit status codes are expected to follow the  con-
+       A  limited  amount  of command output (standard output and
+       standard error) is captured for inclusion with  non-deliv-
+       ery  status  reports.  A command is forcibly terminated if
+       it does not complete  within  <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b>  seconds.
+       Command  exit status codes are expected to follow the con-
        ventions defined in &lt;<b>sysexits.h</b>&gt;.
 
-       A  limited amount of message context is exported via envi-
-       ronment variables. Characters that may have special  mean-
+       A limited amount of message context is exported via  envi-
+       ronment  variables. Characters that may have special mean-
        ing to the shell are replaced by underscores.  The list of
        acceptable characters is specified with the <b>command</b><i>_</i><b>expan-</b>
        <b>sion</b><i>_</i><b>filter</b> configuration parameter.
@@ -190,7 +191,6 @@ LOCAL(8)                                                 LOCAL(8)
               The entire recipient address.
 
        The <b>PATH</b> environment variable is always reset to a system-
-       dependent default path, and the <b>TZ</b> (time zone) environment
 
 
 
@@ -203,37 +203,39 @@ LOCAL(8)                                                 LOCAL(8)
 LOCAL(8)                                                 LOCAL(8)
 
 
+       dependent default path, and the <b>TZ</b> (time zone) environment
        variable is always passed on without change.
 
        The current working directory is the mail queue directory.
 
        The <b>local</b> daemon prepends a "<b>From</b> <i>sender</i> <i>time_stamp</i>" enve-
-       lope header to  each  message,  prepends  a  <b>Delivered-To:</b>
-       header  with  the  recipient  envelope address, prepends a
-       <b>Return-Path:</b> header with the sender envelope address,  and
-       appends an empty line.
+       lope  header  to each message, prepends an optional <b>Deliv-</b>
+       <b>ered-To:</b>  header  with  the  recipient  envelope  address,
+       prepends  a  <b>Return-Path:</b>  header with the sender envelope
+       address, and appends an empty line.
 
 <b>EXTERNAL</b> <b>FILE</b> <b>DELIVERY</b>
-       The  <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>files</b> configuration parameter restricts
-       delivery to external files. The  default  setting  (<b>alias,</b>
-       <b>forward</b>)  forbids  file  destinations  in <b>:include:</b> files.
+       The <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>files</b> configuration parameter  restricts
+       delivery  to  external  files. The default setting (<b>alias,</b>
+       <b>forward</b>) forbids file  destinations  in  <b>:include:</b>  files.
        Specify  a  pathname  ending  in  <b>/</b>  for  <b>qmail</b>-compatible
        <b>maildir</b> delivery.
 
        The <b>local</b> daemon prepends a "<b>From</b> <i>sender</i> <i>time_stamp</i>" enve-
-       lope header to  each  message,  prepends  a  <b>Delivered-To:</b>
-       header  with  the recipient envelope address, prepends a &gt;
-       character to lines beginning with "<b>From</b> ", and appends  an
-       empty  line.   The envelope sender address is available in
-       the <b>Return-Path:</b> header.  When the destination is a  regu-
-       lar file, it is locked for exclusive access while delivery
-       is in progress. In case of problems, an attempt is made to
-       truncate a regular file to its original length.
+       lope  header  to each message, prepends an optional <b>Deliv-</b>
+       <b>ered-To:</b>  header  with  the  recipient  envelope  address,
+       prepends  a  &gt;  character to lines beginning with "<b>From</b> ",
+       and appends an empty line.  The envelope sender address is
+       available  in  the <b>Return-Path:</b> header.  When the destina-
+       tion is a regular file, it is locked for exclusive  access
+       while  delivery  is  in  progress. In case of problems, an
+       attempt is made to truncate a regular file to its original
+       length.
 
        In the case of <b>maildir</b> delivery, the local daemon prepends
-       a  <b>Delivered-To:</b>  header  with  the   envelope   recipient
-       address.   The envelope sender address is available in the
-       <b>Return-Path:</b> header.
+       an optional <b>Delivered-To:</b> header with the envelope recipi-
+       ent  address.  The envelope sender address is available in
+       the <b>Return-Path:</b> header.
 
 <b>ADDRESS</b> <b>EXTENSION</b>
        The optional <b>recipient</b><i>_</i><b>delimiter</b>  configuration  parameter
@@ -246,8 +248,8 @@ LOCAL(8)                                                 LOCAL(8)
        <b>ward</b>+<i>foo</i> or in ~<i>name</i>/.<b>forward</b>, to the mailbox owned by the
        user <i>name</i>, or it is sent back as undeliverable.
 
-       In all cases the <b>local</b> daemon  prepends  a  `<b>Delivered-To:</b>
-       <i>name</i>+<i>foo</i>' header line.
+       In all cases the <b>local</b> daemon prepends an opional  `<b>Deliv-</b>
+       <b>ered-To:</b> <i>name</i>+<i>foo</i>' header line.
 
 <b>DELIVERY</b> <b>RIGHTS</b>
        Deliveries  to  external  files  and external commands are
@@ -255,8 +257,6 @@ LOCAL(8)                                                 LOCAL(8)
        the  delivery  is made.  In the absence of a user context,
        the <b>local</b> daemon uses the owner rights  of  the  <b>:include:</b>
        file or alias database.  When those files are owned by the
-       superuser, delivery is made with the rights specified with
-       the <b>default</b><i>_</i><b>privs</b> configuration parameter.
 
 
 
@@ -269,6 +269,9 @@ LOCAL(8)                                                 LOCAL(8)
 LOCAL(8)                                                 LOCAL(8)
 
 
+       superuser, delivery is made with the rights specified with
+       the <b>default</b><i>_</i><b>privs</b> configuration parameter.
+
 <b>STANDARDS</b>
        RFC 822 (ARPA Internet Text Messages)
 
@@ -302,27 +305,24 @@ LOCAL(8)                                                 LOCAL(8)
        <b>alias</b><i>_</i><b>maps</b>
               List of alias databases.
 
+       <b>expand</b><i>_</i><b>owner</b><i>_</i><b>alias</b>
+              When delivering to an alias that has an owner- com-
+              panion  alias,  set  the envelope sender address to
+              the right-hand side of  the  owner  alias,  instead
+              using of the left-hand side address.
+
        <b>forward</b><i>_</i><b>path</b>
               Search list for .forward files.  The names are sub-
               ject to <i>$name</i> expansion.
 
        <b>local</b><i>_</i><b>command</b><i>_</i><b>shell</b>
-              Shell  to  use  for external command execution (for
-              example, /some/where/smrsh -c).  When  a  shell  is
+              Shell to use for external  command  execution  (for
+              example,  /some/where/smrsh  -c).   When a shell is
               specified, it is invoked even when the command con-
-              tains no shell built-in commands  or  meta  charac-
+              tains  no  shell  built-in commands or meta charac-
               ters.
 
-       <b>owner</b><i>_</i><b>request</b><i>_</i><b>special</b>
-              Give special treatment to <b>owner-</b><i>xxx</i> and <i>xxx</i><b>-request</b>
-              addresses.
 
-       <b>recipient</b><i>_</i><b>delimiter</b>
-              Separator between username and address extension.
-
-<b>Mailbox</b> <b>delivery</b>
-       <b>fallback</b><i>_</i><b>transport</b>
-              Message transport for recipients that are not found
 
 
 
@@ -335,43 +335,72 @@ LOCAL(8)                                                 LOCAL(8)
 LOCAL(8)                                                 LOCAL(8)
 
 
-              in  the UNIX passwd database.  This parameter over-
+       <b>prepend</b><i>_</i><b>delivered</b><i>_</i><b>header</b>
+              Prepend  an  optional  <b>Delivered-To:</b>  header   upon
+              external  forwarding,  delivery to command or file.
+              Specify zero or more of:  <b>command,</b>  <b>file,</b>  <b>forward</b>.
+              Turning  off  <b>Delivered-To:</b> when forwarding mail is
+              not recommended.
+
+       <b>owner</b><i>_</i><b>request</b><i>_</i><b>special</b>
+              Give special treatment to <b>owner-</b><i>xxx</i> and <i>xxx</i><b>-request</b>
+              addresses.
+
+       <b>recipient</b><i>_</i><b>delimiter</b>
+              Separator between username and address extension.
+
+<b>Mailbox</b> <b>delivery</b>
+       <b>fallback</b><i>_</i><b>transport</b>
+              Message transport for recipients that are not found
+              in the UNIX passwd database.  This parameter  over-
               rides <b>luser</b><i>_</i><b>relay</b>.
 
        <b>home</b><i>_</i><b>mailbox</b>
-              Pathname of a mailbox relative  to  a  user's  home
+              Pathname  of  a  mailbox  relative to a user's home
               directory.  Specify a path ending in <b>/</b> for maildir-
               style delivery.
 
        <b>luser</b><i>_</i><b>relay</b>
-              Destination (<i>@domain</i> or <i>address</i>)  for  non-existent
-              users.   The  <i>address</i>  is subjected to <i>$name</i> expan-
+              Destination  (<i>@domain</i>  or <i>address</i>) for non-existent
+              users.  The <i>address</i> is subjected  to  <i>$name</i>  expan-
               sion.
 
        <b>mail</b><i>_</i><b>spool</b><i>_</i><b>directory</b>
-              Directory with UNIX-style  mailboxes.  The  default
+              Directory  with  UNIX-style  mailboxes. The default
               pathname is system dependent.
 
        <b>mailbox</b><i>_</i><b>command</b>
-              External  command  to use for mailbox delivery. The
+              External command to use for mailbox  delivery.  The
               command  executes  with  the  recipient  privileges
-              (exception:  root).  The string is subject to $name
+              (exception: root). The string is subject  to  $name
               expansions.
 
        <b>mailbox</b><i>_</i><b>transport</b>
-              Message transport to use for  mailbox  delivery  to
+              Message  transport  to  use for mailbox delivery to
               all local recipients, whether or not they are found
-              in the UNIX passwd database.  This parameter  over-
-              rides  all other configuration parameters that con-
+              in  the UNIX passwd database.  This parameter over-
+              rides all other configuration parameters that  con-
               trol mailbox delivery, including <b>luser</b><i>_</i><b>relay</b>.
 
 <b>Locking</b> <b>controls</b>
        <b>deliver</b><i>_</i><b>lock</b><i>_</i><b>attempts</b>
-              Limit the number of attempts to acquire  an  exclu-
+              Limit  the  number of attempts to acquire an exclu-
               sive lock on a mailbox or external file.
 
        <b>deliver</b><i>_</i><b>lock</b><i>_</i><b>delay</b>
-              Time  in  seconds  between  successive  attempts to
+              Time in  seconds  between  successive  attempts  to
+
+
+
+                                                                6
+
+
+
+
+
+LOCAL(8)                                                 LOCAL(8)
+
+
               acquire an exclusive lock.
 
        <b>stale</b><i>_</i><b>lock</b><i>_</i><b>time</b>
@@ -379,63 +408,65 @@ LOCAL(8)                                                 LOCAL(8)
 
 <b>Resource</b> <b>controls</b>
        <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b>
-              Limit  the  amount of time for delivery to external
+              Limit the amount of time for delivery  to  external
               command.
 
        <b>duplicate</b><i>_</i><b>filter</b><i>_</i><b>limit</b>
-              Limit the size of the duplicate filter for  results
+              Limit  the size of the duplicate filter for results
               from alias etc. expansion.
 
        <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>
-              Limit  the  amount  of memory used for processing a
+              Limit the amount of memory used  for  processing  a
               partial input line.
 
-
-
-                                                                6
-
-
-
-
-
-LOCAL(8)                                                 LOCAL(8)
-
-
        <b>local</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>
               Limit the number of parallel deliveries to the same
-              user.    The   default  limit  is  taken  from  the
+              user.   The  default  limit  is  taken   from   the
               <b>default</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b> parameter.
 
        <b>local</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
-              Limit the number of recipients per  message  deliv-
-              ery.    The   default   limit  is  taken  from  the
+              Limit  the  number of recipients per message deliv-
+              ery.   The  default  limit  is   taken   from   the
               <b>default</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> parameter.
 
 <b>Security</b> <b>controls</b>
        <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>commands</b>
-              Restrict the usage of  mail  delivery  to  external
+              Restrict  the  usage  of  mail delivery to external
               command.
 
        <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>files</b>
-              Restrict  the  usage  of  mail delivery to external
+              Restrict the usage of  mail  delivery  to  external
               file.
 
        <b>command</b><i>_</i><b>expansion</b><i>_</i><b>filter</b>
-              What characters are  allowed  to  appear  in  $name
-              expansions  of  mailbox_command. Illegal characters
+              What  characters  are  allowed  to  appear in $name
+              expansions of mailbox_command.  Illegal  characters
               are replaced by underscores.
 
        <b>default</b><i>_</i><b>privs</b>
-              Default rights for delivery  to  external  file  or
+              Default  rights  for  delivery  to external file or
               command.
 
 <b>HISTORY</b>
-       The  <b>Delivered-To:</b>  header  appears in the <b>qmail</b> system by
+       The <b>Delivered-To:</b> header appears in the  <b>qmail</b>  system  by
        Daniel Bernstein.
 
-       The <i>maildir</i> structure  appears  in  the  <b>qmail</b>  system  by
+       The  <i>maildir</i>  structure  appears  in  the  <b>qmail</b> system by
        Daniel Bernstein.
 
+
+
+
+
+                                                                7
+
+
+
+
+
+LOCAL(8)                                                 LOCAL(8)
+
+
 <b>SEE</b> <b>ALSO</b>
        <a href="aliases.5.html">aliases(5)</a> format of alias database
        <a href="bounce.8.html">bounce(8)</a> non-delivery status reports
@@ -444,7 +475,7 @@ LOCAL(8)                                                 LOCAL(8)
        <a href="qmgr.8.html">qmgr(8)</a> queue manager
 
 <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>
@@ -458,7 +489,42 @@ LOCAL(8)                                                 LOCAL(8)
 
 
 
-                                                                7
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+                                                                8
 
 
 </pre> </body> </html>
index c91c73756e7e68c57ddbf1950209e1d3ab5de384..af47d38973227bfd9503bfa894d51cb4aaabd911 100644 (file)
@@ -39,7 +39,7 @@ POSTALIAS(1)                                         POSTALIAS(1)
               tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
-       B-w    Do  not  warn  about  duplicate  entries;  silently
+       <b>-w</b>     Do  not  warn  about  duplicate  entries;  silently
               ignore them.
 
        Arguments:
index 1f206e176551df99f2f8104e46641eb73627ebcb..a4654e46dbd7db62c6db26a045e3f6489057508e 100644 (file)
@@ -337,6 +337,8 @@ code for <b>REJECT</b> results (default:  <b>554</b>).
 
 <p>
 
+<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>
+
 <dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>
 
 <dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>
@@ -447,6 +449,8 @@ response code to rejected requests (default:  <b>504</b>).
 
 <p>
 
+<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>
+
 <dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>
 
 <dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>
@@ -589,6 +593,8 @@ response code to rejected requests (default:  <b>504</b>).
 
 <p>
 
+<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>
+
 <dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>
 
 <dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>
@@ -677,6 +683,8 @@ the request if the result is anything else.  The <b>access_map_reject_code
 
 <p>
 
+<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>
+
 <dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>
 
 <dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>
old mode 100644 (file)
new mode 100755 (executable)
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 38e36a2bb752dcbfc6b2d72daa7da6fb723e9203..44ebc090a0e8624f6f86344b5e57d8910f886df5 100644 (file)
@@ -1,11 +1,11 @@
 SHELL  = /bin/sh
 SRCS   = alias.c command.c delivered.c dotforward.c file.c forward.c \
        include.c indirect.c local.c mailbox.c recipient.c resolve.c token.c \
-       deliver_attr.c feature.c maildir.c biff_notify.c unknown.c \
+       deliver_attr.c maildir.c biff_notify.c unknown.c \
        local_expand.c
 OBJS   = alias.o command.o delivered.o dotforward.o file.o forward.o \
        include.o indirect.o local.o mailbox.o recipient.o resolve.o token.o \
-       deliver_attr.o feature.o maildir.o biff_notify.o unknown.o \
+       deliver_attr.o maildir.o biff_notify.o unknown.o \
        local_expand.o
 HDRS   = local.h
 TESTSRC        =
@@ -25,7 +25,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
@@ -97,8 +97,6 @@ command.o: ../include/vstring.h
 command.o: ../include/vbuf.h
 command.o: ../include/vstream.h
 command.o: ../include/argv.h
-command.o: ../include/mac_expand.h
-command.o: ../include/mac_parse.h
 command.o: ../include/defer.h
 command.o: ../include/bounce.h
 command.o: ../include/sent.h
@@ -169,22 +167,6 @@ dotforward.o: ../include/tok822.h
 dotforward.o: ../include/resolve_clnt.h
 dotforward.o: ../include/deliver_request.h
 dotforward.o: ../include/recipient_list.h
-feature.o: feature.c
-feature.o: ../include/sys_defs.h
-feature.o: ../include/msg.h
-feature.o: ../include/stringops.h
-feature.o: ../include/mymalloc.h
-feature.o: ../include/mail_params.h
-feature.o: local.h
-feature.o: ../include/htable.h
-feature.o: ../include/vstream.h
-feature.o: ../include/vbuf.h
-feature.o: ../include/vstring.h
-feature.o: ../include/been_here.h
-feature.o: ../include/tok822.h
-feature.o: ../include/resolve_clnt.h
-feature.o: ../include/deliver_request.h
-feature.o: ../include/recipient_list.h
 file.o: file.c
 file.o: ../include/sys_defs.h
 file.o: ../include/msg.h
@@ -200,6 +182,7 @@ file.o: ../include/defer.h
 file.o: ../include/sent.h
 file.o: ../include/been_here.h
 file.o: ../include/mail_params.h
+file.o: ../include/dot_lockfile_as.h
 file.o: local.h
 file.o: ../include/tok822.h
 file.o: ../include/resolve_clnt.h
@@ -408,9 +391,11 @@ token.o: ../include/htable.h
 token.o: ../include/readlline.h
 token.o: ../include/mymalloc.h
 token.o: ../include/vstring_vstream.h
+token.o: ../include/stringops.h
 token.o: ../include/tok822.h
 token.o: ../include/resolve_clnt.h
 token.o: ../include/mail_params.h
+token.o: ../include/bounce.h
 token.o: local.h
 token.o: ../include/been_here.h
 token.o: ../include/deliver_request.h
index cd975ebcd2955c309faa774b4a5df07f272f92fc..00c241eec1321cf2658d05a661632c27d02fd0f7 100644 (file)
@@ -135,6 +135,7 @@ int     deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr,
     struct mypasswd *alias_pwd;
     VSTRING *canon_owner;
     DICT   *dict;
+    const char *owner_rhs;                     /* owner alias, RHS */
 
     /*
      * Make verbose logging easier to understand.
@@ -249,9 +250,10 @@ int     deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr,
            concatenate("owner-", name, (char *) 0)))
 
            expansion = mystrdup(alias_result);
-           if (OWNER_ASSIGN(owner) != 0 && maps_find(maps, owner,
-                                                     DICT_FLAG_FIXED)) {
-               canon_owner = canon_addr_internal(vstring_alloc(10), owner);
+           if (OWNER_ASSIGN(owner) != 0
+           && (owner_rhs = maps_find(maps, owner, DICT_FLAG_FIXED)) != 0) {
+               canon_owner = canon_addr_internal(vstring_alloc(10),
+                                    var_exp_own_alias ? owner_rhs : owner);
                SET_OWNER_ATTR(state.msg_attr, STR(canon_owner), state.level);
            } else {
                canon_owner = 0;
index edf29d47f0a3d8aed24066363842383be4feffed..ee1c843087f51eb4f71e668166c4ecaa37939f4a 100644 (file)
@@ -130,7 +130,7 @@ int     deliver_command(LOCAL_STATE state, USER_ATTR usr_attr, char *command)
      * Deliver.
      */
     copy_flags = MAIL_COPY_FROM | MAIL_COPY_RETURN_PATH;
-    if ((state.msg_attr.features & FEATURE_NODELIVERED) == 0)
+    if (local_deliver_hdr_mask & DELIVER_HDR_CMD)
        copy_flags |= MAIL_COPY_DELIVERED;
 
     why = vstring_alloc(1);
index 11dbf09a5a4f4ba3c8fcd38bf6e942dea42ceb99..7a77bce75c14d544916351036cbfb159dbb015ba 100644 (file)
@@ -62,7 +62,6 @@ void    deliver_attr_init(DELIVER_ATTR *attrp)
     attrp->relay = 0;
     attrp->exp_type = 0;
     attrp->exp_from = 0;
-    attrp->features = 0;
 }
 
 /* deliver_attr_dump - log message delivery attributes */
@@ -87,5 +86,4 @@ void    deliver_attr_dump(DELIVER_ATTR *attrp)
     msg_info("relay: %s", attrp->relay ? attrp->relay : "null");
     msg_info("exp_type: %d", attrp->exp_type);
     msg_info("exp_from: %s", attrp->exp_from ? attrp->exp_from : "null");
-    msg_info("features: %d", attrp->features);
 }
index ed1e13429203bcbfcee626214eec62094e5f0e0c..51568bbf7ed737c2694b7d4bfbdb09679b68f1fc 100644 (file)
@@ -147,7 +147,6 @@ int     deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
      * these are the rights of root, the /file and |command delivery routines
      * will use unprivileged default rights instead. Better safe than sorry.
      */
-    if (mypwd->pw_uid != 0)
        SET_USER_ATTR(usr_attr, mypwd, state.level);
 
     /*
diff --git a/postfix/local/feature.c b/postfix/local/feature.c
deleted file mode 100644 (file)
index 1a1db60..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*++
-/* NAME
-/*     feature 3
-/* SUMMARY
-/*     toggle features depending on address
-/* SYNOPSIS
-/*     #include "local.h"
-/*
-/*     int     feature_control(state)
-/*     LOCAL_STATE state;
-/* DESCRIPTION
-/*     feature_control() breaks the localpart of the recipient
-/*     address up into fields, according to the recipient feature
-/*     delimiter, and turns on/off the features as encountered.
-/*
-/*     Arguments:
-/* .IP state
-/*     The attributes that specify the message, recipient and more.
-/*     Attributes describing the alias, include or forward expansion.
-/*     A table with the results from expanding aliases or lists.
-/* 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 <string.h>
-
-#ifdef STRCASECMP_IN_STRINGS_H
-#include <strings.h>
-#endif
-
-/* Utility library. */
-
-#include <msg.h>
-#include <stringops.h>
-#include <mymalloc.h>
-
-/* Global library. */
-
-#include <mail_params.h>
-
-/* Application-specific. */
-
-#include "local.h"
-
-struct feature_map {
-    char   *name;
-    int     mask;
-};
-
-static struct feature_map feature_map[] = {
-    "nodelivered", FEATURE_NODELIVERED,
-    0,
-};
-
-/* feature_control - extract delivery options from recipient localpart */
-
-int     feature_control(const char *localpart)
-{
-    struct feature_map *mp;
-    char   *saved_localpart;
-    char   *ptr;
-    int     mask = 0;
-    char   *cp;
-
-    if (*var_rcpt_fdelim) {
-       ptr = saved_localpart = mystrdup(localpart);
-       while ((cp = mystrtok(&ptr, var_rcpt_fdelim)) != 0) {
-           for (mp = feature_map; mp->name; mp++)
-               if (strcasecmp(mp->name, cp) == 0) {
-                   if (msg_verbose)
-                       msg_info("feature: %s", mp->name);
-                   mask |= mp->mask;
-                   break;
-               }
-       }
-       myfree(saved_localpart);
-    }
-    if (msg_verbose)
-       msg_info("features: 0x%x", mask);
-    return (mask);
-}
index 3b8dcc4496d269c5847606e98ec6d0c994870ced..488c5df01f14dd12c7c0682f29ee45821ea2f7a9 100644 (file)
@@ -68,6 +68,7 @@
 #include <sent.h>
 #include <been_here.h>
 #include <mail_params.h>
+#include <dot_lockfile_as.h>
 
 /* Application-specific. */
 
@@ -87,6 +88,11 @@ int     deliver_file(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
     int     status;
     int     copy_flags;
 
+#ifdef USE_DOT_LOCK
+    int     lock = -1;
+
+#endif
+
     /*
      * Make verbose logging easier to understand.
      */
@@ -143,7 +149,7 @@ int     deliver_file(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
      * existing file.
      */
     copy_flags = MAIL_COPY_MBOX;
-    if (state.msg_attr.features & FEATURE_NODELIVERED)
+    if ((local_deliver_hdr_mask & DELIVER_HDR_FILE) == 0)
        copy_flags &= ~MAIL_COPY_DELIVERED;
 
 #define FOPEN_AS(p,u,g) ( \
@@ -166,6 +172,14 @@ int     deliver_file(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
        vstream_fclose(dst);
        status = bounce_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr),
                               "executable destination file %s", path);
+#ifdef USE_DOT_LOCK
+    } else if ((lock = dot_lockfile_as(path, why, usr_attr.uid, usr_attr.gid)) < 0
+              && errno == EEXIST) {
+       vstream_fclose(dst);
+       status = defer_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr),
+                             "cannot append destination file %s: %s",
+                             path, STR(why));
+#endif
     } else if (mail_copy(COPY_ATTR(state.msg_attr), dst, S_ISREG(st.st_mode) ?
                      copy_flags : (copy_flags & ~MAIL_COPY_TOFILE), why)) {
        status = defer_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr),
@@ -178,6 +192,10 @@ int     deliver_file(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
     /*
      * Clean up.
      */
+#ifdef USE_DOT_LOCK
+    if (lock == 0)
+       dot_unlockfile_as(path, usr_attr.uid, usr_attr.gid);
+#endif
     vstring_free(why);
     return (status);
 }
index 2c9060ad0c3333b57ba23882ebcf0570f7c98be9..3d66a8cff5c61e3527009fc06ff33126da5354ef 100644 (file)
@@ -205,8 +205,9 @@ static int forward_send(FORWARD_INFO *info, DELIVER_ATTR attr, char *delivered)
                var_myhostname, var_mail_name);
     rec_fprintf(info->cleanup, REC_TYPE_NORM, "\tid %s; %s",
                info->queue_id, mail_date(info->posting_time));
-    rec_fprintf(info->cleanup, REC_TYPE_NORM, "Delivered-To: %s",
-               lowercase(vstring_str(buffer)));
+    if (local_deliver_hdr_mask & DELIVER_HDR_FWD)
+       rec_fprintf(info->cleanup, REC_TYPE_NORM, "Delivered-To: %s",
+                   lowercase(vstring_str(buffer)));
     if ((status = vstream_ferror(info->cleanup)) == 0)
        if (vstream_fseek(attr.fp, attr.offset, SEEK_SET) < 0)
            msg_fatal("%s: seek queue file %s: %m:",
index 91cdfc96a204ed2c6a96c7864a4fb8328e16b3c4..e75c9a149630cc31b3f140f89feac91da646425b 100644 (file)
 /*
 /*     In the case of UNIX-style mailbox delivery,
 /*     the \fBlocal\fR daemon prepends a "\fBFrom \fIsender time_stamp\fR"
-/*     envelope header to each message, prepends a \fBDelivered-To:\fR header
+/*     envelope header to each message, prepends an
+/*     optional \fBDelivered-To:\fR header
 /*     with the envelope recipient address, prepends a \fBReturn-Path:\fR
 /*     header with the envelope sender address, prepends a \fB>\fR character
 /*     to lines beginning with "\fBFrom \fR", and appends an empty line.
 /*     mailbox to its original length.
 /*
 /*     In the case of \fBmaildir\fR delivery, the local daemon prepends
-/*     a \fBDelivered-To:\fR header with the envelope recipient address
+/*     an optional
+/*     \fBDelivered-To:\fR header with the envelope recipient address
 /*     and prepends a \fBReturn-Path:\fR header with the envelope sender
 /*     address.
 /* EXTERNAL COMMAND DELIVERY
 /*     The current working directory is the mail queue directory.
 /*
 /*     The \fBlocal\fR daemon prepends a "\fBFrom \fIsender time_stamp\fR"
-/*     envelope header to each message, prepends a \fBDelivered-To:\fR
+/*     envelope header to each message, prepends an
+/*     optional \fBDelivered-To:\fR
 /*     header with the recipient envelope address, prepends a
 /*     \fBReturn-Path:\fR header with the sender envelope address,
 /*     and appends an empty line.
 /*     \fBmaildir\fR delivery.
 /*
 /*     The \fBlocal\fR daemon prepends a "\fBFrom \fIsender time_stamp\fR"
-/*     envelope header to each message, prepends a \fBDelivered-To:\fR
+/*     envelope header to each message, prepends an
+/*     optional \fBDelivered-To:\fR
 /*     header with the recipient envelope address, prepends a \fB>\fR
 /*     character to lines beginning with "\fBFrom \fR", and appends an
 /*     empty line.
 /*     is made to truncate a regular file to its original length.
 /*
 /*     In the case of \fBmaildir\fR delivery, the local daemon prepends
-/*     a \fBDelivered-To:\fR header with the envelope recipient address.
+/*     an optional
+/*     \fBDelivered-To:\fR header with the envelope recipient address.
 /*     The envelope sender address is available in the \fBReturn-Path:\fR
 /*     header.
 /* ADDRESS EXTENSION
 /*     to the mailbox owned by the user \fIname\fR, or it is sent back as
 /*     undeliverable.
 /*
-/*     In all cases the \fBlocal\fR daemon prepends a
+/*     In all cases the \fBlocal\fR daemon prepends an opional
 /*     `\fBDelivered-To:\fR \fIname\fR+\fIfoo\fR' header line.
 /* DELIVERY RIGHTS
 /* .ad
 /* .fi
 /* .IP \fBalias_maps\fR
 /*     List of alias databases.
+/* .IP \fBexpand_owner_alias\fR
+/*     When delivering to an alias that has an owner- companion alias,
+/*     set the envelope sender address to the right-hand side of the
+/*     owner alias, instead using of the left-hand side address.
 /* .IP \fBforward_path\fR
 /*     Search list for .forward files.  The names are subject to \fI$name\fR
 /*     expansion.
 /*     /some/where/smrsh -c).
 /*     When a shell is specified, it is invoked even when the command
 /*     contains no shell built-in commands or meta characters.
+/* .IP \fBprepend_delivered_header\fR
+/*     Prepend an optional \fBDelivered-To:\fR header upon external
+/*     forwarding, delivery to command or file. Specify zero or more of:
+/*     \fBcommand, file, forward\fR. Turning off \fBDelivered-To:\fR when
+/*     forwarding mail is not recommended.
 /* .IP \fBowner_request_special\fR
 /*     Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR
 /*     addresses.
@@ -415,10 +429,13 @@ char   *var_fallback_transport;
 char   *var_forward_path;
 char   *var_cmd_exp_filter;
 char   *var_prop_extension;
+int     var_exp_own_alias;
+char   *var_deliver_hdr;
 
 int     local_cmd_deliver_mask;
 int     local_file_deliver_mask;
 int     local_ext_prop_mask;
+int     local_deliver_hdr_mask;
 
 /* local_deliver - deliver message with extreme prejudice */
 
@@ -536,10 +553,17 @@ static void local_mask_init(void)
        "include", EXPAND_TYPE_INCL,
        0,
     };
+    static NAME_MASK deliver_mask[] = {
+       "command", DELIVER_HDR_CMD,
+       "file", DELIVER_HDR_FILE,
+       "forward", DELIVER_HDR_FWD,
+       0,
+    };
 
     local_file_deliver_mask = name_mask(file_mask, var_allow_files);
     local_cmd_deliver_mask = name_mask(command_mask, var_allow_commands);
     local_ext_prop_mask = ext_prop_mask(var_prop_extension);
+    local_deliver_hdr_mask = name_mask(deliver_mask, var_deliver_hdr);
 }
 
 /* pre_accept - see if tables have changed */
@@ -578,17 +602,18 @@ int     main(int argc, char **argv)
        VAR_HOME_MAILBOX, DEF_HOME_MAILBOX, &var_home_mailbox, 0, 0,
        VAR_ALLOW_COMMANDS, DEF_ALLOW_COMMANDS, &var_allow_commands, 0, 0,
        VAR_ALLOW_FILES, DEF_ALLOW_FILES, &var_allow_files, 0, 0,
-       VAR_RCPT_FDELIM, DEF_RCPT_FDELIM, &var_rcpt_fdelim, 0, 0,
        VAR_LOCAL_CMD_SHELL, DEF_LOCAL_CMD_SHELL, &var_local_cmd_shell, 0, 0,
        VAR_MAIL_SPOOL_DIR, DEF_MAIL_SPOOL_DIR, &var_mail_spool_dir, 0, 0,
        VAR_MAILBOX_TRANSP, DEF_MAILBOX_TRANSP, &var_mailbox_transport, 0, 0,
        VAR_FALLBACK_TRANSP, DEF_FALLBACK_TRANSP, &var_fallback_transport, 0, 0,
        VAR_CMD_EXP_FILTER, DEF_CMD_EXP_FILTER, &var_cmd_exp_filter, 1, 0,
        VAR_PROP_EXTENSION, DEF_PROP_EXTENSION, &var_prop_extension, 0, 0,
+       VAR_DELIVER_HDR, DEF_DELIVER_HDR, &var_deliver_hdr, 0, 0,
        0,
     };
     static CONFIG_BOOL_TABLE bool_table[] = {
        VAR_BIFF, DEF_BIFF, &var_biff,
+       VAR_EXP_OWN_ALIAS, DEF_EXP_OWN_ALIAS, &var_exp_own_alias,
        0,
     };
 
index 63e7b1fcc1d22687b48e7b53908062e05820743c..0332cebc091a19adce024419573279637dab6d57 100644 (file)
@@ -79,7 +79,6 @@ typedef struct DELIVER_ATTR {
     long    arrival_time;              /* arrival time */
     int     exp_type;                  /* expansion type. see below */
     char   *exp_from;                  /* expanded_from */
-    int     features;                  /* see below */
 } DELIVER_ATTR;
 
 extern void deliver_attr_init(DELIVER_ATTR *);
@@ -89,8 +88,6 @@ extern void deliver_attr_dump(DELIVER_ATTR *);
 #define EXPAND_TYPE_FWD                (1<<1)
 #define EXPAND_TYPE_INCL       (1<<2)
 
-#define FEATURE_NODELIVERED    (1<<0)  /* no delivered-to */
-
  /*
   * Rather than schlepping around dozens of arguments, here is one that has
   * all. Well, almost. The user attributes are just a bit too sensitive, so
@@ -169,6 +166,15 @@ extern int local_cmd_deliver_mask;
   */
 extern int local_ext_prop_mask;
 
+ /*
+  * When to prepend a Delivered-To: header upon external delivery.
+  */
+#define DELIVER_HDR_CMD                (1<<0)
+#define DELIVER_HDR_FILE       (1<<1)
+#define DELIVER_HDR_FWD                (1<<2)
+
+extern int local_deliver_hdr_mask;
+
  /*
   * delivered.c
   */
index da51c7dddd48f4ad3c6495448bbfbea3eaecaf2a..31beaa17991b88ea5f96225486d05eba0c626743 100644 (file)
@@ -176,7 +176,7 @@ static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr)
      * Write the file as the recipient, so that file quota work.
      */
     copy_flags = MAIL_COPY_MBOX;
-    if (state.msg_attr.features & FEATURE_NODELIVERED)
+    if ((local_deliver_hdr_mask & DELIVER_HDR_FILE) == 0)
        copy_flags &= ~MAIL_COPY_DELIVERED;
 
     set_eugid(spool_uid, spool_gid);
index 50d8436064eb39796ad3d483c06098d7ad08e1e8..ec8eca5e91fb55f3e15cdf4324a9cbfdd7faf5e0 100644 (file)
@@ -101,7 +101,7 @@ int     deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
     why = vstring_alloc(100);
 
     copy_flags = MAIL_COPY_TOFILE | MAIL_COPY_RETURN_PATH;
-    if ((state.msg_attr.features & FEATURE_NODELIVERED) == 0)
+    if (local_deliver_hdr_mask & DELIVER_HDR_FILE)
        copy_flags |= MAIL_COPY_DELIVERED;
 
     newdir = concatenate(path, "new/", (char *) 0);
index 5cc549d1229f4d6c8521df3219a9fa49d1ed0f73..f962c7608344048546edbe9a5979c86192e686b5 100644 (file)
@@ -204,7 +204,6 @@ int     deliver_recipient(LOCAL_STATE state, USER_ATTR usr_attr)
     lowercase(state.msg_attr.local);
     if ((state.msg_attr.domain = split_at_right(state.msg_attr.local, '@')) == 0)
        msg_warn("no @ in recipient address: %s", state.msg_attr.local);
-    state.msg_attr.features = feature_control(state.msg_attr.local);
 
     /*
      * Address extension management.
index 6f788a328e23a77e59976ed9bc34e1034949bd43..d9ca86d4ca76577824040d6ef48f2db955922e47 100644 (file)
 /*     This module delivers to addresses listed in an alias database
 /*     entry, in an include file, or in a .forward file.
 /*
-/*     deliver_token() delivers to the address in the given token.
+/*     deliver_token() delivers to the address in the given token:
+/*     an absolute /path/name, a ~/path/name relative to the recipient's
+/*     home directory, an :include:/path/name request, an external 
+/*     "|command", or a mail address.
 /*
 /*     deliver_token_string() delivers to all addresses listed in
 /*     the specified string.
 #include <readlline.h>
 #include <mymalloc.h>
 #include <vstring_vstream.h>
+#include <stringops.h>
 
 /* Global library. */
 
 #include <tok822.h>
 #include <mail_params.h>
+#include <bounce.h>
 
 /* Application-specific. */
 
 #include "local.h"
 
+/* deliver_token_home - expand ~token */
+
+static int deliver_token_home(LOCAL_STATE state, USER_ATTR usr_attr, char *addr)
+{
+    char   *full_path;
+    int     status;
+
+    if (addr[1] != '/') {                      /* disallow ~user */
+       status = bounce_append(BOUNCE_FLAG_KEEP,
+                              BOUNCE_ATTR(state.msg_attr),
+                              "bad home directory syntax for: %s", addr);
+    } else if (usr_attr.home == 0) {           /* require user context */
+       status = bounce_append(BOUNCE_FLAG_KEEP,
+                              BOUNCE_ATTR(state.msg_attr),
+                              "unknown home directory for: %s", addr);
+    } else if (usr_attr.home[0] == '/' && usr_attr.home[1] == 0) {
+       status = deliver_file(state, usr_attr, addr + 1);
+    } else {                                   /* expand ~ to home */
+       full_path = concatenate(usr_attr.home, addr + 1, (char *) 0);
+       status = deliver_file(state, usr_attr, full_path);
+       myfree(full_path);
+    }
+    return (status);
+}
+
 /* deliver_token - deliver to expansion of include file or alias */
 
 int     deliver_token(LOCAL_STATE state, USER_ATTR usr_attr, TOK822 *addr)
@@ -115,6 +145,8 @@ int     deliver_token(LOCAL_STATE state, USER_ATTR usr_attr, TOK822 *addr)
 
     if (*STR(addr_buf) == '/') {
        status = deliver_file(state, usr_attr, STR(addr_buf));
+    } else if (*STR(addr_buf) == '~') {
+       status = deliver_token_home(state, usr_attr, STR(addr_buf));
     } else if (*STR(addr_buf) == '|') {
        status = deliver_command(state, usr_attr, STR(addr_buf) + 1);
     } else if (strncasecmp(STR(addr_buf), include, sizeof(include) - 1) == 0) {
index 50e58dec2594b488ba43938ecc3c0c22a0d3111b..dbdd3b3e5d5903903df030a684e445d4bafa65bb 100644 (file)
@@ -116,11 +116,32 @@ case "$SYSTEM.$RELEASE" in
                  esac;;
                esac
                ;;
+   ULTRIX.4*)  SYSTYPE=ULTRIX4
+               if [ -f /usr/local/lib/libdb.a ]; then
+                   SYSLIBS="$SYSLIBS -ldb"
+                   CCARGS="$CCARGS -DHAS_DB"
+                   if [ -d /usr/local/include/db ]; then
+                       CCARGS="$CCARGS -I/usr/local/include/db"
+                   fi
+               fi
+               for l in syslog resolv; do
+                   if [ -f /usr/local/lib/lib$l.a ]; then
+                       SYSLIBS="$SYSLIBS -l$l"
+                   fi
+               done
+               ;;
        AIX.*)  case "`uname -v`" in
                4)      SYSTYPE=AIX4
                        # How embarrassing...
                        case "$CC" in
-                       cc|*/cc|xlc|*/xlc) OPT=;;
+                       cc|*/cc|xlc|*/xlc) OPT=; CCARGS="$CCARGS -w";;
+                       esac
+                       CCARGS="$CCARGS -D_ALL_SOURCE"
+                       ;;
+               3)      SYSTYPE=AIX3
+                       # How embarrassing...
+                       case "$CC" in
+                       cc|*/cc|xlc|*/xlc) OPT=; CCARGS="$CCARGS -w";;
                        esac
                        CCARGS="$CCARGS -D_ALL_SOURCE"
                        ;;
@@ -170,6 +191,12 @@ HP-UX.B.11.*)      SYSTYPE=HPUX11
                    SYSLIBS="$SYSLIBS -ldb"
                fi
                ;;
+ReliantUNIX-?.5.43) SYSTYPE=ReliantUnix543
+               RANLIB=echo
+               SYSLIBS="-lresolv -lsocket -lnsl"
+               ;;
+ Rhapsody.5*)  SYSTYPE=RHAPSODY5
+               ;;
         ".")   if [ -d /NextApps ]; then
                    SYSTYPE=`hostinfo | sed -n \
                        's/^.*NeXT Mach 3.*$/NEXTSTEP3/;/NEXTSTEP3/{p;q;}'`
index df598450a15cee764b7f14d3e050225d0fee3b5c..c776af6da1e4c9b2c12ab04398f7965d10d82d86 100644 (file)
@@ -13,7 +13,7 @@ CONFIG        = man5/access.5 man5/aliases.5 man5/canonical.5 man5/relocated.5 \
 update:        $(DAEMONS) $(COMMANDS) $(CONFIG)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 clean:
        rm -f cat?/*
index 22e0ca9fd8806925d59483852e61b5d7a25cddcb..e81b4d17f4c463ce4a77d4007a80dc28ca76fc9a 100644 (file)
@@ -34,7 +34,7 @@ a new database from the entries in \fBfile_name\fR.
 .IP \fB-v\fR
 Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 options make the software increasingly verbose.
-.IP \f\B-w\fR
+.IP \fB-w\fR
 Do not warn about duplicate entries; silently ignore them.
 .PP
 Arguments:
index 9142b6a0f9947096492ae53a924780f8c41d27bf..b0b165d6d2feacf34fcc6be855184301f8fb6310 100644 (file)
@@ -114,7 +114,8 @@ for recipients that are not found in the UNIX passwd database.
 
 In the case of UNIX-style mailbox delivery,
 the \fBlocal\fR daemon prepends a "\fBFrom \fIsender time_stamp\fR"
-envelope header to each message, prepends a \fBDelivered-To:\fR header
+envelope header to each message, prepends an
+optional \fBDelivered-To:\fR header
 with the envelope recipient address, prepends a \fBReturn-Path:\fR
 header with the envelope sender address, prepends a \fB>\fR character
 to lines beginning with "\fBFrom \fR", and appends an empty line.
@@ -123,7 +124,8 @@ progress. In case of problems, an attempt is made to truncate the
 mailbox to its original length.
 
 In the case of \fBmaildir\fR delivery, the local daemon prepends
-a \fBDelivered-To:\fR header with the envelope recipient address
+an optional
+\fBDelivered-To:\fR header with the envelope recipient address
 and prepends a \fBReturn-Path:\fR header with the envelope sender
 address.
 .SH EXTERNAL COMMAND DELIVERY
@@ -176,7 +178,8 @@ environment variable is always passed on without change.
 The current working directory is the mail queue directory.
 
 The \fBlocal\fR daemon prepends a "\fBFrom \fIsender time_stamp\fR"
-envelope header to each message, prepends a \fBDelivered-To:\fR
+envelope header to each message, prepends an
+optional \fBDelivered-To:\fR
 header with the recipient envelope address, prepends a
 \fBReturn-Path:\fR header with the sender envelope address,
 and appends an empty line.
@@ -192,7 +195,8 @@ Specify a pathname ending in \fB/\fR for \fBqmail\fR-compatible
 \fBmaildir\fR delivery.
 
 The \fBlocal\fR daemon prepends a "\fBFrom \fIsender time_stamp\fR"
-envelope header to each message, prepends a \fBDelivered-To:\fR
+envelope header to each message, prepends an
+optional \fBDelivered-To:\fR
 header with the recipient envelope address, prepends a \fB>\fR
 character to lines beginning with "\fBFrom \fR", and appends an
 empty line.
@@ -203,7 +207,8 @@ access while delivery is in progress. In case of problems, an attempt
 is made to truncate a regular file to its original length.
 
 In the case of \fBmaildir\fR delivery, the local daemon prepends
-a \fBDelivered-To:\fR header with the envelope recipient address.
+an optional
+\fBDelivered-To:\fR header with the envelope recipient address.
 The envelope sender address is available in the \fBReturn-Path:\fR
 header.
 .SH ADDRESS EXTENSION
@@ -222,7 +227,7 @@ or to the alias \fIname\fR, to the destinations listed in
 to the mailbox owned by the user \fIname\fR, or it is sent back as
 undeliverable.
 
-In all cases the \fBlocal\fR daemon prepends a
+In all cases the \fBlocal\fR daemon prepends an opional
 `\fBDelivered-To:\fR \fIname\fR+\fIfoo\fR' header line.
 .SH DELIVERY RIGHTS
 .na
@@ -274,6 +279,10 @@ a configuration change.
 .fi
 .IP \fBalias_maps\fR
 List of alias databases.
+.IP \fBexpand_owner_alias\fR
+When delivering to an alias that has an owner- companion alias,
+set the envelope sender address to the right-hand side of the
+owner alias, instead using of the left-hand side address.
 .IP \fBforward_path\fR
 Search list for .forward files.  The names are subject to \fI$name\fR
 expansion.
@@ -282,6 +291,11 @@ Shell to use for external command execution (for example,
 /some/where/smrsh -c).
 When a shell is specified, it is invoked even when the command
 contains no shell built-in commands or meta characters.
+.IP \fBprepend_delivered_header\fR
+Prepend an optional \fBDelivered-To:\fR header upon external
+forwarding, delivery to command or file. Specify zero or more of:
+\fBcommand, file, forward\fR. Turning off \fBDelivered-To:\fR when
+forwarding mail is not recommended.
 .IP \fBowner_request_special\fR
 Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR
 addresses.
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index fe194f86e4d5b8fa6ef6811eb008474ebd292569..9f9c4285ac69e1814e1e82f817e22a63651784c9 100644 (file)
@@ -27,7 +27,7 @@ BIN_DIR       = ../libexec
 all:   $(PROG) $(LIB)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
index a1b5215c24c5caf9237033f89ab35e5b691478fb..8568004da36c43cd6e95e5645a5c09c48aabd11d 100644 (file)
@@ -178,14 +178,14 @@ void    master_spawn(MASTER_SERV *serv)
        close(serv->status_fd[0]);              /* status channel */
        if (serv->status_fd[1] <= MASTER_STATUS_FD)
            msg_fatal("%s: status file descriptor collision", myname);
-       if (dup2(serv->status_fd[1], MASTER_STATUS_FD) < 0)
+       if (DUP2(serv->status_fd[1], MASTER_STATUS_FD) < 0)
            msg_fatal("%s: dup2 status_fd: %m", myname);
        (void) close(serv->status_fd[1]);
 
        for (n = 0; n < serv->listen_fd_count; n++) {
            if (serv->listen_fd[n] <= MASTER_LISTEN_FD + n)
                msg_fatal("%s: listen file descriptor collision", myname);
-           if (dup2(serv->listen_fd[n], MASTER_LISTEN_FD + n) < 0)
+           if (DUP2(serv->listen_fd[n], MASTER_LISTEN_FD + n) < 0)
                msg_fatal("%s: dup2 listen_fd %d: %m",
                          myname, serv->listen_fd[n]);
            (void) close(serv->listen_fd[n]);
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 1701c087bfad34be4dabc971fa5539c7a24204dc..d3b0f35d95bfbbcc8ab166d62697bb81f57fd9e1 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 0a24077ea97f140fb8a27637f04134eca6ebaaec..f58fbf0453bac96b5cfe0a5f96c9a352f83b71b7 100644 (file)
@@ -19,7 +19,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 3869efbb2a0f1dee8bc5cfe7d7a6f4388458a55d..3c4690eaf539d852c4bb6f4db0ba69c8af12ff3c 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 9e6408165f50dd967929667cb773e8a58f8b0a8d..d912c6750a4545d9e53935e3e8afc0ea234e16ec 100644 (file)
@@ -28,7 +28,7 @@
 /* .IP \fB-v\fR
 /*     Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 /*     options make the software increasingly verbose.
-/* .IP \f\B-w\fR
+/* .IP \fB-w\fR
 /*     Do not warn about duplicate entries; silently ignore them.
 /* .PP
 /*     Arguments:
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 490136661c93f62c862ba6d12c22c1b17bc9a1f5..68175a8ba04a1c0bd7dee8db7c4f7cf6b3374c55 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 44875dc5dcb9e2bf6e8d95437be12d3b80a033dc..187178306910d5777770394e9ca5d9a623252ada 100644 (file)
@@ -26,7 +26,7 @@ $(PROG): $(OBJS) $(LIBS)
        ./$(PROG) -d |egrep -v '^(myhostname|mydomain|mynetworks) ' >$@
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 0ebc839e87440e2f31c66af86021140d8d51968f..cb8ed7547aa30da8a4af8756a1d1373022de89da 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 76135b5eaeb5471c4c6c3448fa90e503601189b8..d807c878b5c66f0fa84ce5daf0ae60e58eea7db6 100644 (file)
@@ -20,7 +20,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 97bfe052d57913c4435dfc45a06d0269fe227184..9a0fd6b029d5f31b92de39b3407098d7c628c2bc 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index dca43797f38c4047edc44524187dd72f4b3a3fc0..6117bc9e71d96936efc8c436da04d601a77ab28c 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index cd8afeffc5e921b58f3968da75befc4fd01cdebc..fbfad473f143037ee20695d0c80ba7958468eed0 100644 (file)
@@ -20,7 +20,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index d094449001ac8277f238db424f7afd314ca8d20a..436b7d748ef1305cb33bd0184c4b4e7721211068 100644 (file)
@@ -19,7 +19,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index fa73f4a055986deae542f3cb9ffd71d6b975ff80..1b58244f9c82195dbfbdc0de798175501a4e8ecd 100644 (file)
@@ -19,7 +19,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 1b9d18192a61334b53d9848ecfc75b6456deec27..41c570bc203b23826e4d5dc53a46af8a3b17ad13 100644 (file)
@@ -23,7 +23,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index b50388300d5d568e3bdc5141fe70a6a9c864d960..54ba8d5380bc74de54e5ca744cfbafb2374e408d 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index da83116c443ab80fa914b3c4c82760a01c7b686c..55a1e0879e051ca6914412a01e194f3fd85045ba 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index edff7061b77431ef16ed55710f72ef317cb69b28..cd78128a39e6cc5bcddec250e96a15c1e4beee4c 100644 (file)
@@ -21,7 +21,7 @@ $(PROG):      $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
@@ -173,6 +173,7 @@ smtp_session.o: ../include/sys_defs.h
 smtp_session.o: ../include/mymalloc.h
 smtp_session.o: ../include/vstream.h
 smtp_session.o: ../include/vbuf.h
+smtp_session.o: ../include/stringops.h
 smtp_session.o: smtp.h
 smtp_session.o: ../include/vstring.h
 smtp_session.o: ../include/argv.h
index 0d34d8372127614a7f723c41ffb3827e6879ce91..e236d9a07707f7647ea0029a88ad29658455b717 100644 (file)
@@ -54,6 +54,7 @@ typedef struct SMTP_SESSION {
     VSTREAM *stream;                   /* network connection */
     char   *host;                      /* mail exchanger */
     char   *addr;                      /* mail exchanger */
+    char   *namaddr;                   /* mail exchanger */
     int     best;                      /* most preferred host */
 } SMTP_SESSION;
 
index 7d3547461456e51848b47c0d074e26fe62aa10d7..de11387a122625ccf8a81d8a660610bbfd1267a9 100644 (file)
@@ -142,7 +142,7 @@ void    smtp_chat_cmd(SMTP_STATE *state, char *fmt,...)
      * program is trying to do.
      */
     if (msg_verbose)
-       msg_info("> %s: %s", session->host, STR(state->buffer));
+       msg_info("> %s: %s", session->namaddr, STR(state->buffer));
 
     /*
      * Send the command to the SMTP server.
@@ -177,9 +177,9 @@ SMTP_RESP *smtp_chat_resp(SMTP_STATE *state)
        cp = printable(STR(state->buffer), '?');
        if (last_char != '\n')
            msg_warn("%s: response longer than %d: %.30s...",
-                    session->host, var_line_limit, cp);
+                    session->namaddr, var_line_limit, cp);
        if (msg_verbose)
-           msg_info("< %s: %s", session->host, cp);
+           msg_info("< %s: %s", session->namaddr, cp);
        while (ISDIGIT(*cp))
            cp++;
        rdata.code = (cp - STR(state->buffer) == 3 ?
@@ -256,9 +256,9 @@ void    smtp_chat_notify(SMTP_STATE *state)
                      mail_addr_mail_daemon());
     post_mail_fprintf(notice, "To: %s (Postmaster)", var_error_rcpt);
     post_mail_fprintf(notice, "Subject: %s SMTP client: errors from %s",
-                     var_mail_name, session->host);
+                     var_mail_name, session->namaddr);
     post_mail_fputs(notice, "");
-    post_mail_fprintf(notice, "Unexpected response from %s.", session->host);
+    post_mail_fprintf(notice, "Unexpected response from %s.", session->namaddr);
     post_mail_fputs(notice, "");
     post_mail_fputs(notice, "Transcript of session follows.");
     post_mail_fputs(notice, "");
index 1cd81061ab0a68d78e17dec8db7bd9789023dc60..429119ebe486d5f6324a07b3f9c6e499e89e9f3c 100644 (file)
@@ -76,6 +76,7 @@
 /* System library. */
 
 #include <sys_defs.h>
+#include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
@@ -158,7 +159,7 @@ static SMTP_SESSION *smtp_connect_addr(DNS_RR *addr, unsigned port,
        memcpy((char *) &sin.sin_addr, addr_list->addrs, sizeof(sin.sin_addr));
        inaddr = ntohl(sin.sin_addr.s_addr);
        if (!IN_CLASSA(inaddr)
-       || !((inaddr & IN_CLASSA_NET) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
+           || !(((inaddr & IN_CLASSA_NET) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET)) {
            if (bind(sock, (struct sockaddr *) & sin, sizeof(sin)) < 0)
                msg_warn("%s: bind %s: %m", myname, inet_ntoa(sin.sin_addr));
            if (msg_verbose)
@@ -274,6 +275,8 @@ SMTP_SESSION *smtp_connect_domain(char *name, unsigned port, VSTRING *why)
            session->best = (addr->pref == addr_list->pref);
            break;
        }
+       msg_info("%s; address %s port %d", vstring_str(why),
+                inet_ntoa(*((struct in_addr *) addr->data)), port);
     }
     dns_rr_free(addr_list);
     return (session);
index b29b5c4184f9d15f386c9877e273693a2d6d9fa7..cb0080354f1e51ccae380e99f7e86d3c330d3620 100644 (file)
@@ -166,7 +166,7 @@ int     smtp_helo(SMTP_STATE *state)
     if (((resp = smtp_chat_resp(state))->code / 100) != 2)
        return (smtp_site_fail(state, resp->code,
                               "host %s refused to talk to me: %s",
-                           session->host, translit(resp->str, "\n", " ")));
+                        session->namaddr, translit(resp->str, "\n", " ")));
 
     /*
      * See if we are talking to ourself. This should not be possible with the
@@ -179,7 +179,7 @@ int     smtp_helo(SMTP_STATE *state)
     for (n = 0; (word = mystrtok(&words, " \t\n")) != 0; n++) {
        if (n == 0 && strcasecmp(word, var_myhostname) == 0) {
            msg_warn("host %s greeted me with my own hostname %s",
-                    session->host, var_myhostname);
+                    session->namaddr, var_myhostname);
            return (smtp_site_fail(state, session->best ? 550 : 450,
                                   "mail for %s loops back to myself",
                                   request->nexthop));
@@ -201,7 +201,7 @@ int     smtp_helo(SMTP_STATE *state)
        if ((resp = smtp_chat_resp(state))->code / 100 != 2)
            return (smtp_site_fail(state, resp->code,
                                   "host %s refused to talk to me: %s",
-                                  session->host,
+                                  session->namaddr,
                                   translit(resp->str, "\n", " ")));
     }
 
@@ -441,7 +441,7 @@ int     smtp_xfer(SMTP_STATE *state)
                case SMTP_STATE_MAIL:
                    if (resp->code / 100 != 2) {
                        smtp_mesg_fail(state, resp->code,
-                                      "host %s said: %s", session->host,
+                                      "host %s said: %s", session->namaddr,
                                       translit(resp->str, "\n", " "));
                        mail_from_rejected = 1;
                    }
@@ -461,7 +461,7 @@ int     smtp_xfer(SMTP_STATE *state)
                        } else {
                            rcpt = request->rcpt_list.info + recv_rcpt;
                            smtp_rcpt_fail(state, resp->code, rcpt,
-                                          "host %s said: %s", session->host,
+                                      "host %s said: %s", session->namaddr,
                                           translit(resp->str, "\n", " "));
                            rcpt->offset = 0;   /* in case deferred */
                        }
@@ -479,7 +479,7 @@ int     smtp_xfer(SMTP_STATE *state)
                    if (resp->code / 100 != 3) {
                        if (nrcpt > 0)
                            smtp_mesg_fail(state, resp->code,
-                                          "host %s said: %s", session->host,
+                                      "host %s said: %s", session->namaddr,
                                           translit(resp->str, "\n", " "));
                        nrcpt = -1;
                    }
@@ -500,14 +500,15 @@ int     smtp_xfer(SMTP_STATE *state)
                        if (resp->code / 100 != 2) {
                            smtp_mesg_fail(state, resp->code,
                                           "host %s said: %s",
-                                          session->host,
+                                          session->namaddr,
                                           translit(resp->str, "\n", " "));
                        } else {
                            for (nrcpt = 0; nrcpt < recv_rcpt; nrcpt++) {
                                rcpt = request->rcpt_list.info + nrcpt;
                                if (rcpt->offset) {
                                    sent(request->queue_id, rcpt->address,
-                                        session->host, request->arrival_time, "%s",
+                                        session->namaddr,
+                                        request->arrival_time, "%s",
                                         resp->str);
                                    deliver_completed(state->src, rcpt->offset);
                                    rcpt->offset = 0;
index 549bf14034057b9afb829258069058b1ca781d2e..4e95587238c2d5f48f65e3d1d58a95f64e637fc1 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <mymalloc.h>
 #include <vstream.h>
+#include <stringops.h>
 
 /* Application-specific. */
 
@@ -55,6 +56,7 @@ SMTP_SESSION *smtp_session_alloc(VSTREAM *stream, char *host, char *addr)
     session->stream = stream;
     session->host = mystrdup(host);
     session->addr = mystrdup(addr);
+    session->namaddr = concatenate(host, "[", addr, "]", (char *) 0);
     session->best = 1;
     return (session);
 }
@@ -66,6 +68,7 @@ void    smtp_session_free(SMTP_SESSION *session)
     vstream_fclose(session->stream);
     myfree(session->host);
     myfree(session->addr);
+    myfree(session->namaddr);
     myfree((char *) session);
 }
 
index 0cf53a2896860482c75f505786ffaf815e0af292..2bf2c64b72d93852731cea4d9056acd16c7fbed0 100644 (file)
@@ -168,7 +168,7 @@ int     smtp_site_fail(SMTP_STATE *state, int code, char *format,...)
            continue;
        status = (soft_error ? defer_append : bounce_append)
            (KEEP, request->queue_id, rcpt->address,
-            session ? session->host : "none",
+            session ? session->namaddr : "none",
             request->arrival_time, "%s", vstring_str(why));
        if (status == 0) {
            deliver_completed(state->src, rcpt->offset);
@@ -215,7 +215,7 @@ int     smtp_mesg_fail(SMTP_STATE *state, int code, char *format,...)
            continue;
        status = (SMTP_SOFT(code) ? defer_append : bounce_append)
            (KEEP, request->queue_id, rcpt->address,
-            session->host, request->arrival_time,
+            session->namaddr, request->arrival_time,
             "%s", vstring_str(why));
        if (status == 0) {
            deliver_completed(state->src, rcpt->offset);
@@ -248,7 +248,7 @@ void    smtp_rcpt_fail(SMTP_STATE *state, int code, RECIPIENT *rcpt,
      */
     va_start(ap, format);
     status = (SMTP_SOFT(code) ? vdefer_append : vbounce_append)
-       (KEEP, request->queue_id, rcpt->address, session->host,
+       (KEEP, request->queue_id, rcpt->address, session->namaddr,
         request->arrival_time, format, ap);
     va_end(ap);
     if (status == 0) {
@@ -277,11 +277,11 @@ int     smtp_stream_except(SMTP_STATE *state, int code, char *description)
        msg_panic("smtp_stream_except: unknown exception %d", code);
     case SMTP_ERR_EOF:
        vstring_sprintf(why, "lost connection with %s while %s",
-                       session->host, description);
+                       session->namaddr, description);
        break;
     case SMTP_ERR_TIME:
        vstring_sprintf(why, "conversation with %s timed out while %s",
-                       session->host, description);
+                       session->namaddr, description);
        break;
     }
 
@@ -294,7 +294,7 @@ int     smtp_stream_except(SMTP_STATE *state, int code, char *description)
        if (rcpt->offset == 0)
            continue;
        state->status |= defer_append(KEEP, request->queue_id,
-                                     rcpt->address, session->host,
+                                     rcpt->address, session->namaddr,
                                      request->arrival_time,
                                      "%s", vstring_str(why));
     }
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index ca0276f1a1b2ca6af6063a7c551b331ef26a9609..a39502921636b3f71559c42ba203d19dfcbf8a07 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index c5939921eae157bfa7475643462d79fad159b92e..84d7400246c26b08c8eba4abc472d3634645242a 100644 (file)
@@ -506,8 +506,8 @@ static void mail_reset(SMTPD_STATE *state)
        mail_stream_cleanup(state->dest);
        state->dest = 0;
        state->cleanup = 0;
-       state->err = 0;
     }
+    state->err = 0;
     if (state->queue_id != 0) {
        myfree(state->queue_id);
        state->queue_id = 0;
index 1ad395d29daa82671a676cdb353e3efa536f3a7f..c3ad748e3d5d23787347759f09706636ce5d2b53 100644 (file)
@@ -1200,12 +1200,18 @@ static int generic_checks(SMTPD_STATE *state, char *name,
      */
     if (strcasecmp(name, PERMIT_ALL) == 0) {
        *status = SMTPD_CHECK_OK;
+       if ((*cpp)[1] != 0)
+           msg_warn("restriction `%s' after `%s' is ignored",
+                    (*cpp)[1], PERMIT_ALL);
        return (1);
     }
     if (strcasecmp(name, REJECT_ALL) == 0) {
        *status = smtpd_check_reject(state, MAIL_ERROR_POLICY,
                                     "%d <%s>: %s rejected: Access denied",
                                  var_reject_code, reply_name, reply_class);
+       if ((*cpp)[1] != 0)
+           msg_warn("restriction `%s' after `%s' is ignored",
+                    (*cpp)[1], REJECT_ALL);
        return (1);
     }
 
@@ -1486,6 +1492,9 @@ char   *smtpd_check_rcpt(SMTPD_STATE *state, char *recipient)
        } else if (strcasecmp(name, CHECK_RELAY_DOMAINS) == 0) {
            status = check_relay_domains(state, recipient,
                                         recipient, SMTPD_NAME_RECIPIENT);
+           if (cpp[1] != 0)
+               msg_warn("restriction `%s' after `%s' is ignored",
+                        cpp[1], CHECK_RELAY_DOMAINS);
        } else if (strcasecmp(name, REJECT_UNKNOWN_RCPTDOM) == 0) {
            status = reject_unknown_address(state, recipient,
                                            recipient, SMTPD_NAME_RECIPIENT);
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index d96d099205bed129a423231d77bc789ff67736a3..90cd11386f81f6ea009caaa66f7097ff759b1165 100644 (file)
@@ -18,7 +18,7 @@ LIBS  = ../lib/libglobal.a ../lib/libutil.a
 all:   $(PROG)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 smtp-sink: smtp-sink.o $(LIBS)
        $(CC) $(CFLAGS) -o $@ smtp-sink.o $(LIBS) $(SYSLIBS)
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 3c4a26354c18fde24a64b6df83847fe82a5d8846..471f06ef048b4e72b63816f44af71378e1c39877 100644 (file)
@@ -24,7 +24,7 @@ $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
index 4972290d93520c3a44210f3c97b3b032e6294f67..1817f82e0e554f3d090b62ce511111c0c203d343 100644 (file)
@@ -21,6 +21,7 @@
 -TDICT_ENV
 -TDICT_HT
 -TDICT_LDAP
+-TDICT_MYSQL
 -TDICT_NI
 -TDICT_NIS
 -TDICT_NISPLUS
@@ -38,6 +39,7 @@
 -TFILE
 -TFORWARD_INFO
 -THEADER_OPTS
+-THOST
 -THTABLE
 -THTABLE_INFO
 -TINET_ADDR_LIST
 -TMKMAP_OPEN_INFO
 -TMULTI_SERVER
 -TMVECT
+-TMYSQL_NAME
 -TNAMADR_LIST
 -TNAME_MASK
 -TPEER_NAME
 -TPICKUP_INFO
 -TPIPE_ATTR
 -TPIPE_PARAMS
+-TPLMYSQL
 -TQMGR_ENTRY
 -TQMGR_MESSAGE
 -TQMGR_QUEUE
index 8ad363f7b29bd95a56e2a42d32e682b25d673359..9d34b33fc4b6f34785660ad25e090814110aef47 100644 (file)
@@ -1,7 +1,7 @@
 SHELL  = /bin/sh
 SRCS   = argv.c argv_split.c attr.c basename.c binhash.c chroot_uid.c \
        close_on_exec.c concatenate.c dict.c dict_db.c dict_dbm.c \
-       dict_env.c dict_ht.c dict_ldap.c dict_ni.c dict_nis.c \
+       dict_env.c dict_ht.c dict_ldap.c dict_mysql.c dict_ni.c dict_nis.c \
        dict_nisplus.c dict_open.c dir_forest.c doze.c environ.c \
        events.c exec_command.c fifo_listen.c fifo_trigger.c file_limit.c \
        find_inet.c fsspace.c fullname.c get_domainname.c get_hostname.c \
@@ -23,7 +23,7 @@ SRCS  = argv.c argv_split.c attr.c basename.c binhash.c chroot_uid.c \
        clean_env.c
 OBJS   = argv.o argv_split.o attr.o basename.o binhash.o chroot_uid.o \
        close_on_exec.o concatenate.o dict.o dict_db.o dict_dbm.o \
-       dict_env.o dict_ht.o dict_ldap.o dict_ni.o dict_nis.o \
+       dict_env.o dict_ht.o dict_ldap.o dict_mysql.o dict_ni.o dict_nis.o \
        dict_nisplus.o dict_open.o dir_forest.o doze.o environ.o \
        events.o exec_command.o fifo_listen.o fifo_trigger.o file_limit.o \
        find_inet.o fsspace.o fullname.o get_domainname.o get_hostname.o \
@@ -44,21 +44,21 @@ OBJS        = argv.o argv_split.o attr.o basename.o binhash.o chroot_uid.o \
        stream_connect.o stream_trigger.o dict_regexp.o mac_expand.o \
        clean_env.o
 HDRS   = argv.h attr.h binhash.h chroot_uid.h connect.h dict.h dict_db.h \
-       dict_dbm.h dict_env.h dict_ht.h dict_ldap.h dict_ni.h dict_nis.h \
-       dict_nisplus.h dir_forest.h events.h exec_command.h find_inet.h \
-       fsspace.h fullname.h get_domainname.h get_hostname.h htable.h \
-       inet_addr_host.h inet_addr_list.h inet_addr_local.h inet_util.h \
-       iostuff.h line_wrap.h listen.h lstat_as.h mac_parse.h make_dirs.h \
-       match_list.h match_ops.h msg.h msg_output.h msg_syslog.h \
-       msg_vstream.h mvect.h myflock.h mymalloc.h name_mask.h open_as.h \
-       open_lock.h percentm.h posix_signals.h readlline.h ring.h safe.h \
-       safe_open.h sane_accept.h scan_dir.h set_eugid.h set_ugid.h \
+       dict_dbm.h dict_env.h dict_ht.h dict_ldap.h dict_mysql.h \
+       dict_ni.h dict_nis.h dict_nisplus.h dir_forest.h events.h \
+       exec_command.h find_inet.h fsspace.h fullname.h get_domainname.h \
+       get_hostname.h htable.h inet_addr_host.h inet_addr_list.h \
+       inet_addr_local.h inet_util.h iostuff.h line_wrap.h listen.h lstat_as.h \
+       mac_parse.h make_dirs.h match_list.h match_ops.h msg.h msg_output.h \
+       msg_syslog.h msg_vstream.h mvect.h myflock.h mymalloc.h name_mask.h \
+       open_as.h open_lock.h percentm.h posix_signals.h readlline.h ring.h \
+       safe.h safe_open.h sane_accept.h scan_dir.h set_eugid.h set_ugid.h \
        sigdelay.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 \
        dict_unix.h dict_pcre.h dict_regexp.h mac_expand.h clean_env.h
 TESTSRC        = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
-       stream_test.c
+       stream_test.c dup2_pass_on_exec.c
 WARN   = -W -Wformat -Wimplicit -Wmissing-prototypes \
        -Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
        -Wunused 
@@ -67,9 +67,9 @@ CFLAGS        = $(DEBUG) $(OPT) $(DEFS)
 FILES  = Makefile $(SRCS) $(HDRS)
 INCL   =
 LIB    = libutil.a
-TESTPROG= dict_open events exec_command fifo_open fifo_rdonly_bug \
-       fifo_rdwr_bug fifo_trigger fsspace fullname inet_addr_host \
-       inet_addr_local mac_parse make_dirs msg_syslog \
+TESTPROG= dict_open dup2_pass_on_exec events exec_command fifo_open \
+       fifo_rdonly_bug fifo_rdwr_bug fifo_trigger fsspace fullname \
+       inet_addr_host inet_addr_local mac_parse make_dirs msg_syslog \
        mystrtok peer_name sigdelay translit valid_hostname vstream_popen \
        vstring vstring_vstream doze select_bug stream_test mac_expand
 
@@ -81,7 +81,7 @@ INC_DIR       = ../include
 all: $(LIB)
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
+       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
@@ -120,6 +120,9 @@ clean:
 
 tidy:  clean
 
+dup2_pass_on_exec: dup2_pass_on_exec.c
+       $(CC) $(CFLAGS) -o $@ $@.c $(SYSLIBS)
+
 vstring: $(LIB)
        mv $@.o junk
        $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
@@ -294,6 +297,7 @@ close_on_exec.o: close_on_exec.c
 close_on_exec.o: sys_defs.h
 close_on_exec.o: msg.h
 close_on_exec.o: iostuff.h
+compat.o: compat.c
 concatenate.o: concatenate.c
 concatenate.o: sys_defs.h
 concatenate.o: mymalloc.h
@@ -343,6 +347,8 @@ dict_ht.o: vbuf.h
 dict_ht.o: dict_ht.h
 dict_ldap.o: dict_ldap.c
 dict_ldap.o: sys_defs.h
+dict_mysql.o: dict_mysql.c
+dict_mysql.o: sys_defs.h
 dict_ni.o: dict_ni.c
 dict_ni.o: sys_defs.h
 dict_nis.o: dict_nis.c
@@ -379,6 +385,7 @@ dict_open.o: dict_nis.h
 dict_open.o: dict_nisplus.h
 dict_open.o: dict_ni.h
 dict_open.o: dict_ldap.h
+dict_open.o: dict_mysql.h
 dict_open.o: dict_pcre.h
 dict_open.o: dict_regexp.h
 dict_open.o: stringops.h
@@ -418,6 +425,7 @@ doze.o: doze.c
 doze.o: sys_defs.h
 doze.o: msg.h
 doze.o: iostuff.h
+dup2_pass_on_exec.o: dup2_pass_on_exec.c
 environ.o: environ.c
 environ.o: sys_defs.h
 events.o: events.c
@@ -476,7 +484,6 @@ get_hostname.o: mymalloc.h
 get_hostname.o: msg.h
 get_hostname.o: valid_hostname.h
 get_hostname.o: get_hostname.h
-hattr.o: hattr.c
 htable.o: htable.c
 htable.o: sys_defs.h
 htable.o: mymalloc.h
diff --git a/postfix/util/dict_mysql.c b/postfix/util/dict_mysql.c
new file mode 100644 (file)
index 0000000..c4f4887
--- /dev/null
@@ -0,0 +1,463 @@
+/*++
+/* NAME
+/*     dict_mysql 3
+/* SUMMARY
+/*     dictionary manager interface to db files
+/* SYNOPSIS
+/*     #include <dict.h>
+/*     #include <dict_mysql.h>
+/*
+/*
+/*     DICT    *dict_mysql_open(name, dummy, unused_dict_flags)
+/*     const char      *name;
+/*     int     dummy;
+/*     int     unused_dict_flags;
+/* DESCRIPTION
+/*     dict_mysql_open() opens the mysql databases with name dbname on
+/*     each host in hostlist and registers under the given name with the
+/*     dictionary manager. The result is a pointer to the installed dictionary,
+/*     or a null pointer in case of problems.
+/*
+/*     Arguments:
+/* .IP name
+/*     The path of the MySQL configuration file.  The file encodes a number of
+/*     pieces of information: username, password, databasename, table,
+/*     select_field, where_field, and hosts.  For example, if you want the map to
+/*     reference databases of the name "your_db" and execute a query like this:
+/*     select forw_addr from aliases where alias like '<some username>' against
+/*     any database called "vmailer_info" located on hosts host1.some.domain and
+/*     host2.some.domain, logging in as user "vmailer" and password "passwd" then
+/*     the configuration file should read:
+/*
+/*     user = vmailer
+/*     password = passwd
+/*     DBname = vmailer_info
+/*     table = aliases
+/*     select_field = forw_addr
+/*     where_field = alias
+/*     hosts = host1.some.domain host2.some.domain
+/*
+/* .IP other_name
+/*     reference for outside use.
+/* .IP unusued_flags
+/*     unused flags
+/* SEE ALSO
+/*     dict(3) generic dictionary manager
+/* AUTHOR(S)
+/*     Scott Cotton
+/*     IC Group, Inc.
+/*     scott@icgroup.com
+/*
+/*     Joshua Marcus
+/*     IC Group, Inc.
+/*     josh@icgroup.com
+/*--*/
+
+
+/* System library. */
+#include "sys_defs.h"
+
+#ifdef HAS_MYSQL
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <syslog.h>
+#include <time.h>
+
+/* Utility library. */
+#include "dict.h"
+#include "msg.h"
+#include "mymalloc.h"
+#include "dict_mysql.h"
+#include "argv.h"
+#include "vstring.h"
+
+
+extern int dict_errno;
+
+typedef struct {
+    char   *username;
+    char   *password;
+    char   *dbname;
+    char   *table;
+    char   *select_field;
+    char   *where_field;
+    char   *additional_conditions;
+    char  **hostnames;
+    int     len_hosts;
+} MYSQL_NAME;
+
+
+typedef struct {
+    DICT    dict;
+    PLMYSQL *pldb;
+    MYSQL_NAME *name;
+} DICT_MYSQL;
+
+/* mysqlname_parse - parse mysql configuration file */
+
+static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
+{
+    int     i;
+    char   *nameval;
+    char   *hosts;
+    MYSQL_NAME *name = (MYSQL_NAME *) mymalloc(sizeof(MYSQL_NAME));
+    ARGV   *hosts_argv;
+
+
+    dict_load_file("mysql_options", mysqlcf_path);
+    /* mysql username lookup */
+    if ((nameval = (char *) dict_lookup("mysql_options", "user")) == NULL)
+       name->username = mystrdup("");
+    else
+       name->username = mystrdup(nameval);
+    if (msg_verbose)
+       msg_info("dict_mysql_parse: set username to '%s'", name->username);
+    /* password lookup */
+    if ((nameval = (char *) dict_lookup("mysql_options", "password")) == NULL)
+       name->password = mystrdup("");
+    else
+       name->password = mystrdup(nameval);
+    if (msg_verbose)
+       msg_info("dict_mysql_parse: set password to '%s'", name->password);
+
+    /* database name lookup */
+    if ((nameval = (char *) dict_lookup("mysql_options", "dbname")) == NULL)
+       msg_fatal("%s: mysql options file does not include database name", mysqlcf_path);
+    else
+       name->dbname = mystrdup(nameval);
+    if (msg_verbose)
+       msg_info("mysql_name_parse: set database name to '%s'", name->dbname);
+
+    /* table lookup */
+    if ((nameval = (char *) dict_lookup("mysql_options", "table")) == NULL)
+       msg_fatal("%s: mysql options file does not include table name", mysqlcf_path);
+    else
+       name->table = mystrdup(nameval);
+    if (msg_verbose)
+       msg_info("mysql_name_parse: set table name to '%s'", name->table);
+
+    /* select field lookup */
+    if ((nameval = (char *) dict_lookup("mysql_options", "select_field")) == NULL)
+       msg_fatal("%s: mysql options file does not include select field", mysqlcf_path);
+    else
+       name->select_field = mystrdup(nameval);
+    if (msg_verbose)
+       msg_info("mysql_name_parse: set select_field to '%s'", name->select_field);
+
+    /* where field lookup */
+    if ((nameval = (char *) dict_lookup("mysql_options", "where_field")) == NULL)
+       msg_fatal("%s: mysql options file does not include where field", mysqlcf_path);
+    else
+       name->where_field = mystrdup(nameval);
+    if (msg_verbose)
+       msg_info("mysql_name_parse: set where_field to '%s'", name->where_field);
+
+    /* additional conditions */
+    if ((nameval = (char *) dict_lookup("mysql_options", "additional_conditions")) == NULL)
+       name->additional_conditions = mystrdup("");
+    else
+       name->additional_conditions = mystrdup(nameval);
+    if (msg_verbose)
+       msg_info("mysql_name_parse: set additional_conditions to '%s'", name->additional_conditions);
+
+    /* mysql server hosts */
+    if ((nameval = (char *) dict_lookup("mysql_options", "hosts")) == NULL)
+       hosts = mystrdup("");
+    else
+       hosts = mystrdup(nameval);
+    /* coo argv interface */
+    hosts_argv = argv_split(hosts, " ");
+    argv_terminate(hosts_argv);
+
+    if (hosts_argv->argc == 0) {               /* no hosts specified,
+                                                * default to 'localhost' */
+       msg_info("mysql_name_parse: no hostnames specified, defaulting to 'localhost'");
+       name->len_hosts = 1;
+       name->hostnames = (char **) mymalloc(sizeof(char *));
+       name->hostnames[0] = mystrdup("localhost");
+    } else {
+       name->len_hosts = hosts_argv->argc;
+       name->hostnames = (char **) mymalloc((sizeof(char *)) * name->len_hosts);
+       i = 0;
+       for (i = 0; hosts_argv->argv[i] != NULL; i++) {
+           name->hostnames[i] = mystrdup(hosts_argv->argv[i]);
+           if (msg_verbose)
+               msg_info("adding host '%s' to list of mysql server hosts", name->hostnames[i]);
+       }
+    }
+    myfree(hosts);
+    argv_free(hosts_argv);
+    return name;
+}
+
+
+/* dict_mysql_lookup - find database entry return 0 if no alias found */
+static const char *dict_mysql_lookup(DICT *dict, const char *name)
+{
+    MYSQL_RES *query_res;
+    MYSQL_ROW row;
+    int     i,
+            numrows;
+    static VSTRING *result;
+    static VSTRING *query = 0;
+    char   *name_escaped = 0;
+    DICT_MYSQL *dict_mysql;
+    PLMYSQL *pldb;
+
+    dict_mysql = (DICT_MYSQL *) dict;
+    pldb = dict_mysql->pldb;
+    /* initialization  for query */
+    query = vstring_alloc(24);
+    vstring_strcpy(query, "");
+    if ((name_escaped = (char *) mymalloc((sizeof(char) * (strlen(name) * 2) +1))) == NULL) {
+       msg_fatal("dict_mysql_lookup: out of memory.");
+    }
+    /* prepare the query */
+    mysql_escape_string(name_escaped, name, (unsigned int) strlen(name));
+    vstring_sprintf(query, "select %s from %s where %s = '%s' %s", dict_mysql->name->select_field,
+       dict_mysql->name->table, dict_mysql->name->where_field, name_escaped,
+                   dict_mysql->name->additional_conditions);
+    if (msg_verbose)
+       msg_info("dict_mysql_lookup using sql query: %s", vstring_str(query));
+    /* free mem associated with preparing the query */
+    myfree(name_escaped);
+    /* do the query */
+    if ((query_res = plmysql_query(pldb, vstring_str(query))) == NULL) {
+       dict_errno = DICT_ERR_RETRY;
+       vstring_free(query);
+       return 0;
+    }
+    /* free the vstring query */
+    vstring_free(query);
+    numrows = mysql_num_rows(query_res);
+    if (msg_verbose)
+       msg_info("dict_mysql_lookup: retrieved %d rows", numrows);
+    if (numrows == 0) {
+       mysql_free_result(query_res);
+       return 0;
+    }
+    if (result == 0)
+       result = vstring_alloc(10);
+    vstring_strcpy(result, "");
+    for (i = 0; i < numrows; i++) {
+       row = mysql_fetch_row(query_res);
+       if (msg_verbose > 1)
+           msg_info("dict_mysql_lookup: retrieved row: %d: %s", i, row[0]);
+       if (i > 0)
+           vstring_strcat(result, ",");
+       vstring_strcat(result, row[0]);
+    }
+    mysql_free_result(query_res);
+    return vstring_str(result);
+}
+
+
+/* dict_mysql_close - unregister, disassociate from database */
+static void dict_mysql_close(DICT *dict)
+{
+    int     i;
+    DICT_MYSQL *dict_mysql = (DICT_MYSQL *) dict;
+
+    plmysql_dealloc(dict_mysql->pldb);
+    myfree(dict_mysql->name->username);
+    myfree(dict_mysql->name->password);
+    myfree(dict_mysql->name->dbname);
+    myfree(dict_mysql->name->table);
+    myfree(dict_mysql->name->select_field);
+    myfree(dict_mysql->name->where_field);
+    myfree(dict_mysql->name->additional_conditions);
+    for (i = 0; i < dict_mysql->name->len_hosts; i++) {
+       myfree(dict_mysql->name->hostnames[i]);
+    }
+    myfree((char *) dict_mysql->name);
+}
+
+
+/* dict_mysql_update - add or update table entry */
+static void dict_mysql_update(DICT *dict, const char *unused_name, const char *unused_value)
+{
+    DICT_MYSQL *dict_mysql = (DICT_MYSQL *) dict;
+
+    msg_fatal("dict_mysql_update: attempt to update mysql database");
+}
+
+/* dict_mysql_open - create association with database */
+DICT   *dict_mysql_open(const char *name, int unused_flags, int unused_dict_flags)
+{
+    DICT_MYSQL *dict_mysql;
+    int     connections;
+
+    dict_mysql = (DICT_MYSQL *) mymalloc(sizeof(DICT_MYSQL));
+    dict_mysql->dict.lookup = dict_mysql_lookup;
+    dict_mysql->dict.update = dict_mysql_update;
+    dict_mysql->dict.close = dict_mysql_close;
+    dict_mysql->dict.fd = -1;                  /* there's no file descriptor
+                                                * for locking */
+    dict_mysql->name = (MYSQL_NAME *) mymalloc(sizeof(MYSQL_NAME));
+    dict_mysql->name = mysqlname_parse(name);
+    dict_mysql->pldb = plmysql_init(dict_mysql->name->dbname,
+                                   dict_mysql->name->hostnames,
+                                   dict_mysql->name->len_hosts);
+    if (dict_mysql->pldb == NULL)
+       msg_fatal("couldn't intialize pldb!\n");
+    connections = plmysql_connect(dict_mysql->pldb, dict_mysql->name->username,
+                                 dict_mysql->name->password);
+    if (connections == 0)
+       /* the mysql lookup mechanism will try to reconnect anyway ... */
+       msg_warn("couldn't connect pldb to any database instances");
+    else
+       msg_info("pldb connected to %d database instances", connections);
+    dict_register(name, (DICT *) dict_mysql);
+    return &dict_mysql->dict;
+}
+
+/* host_init - initialize HOST structure */
+static HOST host_init(char *hostname)
+{
+    int     stat;
+    MYSQL   db;
+    time_t  ts;
+    HOST    host;
+
+    host.stat = STATUNTRIED;
+    host.hostname = hostname;
+    host.db = db;
+    host.ts = ts;
+    return host;
+}
+
+
+/*
+ * plmysql_init - initalize a MYSQL database.
+ *               Return NULL on failure, or a PLMYSQL * on success.
+ */
+PLMYSQL *plmysql_init(char *dbname,
+                             char *hostnames[],
+                             int len_hosts)
+{
+    PLMYSQL *PLDB;
+    MYSQL  *dbs;
+    int     i;
+    HOST    host;
+
+    if ((PLDB = (PLMYSQL *) mymalloc(sizeof(PLMYSQL))) == NULL) {
+       msg_fatal("mymalloc of pldb failed");
+    }
+    PLDB->dbname = dbname;
+    PLDB->len_hosts = len_hosts;
+    if ((PLDB->db_hosts = (HOST *) mymalloc(sizeof(HOST) * len_hosts)) == NULL)
+       return NULL;
+    for (i = 0; i < len_hosts; i++) {
+       PLDB->db_hosts[i] = host_init(hostnames[i]);
+    }
+    return PLDB;
+}
+
+/* plmysql_dealloc - free memory associated with PLMYSQL close databases */
+void    plmysql_dealloc(PLMYSQL *PLDB)
+{
+    int     i;
+
+    for (i = 0; i < PLDB->len_hosts; i++) {
+       mysql_close(&(PLDB->db_hosts[i].db));
+       myfree(PLDB->db_hosts[i].hostname);
+    }
+    myfree((char *) PLDB->db_hosts);
+    myfree((char *) (PLDB));
+}
+
+/* plmysql_down_host - down a HOST * */
+inline void plmysql_down_host(HOST *host)
+{
+    host->stat = STATFAIL;
+    host->ts = time(&(host->ts));
+}
+
+
+/* plmysql_connect_single -
+ * used to reconnect to a single database when one is down and as a helper for
+ * plmysql_connect
+ */
+int     plmysql_connect_single(PLMYSQL *PLDB, int host)
+{
+    if ((mysql_connect(&(PLDB->db_hosts[host].db), PLDB->db_hosts[host].hostname,
+                      PLDB->username, PLDB->password))) {
+       if (mysql_select_db(&(PLDB->db_hosts[host].db), PLDB->dbname) == 0) {
+           PLDB->db_hosts[host].stat = STATACTIVE;
+           return 1;
+       } else {
+           plmysql_down_host(&(PLDB->db_hosts[host]));
+           msg_warn("%s", mysql_error(&PLDB->db_hosts[host].db));
+       }
+    } else {
+       plmysql_down_host(&(PLDB->db_hosts[host]));
+       msg_warn("%s", mysql_error(&PLDB->db_hosts[host].db));
+    }
+    return 0;
+}
+
+
+/*
+ * plmysql_connect -
+ * given a PLMYSQL struct PLDB *, connect it and select db.
+ * return  the number of databases successfully connected (0 for failure)
+ */
+int     plmysql_connect(PLMYSQL *PLDB, char *username, char *password)
+{
+    int     i,
+            res;
+
+    res = 0;
+
+    PLDB->username = username;
+    PLDB->password = password;
+
+    for (i = 0; i < PLDB->len_hosts; i++) {
+       res = res + plmysql_connect_single(PLDB, i);
+    }
+    return res;
+}
+
+/* plmysql_ready_reconn -
+   given a downed HOST, return whether or not it should retry connection
+*/
+int     plmysql_ready_reconn(HOST host)
+{
+    time_t  t;
+    long    now;
+
+    now = (long) time(&t);
+    if ((now - ((long) host.ts)) >= RETRY_CONN_INTV)
+       return 1;
+    return 0;
+}
+
+/*
+ * plmysql_query - process a MySQL query.  Return 0 on success.
+ *                On failure, log failure and try other db instances.
+ */
+
+MYSQL_RES *plmysql_query(PLMYSQL *PLDB, const char *query)
+{
+    int     i;
+    MYSQL_RES *res;
+
+    for (i = 0; i < PLDB->len_hosts; i++) {
+       if ((PLDB->db_hosts[i].stat != STATACTIVE) &&
+           (plmysql_ready_reconn(PLDB->db_hosts[i]))) {
+           msg_warn("attempting to reconnect to host");
+           plmysql_connect_single(PLDB, i);
+           continue;
+       }
+       if ((!(mysql_query(&(PLDB->db_hosts[i].db), query))) && \
+           (res = mysql_store_result(&(PLDB->db_hosts[i].db)))) {
+           return res;
+       }
+       msg_warn("%s", mysql_error(&PLDB->db_hosts[i].db));
+       plmysql_down_host(&(PLDB->db_hosts[i]));
+    }
+    return NULL;
+}
+
+#endif
diff --git a/postfix/util/dict_mysql.h b/postfix/util/dict_mysql.h
new file mode 100644 (file)
index 0000000..601ccda
--- /dev/null
@@ -0,0 +1,46 @@
+#ifdef HAS_MYSQL
+
+#include <time.h>
+#include "mysql.h"
+
+#define STATACTIVE 0
+#define STATFAIL 1
+#define STATUNTRIED 2
+#define RETRY_CONN_INTV 300            /* 5 minutes */
+
+extern DICT *dict_mysql_open(const char *name, int unused_flags, int dict_flags);
+
+typedef struct {
+    char   *hostname;
+    int     stat;                      /* STATUNTRIED | STATFAIL | STATCUR */
+    time_t  ts;                                /* used for attempting reconnection
+                                        * every so often if a host is down */
+    MYSQL   db;
+} HOST;
+
+
+typedef struct {
+    char   *username;                  /* login for database */
+    char   *password;                  /* password for database */
+    char   *dbname;                    /* the name of the database on all
+                                        * the servers */
+    HOST   *db_hosts;                  /* the hosts on which the databases
+                                        * reside */
+    int     len_hosts;                 /* number of hosts */
+} PLMYSQL;
+
+extern PLMYSQL *plmysql_init(char *dbname, char *hostnames[], int len_hosts);
+
+extern int plmysql_connect(PLMYSQL *PLDB, char *username, char *password);
+
+MYSQL_RES *plmysql_query(PLMYSQL *PLDB, const char *query);
+
+void    plmysql_dealloc(PLMYSQL *PLDB);
+
+inline void plmysql_down_host(HOST *host);
+
+int     plmysql_connect_single(PLMYSQL *PLDB, int host);
+
+int     plmysql_ready_reconn(HOST host);
+
+#endif
index 87f00c59ba6123e25359443df8551ffbc53423b6..56696ee1d54f1bdd26590310e1d5f30714860cce 100644 (file)
 #include <dict_nisplus.h>
 #include <dict_ni.h>
 #include <dict_ldap.h>
+#include <dict_mysql.h>
 #include <dict_pcre.h>
 #include <dict_regexp.h>
 #include <stringops.h>
@@ -195,6 +196,9 @@ static DICT_OPEN_INFO dict_open_info[] = {
 #ifdef HAS_LDAP
     "ldap", dict_ldap_open,
 #endif
+#ifdef HAS_MYSQL
+    "mysql", dict_mysql_open,
+#endif
 #ifdef HAS_PCRE
     "pcre", dict_pcre_open,
 #endif
index d33da8ad9705d3eb86e2bc9b9e2fd6621bab5e26..28d56693a1696cc486bdf2690c64ea1a7bd86266 100644 (file)
@@ -47,7 +47,7 @@ void    doze(unsigned delay)
 
 #define MILLION        1000000
 
-    tv.tv_sec = (delay > MILLION ? delay / MILLION : 0);
+    tv.tv_sec = delay / MILLION;
     tv.tv_usec = delay % MILLION;
     while (select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &tv) < 0)
        if (errno != EINTR)
diff --git a/postfix/util/dup2_pass_on_exec.c b/postfix/util/dup2_pass_on_exec.c
new file mode 100644 (file)
index 0000000..54bca23
--- /dev/null
@@ -0,0 +1,60 @@
+/*++
+/* NAME
+/*     dup2_pass_on_exec 1
+/* SUMMARY
+/*     dup2 close-on-exec behaviour test program
+/* SYNOPSIS
+/*     dup2_pass_on_exec
+/* DESCRIPTION
+/*     dup2_pass_on_exec sets the close-on-exec flag on its
+/*     standard input and then dup2() to duplicate it.
+/*     Posix-1003.1 specifies in section 6.2.1.2 that dup2(o,n) should behave
+/*     as: close(n); n = fcntl(o, F_DUPFD, n); as long as o is a valid
+/*     file-descriptor, n!=o, and 0<=n<=[OPEN_MAX].
+/*     Section 6.5.2.2 states that the close-on-exec flag of the result of a
+/*     successful fcntl(o, F_DUPFD, n) is cleared.
+/*
+/*     At least Ultrix4.3a does not clear the close-on-exec flag of n on
+/*     dup2(o, n).
+/* DIAGNOSTICS
+/*     Problems are reported to the standard error stream.
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Christian von Roques <roques@pond.sub.org>
+/*     Forststrasse 71
+/*     76131 Karlsruhe, GERMANY
+/*--*/
+
+#include <stdio.h>
+#include <fcntl.h>
+
+#define DO(s)  if (s < 0) { perror(#s); exit(1); }
+
+int     main(int unused_argc, char **unused_argv)
+{
+    int     res;
+
+    printf("Setting the close-on-exec flag of file-descriptor 0.\n");
+    DO(fcntl(0, F_SETFD, 1));
+
+    printf("Duplicating file-descriptor 0 to 3.\n");
+    DO(dup2(0, 3));
+
+    printf("Testing if the close-on-exec flag of file-descriptor 3 is set.\n");
+    DO((res = fcntl(3, F_GETFD, 0)));
+    if (res & 1)
+       printf("Yes, a newly dup2()ed file-descriptor has the close-on-exec "
+              "flag cloned.\n"
+              "THIS VIOLATES Posix1003.1 section 6.2.1.2 or 6.5.2.2!\n"
+              "You should #define DUP2_DUPS_CLOSE_ON_EXEC in sys_defs.h "
+              "for your OS.\n");
+    else
+       printf("No, a newly dup2()ed file-descriptor has the close-on-exec "
+              "flag cleared.\n"
+          "This complies with Posix1003.1 section 6.2.1.2 and 6.5.2.2!\n");
+
+    return 0;
+}
index 491cdb59efcd6ee9c573dc26bccbaf3c87e5152a..e96daf5d58c8252d32147b437047195a109c9579 100644 (file)
@@ -48,6 +48,8 @@
 #include <sys/vfs.h>
 #elif defined(STATVFS_IN_SYS_STATVFS_H)
 #include <sys/statvfs.h>
+#elif defined(STATFS_IN_SYS_STATFS_H)
+#include <sys/statfs.h>
 #else
 #ifdef USE_STATFS
 #error "please specify the include file with `struct statfs'"
@@ -68,6 +70,14 @@ void    fsspace(const char *path, struct fsspace * sp)
     char   *myname = "fsspace";
 
 #ifdef USE_STATFS
+#ifdef USE_STRUCT_FS_DATA                      /* Ultrix */
+    struct fs_data fsbuf;
+
+    if (statfs(path, &fsbuf) < 0)
+       msg_fatal("statfs %s: %m", path);
+    sp->block_size = 1024;
+    sp->block_free = fsbuf.fd_bfreen;
+#else
     struct statfs fsbuf;
 
     if (statfs(path, &fsbuf) < 0)
@@ -75,6 +85,7 @@ void    fsspace(const char *path, struct fsspace * sp)
     sp->block_size = fsbuf.f_bsize;
     sp->block_free = fsbuf.f_bavail;
 #endif
+#endif
 #ifdef USE_STATVFS
     struct statvfs fsbuf;
 
index 28e39bc6236cf68861cade70c499b1d0397847fb..c00d10f4371fadd1f90fba0c1ac53d86a3a2db59 100644 (file)
@@ -30,6 +30,8 @@
 /*     int     options;
 /*
 /*     int     setsid()
+/*
+/*     void    dup2_pass_on_exec(int oldd, int newd)
 /* DESCRIPTION
 /*     These routines are compiled for platforms that lack the functionality
 /*     or that have broken versions that we prefer to stay away from.
@@ -212,4 +214,23 @@ int     setsid(void)
 #error MISSING_SETSID
 #endif
 
+#endif
+
+ /*
+  * dup2_pass_on_exec() - dup2() and clear close-on-exec flag on the result
+  */
+#ifdef DUP2_DUPS_CLOSE_ON_EXEC
+
+#include "iostuff.h"
+
+int     dup2_pass_on_exec(int oldd, int newd)
+{
+    int     res;
+
+    if ((res = dup2(oldd, newd)) >= 0)
+       close_on_exec(newd, PASS_ON_EXEC);
+
+    return res;
+}
+
 #endif
index 850db0978db14d1870aaf26a52bfb5a49ae6be00..70126fa8bb490b6dd6dcfa64aed6d1ac9628e628 100644 (file)
@@ -21,7 +21,7 @@
   */
 #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \
     || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \
-    || defined(OPENBSD2) || defined(NETBSD1)
+    || defined(OPENBSD2) || defined(NETBSD1) || defined(RHAPSODY5)
 #define SUPPORTED
 #include <sys/types.h>
 #define USE_PATHS_H
 #define USE_DOT_LOCK
 #endif
 
+#if defined(RHAPSODY5)
+#define NORETURN       void
+#endif
+
 #ifdef ULTRIX4
 #define SUPPORTED
 #include <sys/types.h>
 #define UNSAFE_CTYPE                   /* XXX verify */
-#define fpos_t long                    /* XXX verify */
-#define MISSING_SETENV                 /* XXX verify */
-#define MISSING_STRERROR               /* XXX verify */
 #define _PATH_MAILDIR  "/var/spool/mail"
 #define _PATH_BSHELL   "/bin/sh"
 #define _PATH_DEFPATH  "/usr/bin:/usr/ucb"
 #define USE_FLOCK_LOCK
 #define USE_DOT_LOCK
 #define HAS_FSYNC
+/* might be set by makedef */
+#ifdef HAS_DB
+#define DEF_DB_TYPE    "hash"
+#define ALIAS_DB_MAP   "hash:/etc/aliases"
+#else
 #define HAS_DBM
 #define        DEF_DB_TYPE     "dbm"
 #define ALIAS_DB_MAP   "dbm:/etc/aliases"
-extern int optind;                     /* XXX verify */
-extern char *optarg;                   /* XXX verify */
-extern int opterr;                     /* XXX verify */
+#endif
+extern int optind;
+extern char *optarg;
+extern int opterr;
 
+#define MISSING_STRFTIME_E
 #define HAS_NIS
 #define GETTIMEOFDAY(t)        gettimeofday(t,(struct timezone *) 0)
 #define ROOT_PATH      "/bin:/usr/bin:/etc:/usr/etc:/usr/ucb"
-#define USE_STATFS                     /* XXX verify */
-#define STATFS_IN_SYS_VFS_H            /* XXX verify */
-#define memmove(d,s,l) bcopy(s,d,l)    /* XXX verify */
+#define USE_STATFS
+#define USE_STRUCT_FS_DATA
+#define STATFS_IN_SYS_MOUNT_H
+/* Ultrix misses just S_ISSOCK, the others are there */
+#define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (S_IFSOCK))
+#define DUP2_DUPS_CLOSE_ON_EXEC
+/* Ultrix by default has only 64 descriptors per process */
+#ifndef FD_SETSIZE
+#define FD_SETSIZE     100
+#endif
+#define usleep         doze
 #endif
 
 #ifdef OSF1
@@ -160,7 +176,7 @@ extern int opterr;
 #define HAS_VOLATILE_LOCKS
 #endif
 
-#ifdef UW7             /* UnixWare 7 */
+#ifdef UW7                             /* UnixWare 7 */
 #define SUPPORTED
 #include <sys/types.h>
 #define _PATH_MAILDIR  "/var/mail"
@@ -185,29 +201,29 @@ extern int opterr;
 #define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT
 #endif
 
-#ifdef UW21              /* UnixWare 2.1.x */                        
-#define SUPPORTED                                               
-#include <sys/types.h>                                          
-#define _PATH_MAILDIR   "/var/mail"                             
-#define _PATH_BSHELL    "/bin/sh"                               
-#define _PATH_DEFPATH   "/usr/bin:/usr/ucb"                     
-#define _PATH_STDPATH   "/usr/bin:/usr/sbin:/usr/ucb"           
-#define MISSING_SETENV                                          
-#define USE_FCNTL_LOCK                                          
-#define USE_DOT_LOCK                                            
-#define HAS_FSYNC                                               
+#ifdef UW21                            /* UnixWare 2.1.x */
+#define SUPPORTED
+#include <sys/types.h>
+#define _PATH_MAILDIR   "/var/mail"
+#define _PATH_BSHELL    "/bin/sh"
+#define _PATH_DEFPATH   "/usr/bin:/usr/ucb"
+#define _PATH_STDPATH   "/usr/bin:/usr/sbin:/usr/ucb"
+#define MISSING_SETENV
+#define USE_FCNTL_LOCK
+#define USE_DOT_LOCK
+#define HAS_FSYNC
 #define HAS_DBM
-#define DEF_DB_TYPE     "dbm"                                   
-#define ALIAS_DB_MAP    "dbm:/etc/mail/aliases"                 
+#define DEF_DB_TYPE     "dbm"
+#define ALIAS_DB_MAP    "dbm:/etc/mail/aliases"
 /* Uncomment the following line if you have NIS package installed
 #define HAS_NIS */
-#define USE_SYS_SOCKIO_H                                        
-#define GETTIMEOFDAY(t) gettimeofday(t,NULL)   
+#define USE_SYS_SOCKIO_H
+#define GETTIMEOFDAY(t) gettimeofday(t,NULL)
 #define ROOT_PATH       "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
-#define FIONREAD_IN_SYS_FILIO_H                                 
-#define DBM_NO_TRAILING_NULL                                    
-#define USE_STATVFS                                             
-#define STATVFS_IN_SYS_STATVFS_H                                
+#define FIONREAD_IN_SYS_FILIO_H
+#define DBM_NO_TRAILING_NULL
+#define USE_STATVFS
+#define STATVFS_IN_SYS_STATVFS_H
 #define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT
 #endif
 
@@ -243,6 +259,38 @@ extern int initgroups(const char *, int);
 
 #endif
 
+#ifdef AIX3
+#define SUPPORTED
+#include <sys/types.h>
+#define MISSING_SETENV
+#define _PATH_BSHELL   "/bin/sh"
+#define _PATH_MAILDIR   "/var/spool/mail"      /* paths.h lies */
+#define _PATH_DEFPATH  "/usr/bin:/usr/ucb"
+#define _PATH_STDPATH  "/usr/bin:/usr/sbin:/usr/ucb"
+#define USE_FCNTL_LOCK
+#define USE_DOT_LOCK
+#define USE_SYS_SELECT_H
+#define HAS_FSYNC
+#define HAS_DBM
+#define DEF_DB_TYPE    "dbm"
+#define ALIAS_DB_MAP   "dbm:/etc/aliases"
+#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 USE_STATFS
+#define STATFS_IN_SYS_STATFS_H
+#define STRCASECMP_IN_STRINGS_H
+extern time_t time(time_t *);
+extern int seteuid(uid_t);
+extern int setegid(gid_t);
+extern int initgroups(const char *, int);
+
+#endif
+
 #if defined(IRIX5) || defined(IRIX6)
 #define SUPPORTED
 #include <sys/types.h>
@@ -475,6 +523,33 @@ extern int opterr;
 #define WEXITSTATUS(x) ((x).w_retcode)
 #define WTERMSIG(x)    ((x).w_termsig)
 #define NORETURN                       /* the native compiler */
+#endif
+
+#ifdef ReliantUnix543
+#define SUPPORTED
+#include <sys/types.h>
+#define MISSING_SETENV
+#define _PATH_DEFPATH  "/usr/bin:/usr/ucb"
+#define _PATH_BSHELL   "/bin/sh"
+#define _PATH_MAILDIR  "/var/spool/mail"
+#define USE_FCNTL_LOCK
+#define USE_DOT_LOCK
+#define HAS_FSYNC
+#define FIONREAD_IN_SYS_FILIO_H
+#define USE_SYS_SOCKIO_H
+#define HAS_DBM
+#define DEF_DB_TYPE    "dbm"
+#define ALIAS_DB_MAP   "dbm:/var/adm/sendmail/aliases"
+extern int optind;                     /* XXX use <getopt.h> */
+extern char *optarg;                   /* XXX use <getopt.h> */
+extern int opterr;                     /* XXX use <getopt.h> */
+
+#define HAS_NIS
+#define GETTIMEOFDAY(t) gettimeofday(t)
+#define ROOT_PATH      "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
+#define USE_STATVFS
+#define STATVFS_IN_SYS_STATVFS_H
+#define usleep doze
 #endif
 
  /*
@@ -484,6 +559,15 @@ extern int opterr;
 #error "unsupported platform"
 #endif
 
+#ifdef DUP2_DUPS_CLOSE_ON_EXEC
+/* dup2_pass_on_exec() can be found in util/sys_compat.c */
+extern int dup2_pass_on_exec(int oldd, int newd);
+
+#define DUP2 dup2_pass_on_exec
+#else
+#define DUP2 dup2
+#endif
+
 #ifdef PREPEND_PLUS_TO_OPTSTRING
 #define GETOPT(argc, argv, str)        getopt((argc), (argv), "+" str)
 #else
index eb2802f98f57a0a9f6ce4519ee1ba58f920a55a6..76ac7159c602561a9c177ac18778c29effdb31a9 100644 (file)
@@ -7,15 +7,11 @@
 /* SUMMARY
 /*     connect operation with timeout
 /* SYNOPSIS
+/*     #include <sys/socket.h>
 /*     #include <timed_connect.h>
 /* DESCRIPTION
 /* .nf
 
- /*
-  * System library.
-  */
-#include <sys/socket.h>
-
  /*
   * External interface.
   */
index 46116a19ea4ced36c2cb94e9ae360fd063c24674..4e741603c82a2d4e8d95fbb28249d2a591f45a7f 100644 (file)
@@ -218,7 +218,7 @@ VSTREAM *vstream_popen_vargs(int flags,...)
            msg_warn("close: %m");
        for (fd = 0; fd < 2; fd++)
            if (sockfd[0] != fd)
-               if (dup2(sockfd[0], fd) < 0)
+               if (DUP2(sockfd[0], fd) < 0)
                    msg_fatal("dup2: %m");
        if (sockfd[0] >= 2 && close(sockfd[0]))
            msg_warn("close: %m");