]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.6-20080824
authorWietse Venema <wietse@porcupine.org>
Sun, 24 Aug 2008 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:34:06 +0000 (06:34 +0000)
31 files changed:
postfix/HISTORY
postfix/README_FILES/MILTER_README
postfix/README_FILES/STRESS_README
postfix/RELEASE_NOTES
postfix/WISHLIST
postfix/html/MILTER_README.html
postfix/html/STRESS_README.html
postfix/html/postconf.5.html
postfix/makedefs
postfix/makedefs.d/linux_epoll.c [new file with mode: 0644]
postfix/makedefs.d/macosx_kqueue.c [new file with mode: 0644]
postfix/makedefs.d/sigsetjmp.c [new file with mode: 0644]
postfix/man/man5/postconf.5
postfix/mantools/postlink
postfix/proto/MILTER_README.html
postfix/proto/STRESS_README.html
postfix/proto/postconf.proto
postfix/src/cleanup/cleanup_message.c
postfix/src/cleanup/cleanup_milter.c
postfix/src/global/dict_proxy.c
postfix/src/global/mail_params.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/milter/milter8.c
postfix/src/milter/test-milter.c
postfix/src/smtpd/smtpd_check.c
postfix/src/util/auto_clnt.c
postfix/src/util/stream_send_fd.c
postfix/src/util/sys_defs.h
postfix/src/util/vstream.c
postfix/src/util/vstream.h

index 3cd0526ebb4b68f4e5345dfdb924e1740ad346b5..3857599e87d7aa417c36eac137c704b525f3ab2d 100644 (file)
@@ -14569,3 +14569,43 @@ Apologies for any names omitted.
        legitimate configurations that deliver mail to a symbolic
        link in a directory with less restrictive permissions.
 
+20080815
+
+       Feature: the milter_default_action parameter now accepts
+       the "quarantine" action. This works like "accept" but also
+       freezes the mail in the "hold" queue. File: milter/milter8.c.
+
+       Robustness: transition from setjmp()/longjmp() to the signal
+       mask saving/restoring versions sigsetjmp()/siglongjmp().
+       These functions have been around for 15 years, but they
+       have had bugs on supported platforms, so makedefs tests for
+       them.  Files: makedefs, util/sys_defs.h, util/vstream.h.
+
+20080822
+
+       Cleanup: the proxymap_service_name and proxywrite_service_name
+       parameters make the proxymap service names configurable.
+       This paves the way for a future option where the proxymap
+       services are accessible via TCP so that they can be shared
+       among multiple Postfix hosts.  File: global/dict_proxy.c.
+
+       Feature: MacOS X support for kqueue style event handling,
+       with workaround for broken MacOS X versions.  Files:
+       util/sys_defs.h, makedefs.
+
+       Cleanup: the makedefs script now keeps its test programs
+       in a directory makedefs.d, instead of inlining them as
+       fragile "here documents". Files: makedefs, makedefs.d/*.
+
+20080823
+
+       Feature: IPv6 dns blocklist lookup. File: smtpd/smtpd_check.c.
+
+20080824
+
+       Cleanup: untangled the MacOS X version dependent sections
+       in the makedefs script, to make future updates easier. File:
+       makedefs.
+
+       Cleanup: don't log multiple Milter "hold" actions for
+       the same message. File: cleanup/cleanup_milter.c.
index a67fa044d3200ee323102e69c767d020dd8209ac..469144924dd803b15734b156a802f610df7a128d 100644 (file)
@@ -250,10 +250,12 @@ The milter_default_action parameter specifies how Postfix handles Milter
 application errors. The default action is to respond with a temporary error
 status, so that the client will try again later. Specify "accept" if you want
 to receive mail as if the filter does not exist, and "reject" to reject mail
-with a permanent status.
+with a permanent status. The "quarantine" action is like "accept" but freezes
+the message in the "hold" queue, and is available with Postfix 2.6 or later.
 
     /etc/postfix/main.cf:
-        # What to do in case of errors? Specify accept, reject, or tempfail.
+        # What to do in case of errors? Specify accept, reject, tempfail,
+        # or quarantine (Postfix 2.6 or later).
         milter_default_action = tempfail
 
 M\bMi\bil\blt\bte\ber\br p\bpr\bro\bot\bto\boc\bco\bol\bl v\bve\ber\brs\bsi\bio\bon\bn
index dbdd3171f0b346fc9653a85c6070421a8fcdf45f..11f519088d4c0975a5bed4353538fc423cf1fc8c 100644 (file)
@@ -43,10 +43,17 @@ activity). Symptoms of Postfix SMTP mail server overload are:
     Postfix 2.1), and tell users to connect to this instead of the public SMTP
     service.
 
+      o NOTE: Broken DNS configurations also cause lengthy delays before
+        Postfix sends "220 hostname.example.com ...". In this case the delay
+        happens even when Postfix is not busy.
+
   * The Postfix SMTP server logs an increased number of "lost connection after
     CONNECT" events. This happens because remote SMTP clients disconnect before
     Postfix answers the connection.
 
+      o NOTE: A portscan for open SMTP ports also results in "lost connection
+        ..." logfile messages.
+
   * Postfix 2.3 and later logs a warning that all server ports are busy:
 
     Oct  3 20:39:27 spike postfix/master[28905]: warning: service "smtp"
@@ -56,14 +63,6 @@ activity). Symptoms of Postfix SMTP mail server overload are:
      condition, increase the process count in master.cf or reduce the
      service time per client
 
-NOTE: The first two symptoms may also happen without overload, for example:
-
-  * Broken DNS also causes lengthy delays before "220 hostname.example.com ..."
-    while the Postfix SMTP server tries to look up the client's hostname.
-
-  * A portscan for open SMTP ports also results in "lost connection ..."
-    logfile messages.
-
 Legitimate mail that doesn't get through during an episode of overload is not
 necessarily lost. It should still arrive once the situation returns to normal,
 as long as the overload condition is temporary.
@@ -86,7 +85,7 @@ keep up with the additional load.
     Linux epoll(4), or Solaris /dev/poll).
 
   * You can reduce the Postfix memory footprint by using cdb: lookup tables
-    instead of Berkeley DB.
+    instead of Berkeley DB's hash: or btree: tables.
 
      1 /etc/postfix/main.cf:
      2     # Raise the global process limit, 100 since Postfix 2.0.
@@ -104,9 +103,11 @@ keep up with the additional load.
     the SMTP server's "maxproc" field in master.cf, SMTP server processes will
     report problems when connecting to policy server processes, because there
     aren't enough of them. Examples of errors are "connection refused" or
-    "operation timed out". To fix, edit master.cf and specify a zero "maxproc"
-    field in all policy server entries; see line 6 in the example below. Issue
-    a "postfix reload" command to make the change effective.
+    "operation timed out".
+
+    To fix, edit master.cf and specify a zero "maxproc" field in all policy
+    server entries; see line 6 in the example below. Issue a "postfix reload"
+    command to make the change effective.
 
     1 /etc/postfix/master.cf:
     2     # =============================================================
@@ -121,7 +122,7 @@ S\bSp\bpe\ben\bnd\bd l\ble\bes\bss\bs t\bti\bim\bme\be p\bpe\ber\br S\bSM\bMT\bTP\bP c\bcl\bli\bie\ben\bn
 When increasing the number of SMTP server processes is not practical, you can
 improve Postfix server responsiveness by eliminating unnecessary work. When
 Postfix spends less time per SMTP session, the same number of SMTP server
-processes can service more clients in the same amount of time.
+processes can service more clients.
 
   * Eliminate non-functional RBL lookups (blocklists that are no longer in
     operation). These lookups can degrade performance. Postfix logs a warning
index abe791e03bdb3d5c19f81a4f8a4adabac9bac577..5cd47296a3b3a1feb2fef925aa5ad128cfdc6afe 100644 (file)
@@ -11,6 +11,14 @@ instead, a new snapshot is released.
 The mail_release_date configuration parameter (format: yyyymmdd)
 specifies the release date of a stable release or snapshot release.
 
+Incompatibility with snapshot 20080814
+======================================
+
+When a mailbox file is not owned by its recipient, the local and
+virtual delivery agents now log a warning and defer delivery.
+Specify "strict_mailbox_ownership = no" to ignore such ownership
+discrepancies.
+
 Incompatibility with snapshot 20080629
 ======================================
 
index 3a5e6acc553d3a79933bed1e3cb1335aa911e5a3..3badd2ce4697d543e11eac5dd7fb74da6e89ad34 100644 (file)
@@ -1,5 +1,5 @@
 Wish list:
-
        Force a panic when the VDA patch reduces the file size limit
        under the message size.  They break the code that marks a
        recipient as "done", when that recipient was added late
@@ -37,11 +37,12 @@ Wish list:
        that it makes smtpd_mumble_restrictions available for local
        and remote mail; the disadvantage is that it makes local
        submissions more dependent on networking.  One possibility
-       is to use "pickup -o content_filter=smtp:127.0.0.1". Another
-       is to have the pickup or cleanup server drive an SMTP client
-       directly; this would require extension of the mail_stream()
-       interface, plus a way to handle bounced/deferred recipients
-       intelligently.
+       is to use "pickup -o content_filter=smtp:127.0.0.1:10025";
+       we could also to suppress "mail loop" detection for loopback
+       connections.  Another is to have the pickup or cleanup
+       server drive an SMTP client directly; this would require
+       extension of the mail_stream() interface, plus a way to
+       handle bounced/deferred recipients intelligently.
 
        Consolidate duplicated code in *_server_accept_{pass,inet}().
 
index ce06e5ca28396ad600244f11c05d5c95fdea5677..c8539c523e3f79078c08a1c3b19cb77fbb0054e9 100644 (file)
@@ -425,12 +425,15 @@ Milter application errors. The default action is to respond with a
 temporary error status, so that the client will try again later.
 Specify "accept" if you want to receive mail as if the filter does
 not exist, and "reject" to reject mail with a permanent status.
+The "quarantine" action is like "accept" but freezes the message
+in the "<a href="QSHAPE_README.html#hold_queue">hold" queue</a>, and is available with Postfix 2.6 or later.
 </p>
 
 <blockquote>
 <pre>
 /etc/postfix/<a href="postconf.5.html">main.cf</a>:
-    # What to do in case of errors? Specify accept, reject, or tempfail.
+    # What to do in case of errors? Specify accept, reject, tempfail,
+    # or quarantine (Postfix 2.6 or later).
     <a href="postconf.5.html#milter_default_action">milter_default_action</a> = tempfail
 </pre>
 </blockquote>
index 1ea44d77b3562456ab2defc5582e84ac4b244135..4803d5388ab958cce119ef3bc796cb85871962bf 100644 (file)
@@ -77,10 +77,25 @@ this affects end-user mail clients, enable the "submission" service
 entry in <a href="master.5.html">master.cf</a> (present since Postfix 2.1), and tell users to
 connect to this instead of the public SMTP service. </p>
 
+<ul>
+
+<li> <p> NOTE: Broken DNS configurations also cause lengthy delays
+before Postfix sends "220 hostname.example.com ...". In this case
+the delay happens even when Postfix is not busy.  </p>
+
+</ul>
+
 <li> <p> The Postfix SMTP server logs an increased number of "lost
 connection after CONNECT" events. This happens because remote SMTP
 clients disconnect before Postfix answers the connection. </p>
 
+<ul>
+
+<li> <p> NOTE: A portscan for open SMTP ports also results in "lost
+connection ..." logfile messages. </p>
+
+</ul>
+
 <li> <p> Postfix 2.3 and later logs a warning that all server ports
 are busy: </p>
 
@@ -95,21 +110,6 @@ Oct  3 20:39:27 spike postfix/master[28905]: warning: to avoid this
 
 </ul>
 
-<p> NOTE: The first two symptoms may also happen without overload,
-for example: </p>
-
-<ul>
-
-<li> <p> Broken DNS also causes lengthy delays before "220
-hostname.example.com
-..." while the Postfix SMTP server tries to look up the client's
-hostname.  </p>
-
-<li> <p> A portscan for open SMTP ports also results in "lost
-connection ..." logfile messages. </p>
-
-</ul>
-
 <p> Legitimate mail that doesn't get through during an episode of
 overload is not necessarily lost. It should still arrive once the
 situation returns to normal, as long as the overload condition is
@@ -138,7 +138,7 @@ filters (BSD kqueue(2), Linux epoll(4), or Solaris /dev/poll).
 </p>
 
 <li> <p> You can reduce the Postfix memory footprint by using <a href="CDB_README.html">cdb</a>:
-lookup tables instead of Berkeley DB. </p>
+lookup tables instead of Berkeley DB's hash: or btree: tables. </p>
 
 <pre>
  1 /etc/postfix/<a href="postconf.5.html">main.cf</a>:
@@ -159,7 +159,9 @@ processes.  When you raise the SMTP server's "maxproc" field in
 <a href="master.5.html">master.cf</a>, SMTP server processes will report problems when connecting
 to policy server processes, because there aren't enough of them.
 Examples of errors are "connection refused" or "operation timed
-out".  To fix, edit <a href="master.5.html">master.cf</a> and specify a zero "maxproc" field
+out".  </p>
+
+<p> To fix, edit <a href="master.5.html">master.cf</a> and specify a zero "maxproc" field
 in all policy server entries; see line 6 in the example below.
 Issue a "postfix reload" command to make the change effective.  </p>
 
@@ -180,8 +182,7 @@ Issue a "postfix reload" command to make the change effective.  </p>
 <p> When increasing the number of SMTP server processes is not
 practical, you can improve Postfix server responsiveness by eliminating
 unnecessary work. When Postfix spends less time per SMTP session, the
-same number of SMTP server processes can service more clients in
-the same amount of time. </p>
+same number of SMTP server processes can service more clients. </p>
 
 <ul>
 
index e85826248787e335ed5f67a5877ae06ae3ccf531..a4f0b6e18fd6a68f975c90e19017a19213b7e4a6 100644 (file)
@@ -1434,6 +1434,8 @@ operations.  The time limit is enforced in the client. </p>
 <p> The name of the <a href="scache.8.html">scache(8)</a> connection cache service.  This service
 maintains a limited pool of cached sessions.  </p>
 
+<p> This feature is available in Postfix 2.2 and later. </p>
+
 
 </DD>
 
@@ -5482,6 +5484,9 @@ with a permanent status code.</dd>
 <dt>tempfail</dt> <dd>Reject all further commands in this session
 with a temporary status code. </dd>
 
+<dt>quarantine</dt> <dd>Like "accept", but freeze the message in
+the "<a href="QSHAPE_README.html#hold_queue">hold" queue</a>. Available with Postfix 2.6 and later. </dd>
+
 </dl>
 
 <p> This feature is available in Postfix 2.3 and later. </p>
@@ -6295,6 +6300,29 @@ This feature is available in Postfix 2.5 and later.
 </p>
 
 
+</DD>
+
+<DT><b><a name="proxymap_service_name">proxymap_service_name</a>
+(default: proxymap)</b></DT><DD>
+
+<p> The name of the proxymap read-only table lookup service.  This
+service is normally implemented by the <a href="proxymap.8.html">proxymap(8)</a> daemon. </p>
+
+<p> This feature is available in Postfix 2.6 and later. </p>
+
+
+</DD>
+
+<DT><b><a name="proxywrite_service_name">proxywrite_service_name</a>
+(default: proxywrite)</b></DT><DD>
+
+<p> The name of the proxywrite read-write table lookup service.
+This service is normally implemented by the <a href="proxymap.8.html">proxymap(8)</a> daemon.
+</p>
+
+<p> This feature is available in Postfix 2.6 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="qmgr_clog_warn_time">qmgr_clog_warn_time</a>
index 0053b4508ed241729c9b6585f9c44ae1cef72e79..953a06283a272cecce712064561576098ff337a9 100644 (file)
 #      Do not build with Linux EPOLL support.
 #      By default, EPOLL support is compiled in on platforms that
 #      are known to support it.
-# .IP \fB-DNO_KQUEUE\fR
-#      Do not build with FreeBSD/NetBSD/OpenBSD KQUEUE support.
-#      By default, KQUEUE support is compiled in on platforms that
-#      are known to support it.
 # .IP \fB-DNO_IPV6\fR
 #      Do not build with IPv6 support.
 #      By default, IPv6 support is compiled in on platforms that
 #      are known to have IPv6 support.
+# .IP \fB-DNO_KQUEUE\fR
+#      Do not build with FreeBSD/NetBSD/OpenBSD/MacOSX KQUEUE support.
+#      By default, KQUEUE support is compiled in on platforms that
+#      are known to support it.
 # .IP \fB-DNO_PCRE\fR
 #      Do not build with PCRE support.
 #      By default, PCRE support is compiled in when the \fBpcre-config\fR
 #      utility is installed.
+# .IP \fB-DNO_SIGSETJMP\fR
+#      Use setjmp()/longjmp() instead of sigsetjmp()/siglongjmp().
+#      By default, Postfix uses sigsetjmp()/siglongjmp() when they
+#      appear to work.
 # .RE
 # .IP \fBDEBUG=\fIdebug_level\fR
 #      Specifies a non-default debugging level. The default is \fB-g\fR.
@@ -168,7 +172,7 @@ case "$SYSTEM.$RELEASE" in
     SunOS.5*)  SYSTYPE=SUNOS5
                RANLIB=echo
                SYSLIBS="-lresolv -lsocket -lnsl"
-               # Solaris 5 added usleep() and POSIX regular expressions
+               # Solaris 2.5 added usleep() and POSIX regular expressions
                case $RELEASE in
                    5.[0-4]) CCARGS="$CCARGS -DMISSING_USLEEP -DNO_POSIX_REGEXP";;
                esac
@@ -283,32 +287,12 @@ case "$SYSTEM.$RELEASE" in
                # Kernel 2.6 added EPOLL
                case "$RELEASE" in
                2.[0-5].*) CCARGS="$CCARGS -DNO_EPOLL";;
-               esac
-               # Workaround for retarded libc 
-               case "$RELEASE" in
-               2.6.*)
-               trap 'rm -f makedefs.test makedefs.test.o makedefs.test.c' 1 2 3 15
-               cat >makedefs.test.c <<EOF
-#include <sys/types.h>
-#include <sys/epoll.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int     main(int argc, char **argv)
-{
-    int     epoll_handle;
-
-    if ((epoll_handle = epoll_create(1)) < 0) {
-       perror("epoll_create");
-       exit(1);
-    }
-    exit(0);
-}
-EOF
-               ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
-               ./makedefs.test 2>/dev/null || CCARGS="$CCARGS -DNO_EPOLL"
-               rm -f makedefs.test makedefs.test.o makedefs.test.c;;
+                   # Workaround for retarded libc 
+                   2.6.*) trap 'rm -f linux_epoll linux_epoll.o' 1 2 3 15
+                          ${CC-gcc} -o linux_epoll makedefs.d/linux_epoll.c || exit 1
+                          ./linux_epoll 2>/dev/null ||
+                               CCARGS="$CCARGS -DNO_EPOLL"
+                          rm -f linux_epoll linux_epoll.o;;
                esac
                ;;
      GNU.0*|GNU/kFreeBSD.[567]*)
@@ -384,25 +368,38 @@ ReliantUNIX-?.5.43) SYSTYPE=ReliantUnix543
                RANLIB=echo
                SYSLIBS="-lresolv -lsocket -lnsl"
                ;;
-Rhapsody.5*|Darwin.*)
-               SYSTYPE=MACOSX
+    Darwin.*)   SYSTYPE=MACOSX
                # Use the native compiler by default
                : ${CC=cc}
+               # Darwin > 1.3 uses awk and flat_namespace
                case $RELEASE in
                 1.[0-3]) AWK=gawk
-                         CCARGS="$CCARGS -DNO_IPV6"
-                         ;;
-                [2-6].*) AWK=awk
-                         CCARGS="$CCARGS -DNO_IPV6"
-                         SYSLIBS=-flat_namespace
                          ;;
                       *) AWK=awk
                          SYSLIBS=-flat_namespace
-                         CCARGS="$CCARGS -DBIND_8_COMPAT -DNO_NETINFO"
+                         ;;
+               esac
+               # Darwin 7 adds IPv6 support, BIND_8_COMPAT, NO_NETINFO
+               case $RELEASE in
+                [1-6].*) CCARGS="$CCARGS -DNO_IPV6"
+                         ;;
+                      *) CCARGS="$CCARGS -DBIND_8_COMPAT -DNO_NETINFO"
+                         ;;
+               esac
+               # Darwin 8.11.1 has kqueue support, but let's play safe
+               case $RELEASE in
+                [1-8].*) CCARGS="$CCARGS -DNO_KQUEUE"
+                         ;;
+                      *) trap 'rm -f macosx_kqueue macosx_kqueue.o' 1 2 3 15
+                         ${CC-gcc} -o macosx_kqueue makedefs.d/macosx_kqueue.c || exit 1
+                         ./macosx_kqueue 2>/dev/null || 
+                               CCARGS="$CCARGS -DNO_KQUEUE"
+                         rm -f macosx_kqueue macosx_kqueue.o
                          ;;
                esac
                ;;
-"Mac OS".10*)  SYSTYPE=MACOSX
+Rhapsody.5*|"Mac OS".10*)
+               SYSTYPE=MACOSX
                # Use the native compiler by default
                : ${CC=cc}
                AWK=gawk
@@ -428,6 +425,19 @@ Rhapsody.5*|Darwin.*)
           *)   error "Unknown system type: $SYSTEM $RELEASE";;
 esac
 
+#
+# sigsetjmp()/siglongjmp() can be "better" than setjmp()/longjmp()
+# if used wisely (that is: almost never, just like signals).
+# Unfortunately some implementations have been buggy in the past.
+#
+case "$CCARGS" in
+ *-DNO_SIGSETJMP*) ;;
+                *) trap 'rm -f sigsetjmp sigsetjmp.o' 1 2 3 15
+                  ${CC-gcc} -o sigsetjmp makedefs.d/sigsetjmp.c || exit 1
+                  ./sigsetjmp 2>/dev/null || CCARGS="$CCARGS -DNO_SIGSETJMP"
+                  rm -f sigsetjmp sigsetjmp.o;;
+esac
+
 #
 # OpenSSL has no configuration query utility, but we don't try to
 # guess. We assume includes in /usr/include/openssl and libraries in
diff --git a/postfix/makedefs.d/linux_epoll.c b/postfix/makedefs.d/linux_epoll.c
new file mode 100644 (file)
index 0000000..e344314
--- /dev/null
@@ -0,0 +1,16 @@
+#include <sys/types.h>
+#include <sys/epoll.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int     main(int argc, char **argv)
+{
+    int     epoll_handle;
+
+    if ((epoll_handle = epoll_create(1)) < 0) {
+       perror("epoll_create");
+       exit(1);
+    }
+    exit(0);
+}
diff --git a/postfix/makedefs.d/macosx_kqueue.c b/postfix/makedefs.d/macosx_kqueue.c
new file mode 100644 (file)
index 0000000..6590a5f
--- /dev/null
@@ -0,0 +1,45 @@
+/* Adapted from libevent. */
+
+#include <sys/types.h>
+#include <sys/event.h>
+#include <sys/time.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifndef EV_SET
+#define EV_SET(kp, id, fi, fl, ffl, da, ud) do { \
+       struct kevent *__kp = (kp); \
+       __kp->ident = (id); \
+       __kp->filter = (fi); \
+       __kp->flags = (fl); \
+       __kp->fflags = (ffl); \
+       __kp->data = (da); \
+       __kp->udata = (ud); \
+    } while(0)
+#endif
+
+int     main(int argc, char **argv)
+{
+    int     kq;
+    struct kevent test_change;
+    struct kevent test_result;
+
+    if ((kq = kqueue()) < 0) {
+       perror("kqueue");
+       exit(1);
+    }
+#define TEST_FD (-1)
+
+    EV_SET(&test_change, TEST_FD, EVFILT_READ, EV_ADD, 0, 0, 0);
+    if (kevent(kq,
+              &test_change, sizeof(test_change) / sizeof(struct kevent),
+              &test_result, sizeof(test_result) / sizeof(struct kevent),
+              (struct timespec *) 0) != 1 ||
+       test_result.ident != TEST_FD ||
+       test_result.flags != EV_ERROR) {
+       fprintf(stderr, "kqueue is broken\n");
+       exit(1);
+    }
+    exit(0);
+}
diff --git a/postfix/makedefs.d/sigsetjmp.c b/postfix/makedefs.d/sigsetjmp.c
new file mode 100644 (file)
index 0000000..0b96c6d
--- /dev/null
@@ -0,0 +1,37 @@
+#include <setjmp.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+static int count = 0;
+
+int     main(int argc, char **argv)
+{
+    sigjmp_buf env;
+    int     retval;
+
+    switch (retval = sigsetjmp(env, 1)) {
+    case 0:
+       siglongjmp(env, 12345);
+    case 12345:
+       break;
+    default:
+       fprintf(stderr, "Error: siglongjmp ignores second argument\n");
+       exit(1);
+    }
+
+    switch (retval = sigsetjmp(env, 1)) {
+    case 0:
+       if (count++ > 0) {
+           fprintf(stderr, "Error: not overriding siglongjmp(env, 0)\n");
+           exit(1);
+       }
+       siglongjmp(env, 0);
+    case 1:
+       break;
+    default:
+       fprintf(stderr, "Error: overriding siglongjmp(env, 0) with %d\n",
+               retval);
+       exit(1);
+    }
+    exit(0);
+}
index f12518ad98d25eec11b55c2028e6529f7b0e078a..cf363cade3659f469ae7303d99ae79f76a616f29 100644 (file)
@@ -794,6 +794,8 @@ This feature is available in Postfix 2.3 and later.
 .SH connection_cache_service_name (default: scache)
 The name of the \fBscache\fR(8) connection cache service.  This service
 maintains a limited pool of cached sessions.
+.PP
+This feature is available in Postfix 2.2 and later.
 .SH connection_cache_status_update_time (default: 600s)
 How frequently the \fBscache\fR(8) server logs usage statistics with
 connection cache hit and miss rates for logical destinations and for
@@ -3041,6 +3043,9 @@ with a permanent status code.
 .IP "tempfail"
 Reject all further commands in this session
 with a temporary status code.
+.IP "quarantine"
+Like "accept", but freeze the message in
+the "hold" queue. Available with Postfix 2.6 and later.
 .PP
 This feature is available in Postfix 2.3 and later.
 .SH milter_end_of_data_macros (default: see postconf -n output)
@@ -3506,6 +3511,16 @@ files should be stored under the Postfix-owned data_directory.
 Table references that don't begin with proxy: are ignored.
 .PP
 This feature is available in Postfix 2.5 and later.
+.SH proxymap_service_name (default: proxymap)
+The name of the proxymap read-only table lookup service.  This
+service is normally implemented by the \fBproxymap\fR(8) daemon.
+.PP
+This feature is available in Postfix 2.6 and later.
+.SH proxywrite_service_name (default: proxywrite)
+The name of the proxywrite read-write table lookup service.
+This service is normally implemented by the \fBproxymap\fR(8) daemon.
+.PP
+This feature is available in Postfix 2.6 and later.
 .SH qmgr_clog_warn_time (default: 300s)
 The minimal delay between warnings that a specific destination is
 clogging up the Postfix active queue. Specify 0 to disable.
index e968b86622b81d092317331e77f8725b17c2a235..38306a6926525af537d884287fa4fec0a15b622b 100755 (executable)
@@ -333,6 +333,8 @@ while (<>) {
     s;\bprocess_name\b;<a href="postconf.5.html#process_name">$&</a>;g;
     s;\bpropagate_unmatched_extensions\b;<a href="postconf.5.html#propagate_unmatched_extensions">$&</a>;g;
     s;\bproxy_inter[-</bB>]*\n* *[<bB>]*faces\b;<a href="postconf.5.html#proxy_interfaces">$&</a>;g;
+    s;\bproxymap_service_name\b;<a href="postconf.5.html#proxymap_service_name">$&</a>;g;
+    s;\bproxywrite_service_name\b;<a href="postconf.5.html#proxywrite_service_name">$&</a>;g;
     s;\bproxy_read_maps\b;<a href="postconf.5.html#proxy_read_maps">$&</a>;g;
     s;\bproxy_write_maps\b;<a href="postconf.5.html#proxy_write_maps">$&</a>;g;
     s;\bqmgr_clog_warn_time\b;<a href="postconf.5.html#qmgr_clog_warn_time">$&</a>;g;
index 5085ed8a088e987ab423e691919b0f9c6e558c86..b88a884937f6a2313520438e7082525117ddcbc1 100644 (file)
@@ -425,12 +425,15 @@ Milter application errors. The default action is to respond with a
 temporary error status, so that the client will try again later.
 Specify "accept" if you want to receive mail as if the filter does
 not exist, and "reject" to reject mail with a permanent status.
+The "quarantine" action is like "accept" but freezes the message
+in the "hold" queue, and is available with Postfix 2.6 or later.
 </p>
 
 <blockquote>
 <pre>
 /etc/postfix/main.cf:
-    # What to do in case of errors? Specify accept, reject, or tempfail.
+    # What to do in case of errors? Specify accept, reject, tempfail,
+    # or quarantine (Postfix 2.6 or later).
     milter_default_action = tempfail
 </pre>
 </blockquote>
index 9f6e7a4c8756dcd8c96627c40418684517a686e9..bedbf465c72825abeef83ca2504878452ca9e5dd 100644 (file)
@@ -77,10 +77,25 @@ this affects end-user mail clients, enable the "submission" service
 entry in master.cf (present since Postfix 2.1), and tell users to
 connect to this instead of the public SMTP service. </p>
 
+<ul>
+
+<li> <p> NOTE: Broken DNS configurations also cause lengthy delays
+before Postfix sends "220 hostname.example.com ...". In this case
+the delay happens even when Postfix is not busy.  </p>
+
+</ul>
+
 <li> <p> The Postfix SMTP server logs an increased number of "lost
 connection after CONNECT" events. This happens because remote SMTP
 clients disconnect before Postfix answers the connection. </p>
 
+<ul>
+
+<li> <p> NOTE: A portscan for open SMTP ports also results in "lost
+connection ..." logfile messages. </p>
+
+</ul>
+
 <li> <p> Postfix 2.3 and later logs a warning that all server ports
 are busy: </p>
 
@@ -95,21 +110,6 @@ Oct  3 20:39:27 spike postfix/master[28905]: warning: to avoid this
 
 </ul>
 
-<p> NOTE: The first two symptoms may also happen without overload,
-for example: </p>
-
-<ul>
-
-<li> <p> Broken DNS also causes lengthy delays before "220
-hostname.example.com
-..." while the Postfix SMTP server tries to look up the client's
-hostname.  </p>
-
-<li> <p> A portscan for open SMTP ports also results in "lost
-connection ..." logfile messages. </p>
-
-</ul>
-
 <p> Legitimate mail that doesn't get through during an episode of
 overload is not necessarily lost. It should still arrive once the
 situation returns to normal, as long as the overload condition is
@@ -138,7 +138,7 @@ filters (BSD kqueue(2), Linux epoll(4), or Solaris /dev/poll).
 </p>
 
 <li> <p> You can reduce the Postfix memory footprint by using cdb:
-lookup tables instead of Berkeley DB. </p>
+lookup tables instead of Berkeley DB's hash: or btree: tables. </p>
 
 <pre>
  1 /etc/postfix/main.cf:
@@ -159,7 +159,9 @@ processes.  When you raise the SMTP server's "maxproc" field in
 master.cf, SMTP server processes will report problems when connecting
 to policy server processes, because there aren't enough of them.
 Examples of errors are "connection refused" or "operation timed
-out".  To fix, edit master.cf and specify a zero "maxproc" field
+out".  </p>
+
+<p> To fix, edit master.cf and specify a zero "maxproc" field
 in all policy server entries; see line 6 in the example below.
 Issue a "postfix reload" command to make the change effective.  </p>
 
@@ -180,8 +182,7 @@ Issue a "postfix reload" command to make the change effective.  </p>
 <p> When increasing the number of SMTP server processes is not
 practical, you can improve Postfix server responsiveness by eliminating
 unnecessary work. When Postfix spends less time per SMTP session, the
-same number of SMTP server processes can service more clients in
-the same amount of time. </p>
+same number of SMTP server processes can service more clients. </p>
 
 <ul>
 
index 6db1f32f4b6ba69f1bbf54d487774c38ac5277b0..1b19fa2f79dbb8b305df1bb3261435e2ae177da6 100644 (file)
@@ -8221,6 +8221,8 @@ The table is not searched by hostname for robustness reasons.  </p>
 <p> The name of the scache(8) connection cache service.  This service
 maintains a limited pool of cached sessions.  </p>
 
+<p> This feature is available in Postfix 2.2 and later. </p>
+
 %PARAM connection_cache_ttl_limit 2s
 
 <p> The maximal time-to-live value that the scache(8) connection
@@ -10401,6 +10403,9 @@ with a permanent status code.</dd>
 <dt>tempfail</dt> <dd>Reject all further commands in this session
 with a temporary status code. </dd>
 
+<dt>quarantine</dt> <dd>Like "accept", but freeze the message in
+the "hold" queue. Available with Postfix 2.6 and later. </dd>
+
 </dl>
 
 <p> This feature is available in Postfix 2.3 and later. </p>
@@ -11614,3 +11619,19 @@ details.
 The default setting is not backwards compatible.  </p>
     
 <p> This feature is available in Postfix 2.5.3 and later. </p>
+
+%PARAM proxymap_service_name proxymap
+
+<p> The name of the proxymap read-only table lookup service.  This
+service is normally implemented by the proxymap(8) daemon. </p>
+
+<p> This feature is available in Postfix 2.6 and later. </p>
+
+%PARAM proxywrite_service_name proxywrite
+
+<p> The name of the proxywrite read-write table lookup service.
+This service is normally implemented by the proxymap(8) daemon.
+</p>
+
+<p> This feature is available in Postfix 2.6 and later. </p>
+
index 5e17f31079736b81ba81bbc31c4117045f5bd333..4d1273222da713df6ec0cbe4e9a1e6eebb9cdf99 100644 (file)
@@ -927,7 +927,7 @@ void    cleanup_message(CLEANUP_STATE *state, int type, const char *buf, ssize_t
 
     /*
      * XXX Workaround: truncate a long message header so that we don't exceed
-     * the Milter request size limit of 65535.
+     * the default Sendmail libmilter request size limit of 65535.
      */
 #define KLUDGE_HEADER_LIMIT    60000
     if ((cleanup_milters || state->milters)
index c9423c73e0c66897aa53fc253f1e3773f01c0ac7..def810f14661caf9832726b91f96eb9504cf672c 100644 (file)
@@ -1399,6 +1399,8 @@ static const char *cleanup_milter_apply(CLEANUP_STATE *state, const char *event,
     switch (resp[0]) {
     case 'H':
        /* XXX Should log the reason here. */
+       if (state->flags & CLEANUP_FLAG_HOLD) 
+           return (0);
        state->flags |= CLEANUP_FLAG_HOLD;
        action = "milter-hold";
        text = "milter triggers HOLD action";
index 8005c8d366e137dd99c1692208b940af7a25b0fb..78a5dd73e520a08abc9d9525e7486afd372c33e4 100644 (file)
@@ -308,38 +308,53 @@ DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
     int     server_flags;
     int     status;
     const char *service;
-    const char *relative_path;
+    char   *relative_path;
     char   *kludge = 0;
     char   *prefix;
     CLNT_STREAM **pstream;
 
     /*
-     * Sanity checks.
+     * If this map can't be proxied then we silently do a direct open. This
+     * allows sites to benefit from proxying the virtual mailbox maps without
+     * unnecessary pain.
+     */
+    if (dict_flags & DICT_FLAG_NO_PROXY)
+       return (dict_open(map, open_flags, dict_flags));
+
+    /*
+     * Use a shared stream for proxied table lookups of the same type.
      * 
      * XXX A complete implementation would also allow O_RDWR without O_CREAT.
      * But we must not pass on every possible set of flags to the proxy
      * server; only sets that make sense. For now, the flags are passed
      * implicitly by choosing between the proxymap or proxywrite service.
+     * 
+     * XXX Use absolute pathname to make this work from non-daemon processes.
      */
     if (open_flags == O_RDONLY) {
        pstream = &proxymap_stream;
-       service = MAIL_SERVICE_PROXYMAP;
-       relative_path = MAIL_CLASS_PRIVATE "/" MAIL_SERVICE_PROXYMAP;
+       service = var_proxymap_service;
     } else if (open_flags == (O_RDWR | O_CREAT)) {
        pstream = &proxywrite_stream;
-       service = MAIL_SERVICE_PROXYWRITE;
-       relative_path = MAIL_CLASS_PRIVATE "/" MAIL_SERVICE_PROXYWRITE;
+       service = var_proxywrite_service;
     } else
        msg_fatal("%s: %s map open requires O_RDONLY or O_RDWR|O_CREAT mode",
                  map, DICT_TYPE_PROXY);
 
-    /*
-     * OK. If this map can't be proxied then we silently do a direct open.
-     * This allows sites to benefit from proxying the virtual mailbox maps
-     * without unnecessary pain.
-     */
-    if (dict_flags & DICT_FLAG_NO_PROXY)
-       return (dict_open(map, open_flags, dict_flags));
+    if (*pstream == 0) {
+       relative_path = concatenate(MAIL_CLASS_PRIVATE "/",
+                                   service, (char *) 0);
+       if (access(relative_path, F_OK) == 0)
+           prefix = MAIL_CLASS_PRIVATE;
+       else
+           prefix = kludge = concatenate(var_queue_dir, "/",
+                                         MAIL_CLASS_PRIVATE, (char *) 0);
+       *pstream = clnt_stream_create(prefix, service, var_ipc_idle_limit,
+                                     var_ipc_ttl_limit);
+       if (kludge)
+           myfree(kludge);
+       myfree(relative_path);
+    }
 
     /*
      * Local initialization.
@@ -352,23 +367,6 @@ DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
     dict_proxy->dict.close = dict_proxy_close;
     dict_proxy->in_flags = dict_flags;
     dict_proxy->result = vstring_alloc(10);
-
-    /*
-     * Use a shared stream for proxied table lookups of the same type.
-     * 
-     * XXX Use absolute pathname to make this work from non-daemon processes.
-     */
-    if (*pstream == 0) {
-       if (access(relative_path, F_OK) == 0)
-           prefix = MAIL_CLASS_PRIVATE;
-       else
-           prefix = kludge = concatenate(var_queue_dir, "/",
-                                         MAIL_CLASS_PRIVATE, (char *) 0);
-       *pstream = clnt_stream_create(prefix, service, var_ipc_idle_limit,
-                                     var_ipc_ttl_limit);
-       if (kludge)
-           myfree(kludge);
-    }
     dict_proxy->clnt = *pstream;
     dict_proxy->service = service;
 
index 2cb19631d619a6ddd51d63b58e37fd52bcb72b36..a8d9c11bda0f07cb9c5223c84a1bfe29848a51c4 100644 (file)
@@ -91,6 +91,8 @@
 /*     char   *var_flush_service;
 /*     char   *var_verify_service;
 /*     char   *var_trace_service;
+/*     char   *var_proxymap_service;
+/*     char   *var_proxywrite_service;
 /*     int     var_db_create_buf;
 /*     int     var_db_read_buf;
 /*     int     var_mime_maxdepth;
@@ -266,6 +268,8 @@ char   *var_error_service;
 char   *var_flush_service;
 char   *var_verify_service;
 char   *var_trace_service;
+char   *var_proxymap_service;
+char   *var_proxywrite_service;
 int     var_db_create_buf;
 int     var_db_read_buf;
 int     var_mime_maxdepth;
@@ -541,6 +545,8 @@ void    mail_params_init()
        VAR_FLUSH_SERVICE, DEF_FLUSH_SERVICE, &var_flush_service, 1, 0,
        VAR_VERIFY_SERVICE, DEF_VERIFY_SERVICE, &var_verify_service, 1, 0,
        VAR_TRACE_SERVICE, DEF_TRACE_SERVICE, &var_trace_service, 1, 0,
+       VAR_PROXYMAP_SERVICE, DEF_PROXYMAP_SERVICE, &var_proxymap_service, 1, 0,
+       VAR_PROXYWRITE_SERVICE, DEF_PROXYWRITE_SERVICE, &var_proxywrite_service, 1, 0,
        VAR_INT_FILT_CLASSES, DEF_INT_FILT_CLASSES, &var_int_filt_classes, 0, 0,
        0,
     };
index 54a330baf7019e466b4972da54111b9a9aaf4eb1..559ea468042987f30b3c8117f4c87b601c272c5b 100644 (file)
@@ -2498,6 +2498,17 @@ extern char *var_vrfy_xport_maps;
 #define DEF_TRACE_SERVICE              MAIL_SERVICE_TRACE
 extern char *var_trace_service;
 
+ /*
+  * Proxymappers.
+  */
+#define VAR_PROXYMAP_SERVICE           "proxymap_service_name"
+#define DEF_PROXYMAP_SERVICE           MAIL_SERVICE_PROXYMAP
+extern char *var_proxymap_service;
+
+#define VAR_PROXYWRITE_SERVICE         "proxywrite_service_name"
+#define DEF_PROXYWRITE_SERVICE         MAIL_SERVICE_PROXYWRITE
+extern char *var_proxywrite_service;
+
  /*
   * Mailbox/maildir delivery errors that cause delivery to be tried again.
   */
index 23eae826143eda9ca22e04a7d6e994bf6b9566ce..05598658838932d8f9186608dcf4e9f0906a0b1f 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20080814"
+#define MAIL_RELEASE_DATE      "20080824"
 #define MAIL_VERSION_NUMBER    "2.6"
 
 #ifdef SNAPSHOT
index 4a3abb96d849f7628d8e30054a3b17f82b6f6b4e..3d660a4b5c42f521fde7dd1559a623d9f5e947ea 100644 (file)
@@ -505,6 +505,8 @@ static int milter8_conf_error(MILTER8 *milter)
     }
     if (strcasecmp(milter->def_action, "accept") == 0) {
        reply = 0;
+    } else if (strcasecmp(milter->def_action, "quarantine") == 0) {
+       reply = "H";
     } else {
        reply = "451 4.3.5 Server configuration problem - try again later";
     }
@@ -537,6 +539,8 @@ static int milter8_comm_error(MILTER8 *milter)
        reply = "550 5.5.0 Service unavailable";
     } else if (strcasecmp(milter->def_action, "tempfail") == 0) {
        reply = "451 4.7.1 Service unavailable - try again later";
+    } else if (strcasecmp(milter->def_action, "quarantine") == 0) {
+       reply = "H";
     } else {
        msg_warn("milter %s: unrecognized default action: %s",
                 milter->m.name, milter->def_action);
index 23a0c37cba880a3cedb8f614e784b362892487b2..8980f416e27813791efffeb21e8faa07801ac2b4 100644 (file)
@@ -19,6 +19,9 @@
 /* .IP "\fB-a accept|tempfail|reject|discard|skip|\fIddd x.y.z text\fR"
 /*     Specifies a non-default reply for the MTA command specified
 /*     with \fB-c\fR. The default is \fBtempfail\fR.
+/* .IP "\fB-A address\fR"
+/*     Add the specified recipient address. Multiple -A options
+/*     are supported.
 /* .IP "\fB-d\fI level\fR"
 /*     Enable libmilter debugging at the specified level.
 /* .IP "\fB-c connect|helo|mail|rcpt|data|header|eoh|body|eom|unknown|close|abort\fR"
@@ -146,6 +149,10 @@ static char *body_file;
 
 #endif
 
+#define MAX_RCPT       10
+int     rcpt_count = 0;
+char   *rcpt_addr[MAX_RCPT];
+
 static int test_reply(SMFICTX *ctx, int code)
 {
     (void) fflush(stdout);             /* In case output redirected. */
@@ -288,12 +295,19 @@ static sfsistat test_eom(SMFICTX *ctx)
 #endif
 #ifdef SMFIR_INSHEADER
     if (ins_hdr && smfi_insheader(ctx, ins_idx, ins_hdr, ins_val) == MI_FAILURE)
-       fprintf(stderr, "smfi_insheader failed");
+       fprintf(stderr, "smfi_insheader failed\n");
 #endif
 #ifdef SMFIR_CHGHEADER
     if (chg_hdr && smfi_chgheader(ctx, chg_hdr, chg_idx, chg_val) == MI_FAILURE)
-       fprintf(stderr, "smfi_chgheader failed");
+       fprintf(stderr, "smfi_chgheader failed\n");
 #endif
+    {
+       int     count;
+
+       for (count = 0; count < rcpt_count; count++)
+           if (smfi_addrcpt(ctx, rcpt_addr[count]) == MI_FAILURE)
+               fprintf(stderr, "smfi_addrcpt `%s' failed\n", rcpt_addr[count]);
+    }
     return (test_reply(ctx, test_eom_reply));
 }
 
@@ -464,11 +478,18 @@ int     main(int argc, char **argv)
     char   *noreply = 0;
     const struct noproto_map *np;
 
-    while ((ch = getopt(argc, argv, "a:c:C:d:i:lm:M:n:N:p:r:R:v")) > 0) {
+    while ((ch = getopt(argc, argv, "a:A:c:C:d:i:lm:M:n:N:p:r:R:v")) > 0) {
        switch (ch) {
        case 'a':
            action = optarg;
            break;
+       case 'A':
+           if (rcpt_count >= MAX_RCPT) {
+               fprintf(stderr, "too many -A options\n");
+               exit(1);
+           }
+           rcpt_addr[rcpt_count++] = optarg;
+           break;
        case 'c':
            command = optarg;
            break;
index e8bdf3e11cd82dd49b156ef7fc7d3c8fe39679eb..cd7e271758bdcd21bd018ce1dcf1e230ea55fc33 100644 (file)
@@ -3115,27 +3115,49 @@ static int reject_rbl_addr(SMTPD_STATE *state, const char *rbl_domain,
     int     i;
     SMTPD_RBL_STATE *rbl;
     const char *reply_addr;
+    struct addrinfo *res;
+    unsigned char *ipv6_addr;
 
     if (msg_verbose)
        msg_info("%s: %s %s", myname, reply_class, addr);
 
+    query = vstring_alloc(100);
+
     /*
-     * IPv4 / IPv6-mapped IPv4 (if supported) only for now
-     */
-    if (valid_ipv6_hostaddr(addr, DONT_GRIPE))
-       return SMTPD_CHECK_DUNNO;
+     * Reverse the client IPV6 address, represented as 32 hexadecimal
+     * nibbles. We use the binary address to avoid tricky code. Asking for an
+     * AAAA record makes no sense here. Just like with IPv4 we use the lookup
+     * result as a bit mask, not as an IP address.
+     */
+#ifdef PF_INET6
+    if (valid_ipv6_hostaddr(addr, DONT_GRIPE)) {
+       if (hostaddr_to_sockaddr(addr, (char *) 0, 0, &res) != 0
+           || res->ai_family != PF_INET6)
+           msg_fatal("%s: unable to convert address %s", myname, addr);
+       ipv6_addr = (unsigned char *) &SOCK_ADDR_IN6_ADDR(res->ai_addr);
+       for (i = sizeof(SOCK_ADDR_IN6_ADDR(res->ai_addr)) - 1; i >= 0; i--)
+           vstring_sprintf_append(query, "%x.%x.",
+                                  ipv6_addr[i] & 0xf, ipv6_addr[i] >> 4);
+       freeaddrinfo(res);
+    } else
+#endif
+
+       /*
+        * Reverse the client IPV4 address, represented as four decimal octet
+        * values. We use the textual address for convenience.
+        */
+    {
+       octets = argv_split(addr, ".");
+       for (i = octets->argc - 1; i >= 0; i--) {
+           vstring_strcat(query, octets->argv[i]);
+           vstring_strcat(query, ".");
+       }
+       argv_free(octets);
+    }
 
     /*
-     * Reverse the client IPV4 address, tack on the RBL domain name and query
-     * the DNS for an A record.
+     * Tack on the RBL domain name and query the DNS for an A record.
      */
-    query = vstring_alloc(100);
-    octets = argv_split(addr, ".");
-    for (i = octets->argc - 1; i >= 0; i--) {
-       vstring_strcat(query, octets->argv[i]);
-       vstring_strcat(query, ".");
-    }
-    argv_free(octets);
     vstring_strcat(query, rbl_domain);
     reply_addr = split_at(STR(query), '=');
     rbl = (SMTPD_RBL_STATE *) ctable_locate(smtpd_rbl_cache, STR(query));
index 626531cc09a208ef82a8960c6cd8bf5c8cad5fd8..0dba39b79ed13538f5e0425835934a82765f787e 100644 (file)
 /*     transport is currently limited to one of the following:
 /* .RS
 /* .IP inet
-/*     servername has the form "host:port".
+/*     servername has the form "inet:host:port".
+/* .IP local
+/*     servername has the form "local:private/servicename" or
+/*     "local:public/servicename". This is the preferred way to
+/*     specify Postfix daemons that are configured as "unix" in
+/*     master.cf.
 /* .IP unix
-/*     servername has the form "private/servicename" or
-/*     "public/servicename".
+/*     servername has the form "unix:private/servicename" or
+/*     "unix:public/servicename". This does not work on Solaris,
+/*     where Postfix uses STREAMS instead of UNIX-domain sockets.
 /* .RE
 /* .IP timeout
 /*     The time limit for sending, receiving, or for connecting
index a056bb0a89375a8f93c53ea7474aa352a7cebd14..26116d886882edb23624e6a93ba01e83ed9c31df 100644 (file)
 
 int     stream_send_fd(int fd, int sendfd)
 {
+#ifdef STREAM_CONNECTIONS
     const char *myname = "stream_send_fd";
 
-#ifdef STREAM_CONNECTIONS
     if (ioctl(fd, I_SENDFD, sendfd) < 0)
        msg_fatal("%s: send file descriptor %d: %m", myname, sendfd);
     return (0);
 #else
-    msg_fatal("stream connections are not implemented");
+            msg_fatal("stream connections are not implemented");
 #endif
 }
 
index 0c8f4d9865a3270227081fe9ae3ac51360034e53..8f8f8f7b980198adda73cf369242f6ad743a1611 100644 (file)
 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
 #define SOCKADDR_SIZE  socklen_t
 #define SOCKOPT_SIZE   socklen_t
+#ifndef NO_KQUEUE
+# define EVENTS_STYLE  EVENTS_STYLE_KQUEUE
+# define USE_SYSV_POLL
+#endif
+
 #endif
 
  /*
@@ -1271,6 +1276,10 @@ extern int inet_pton(int, const char *, void *);
 #define EVENTS_STYLE_DEVPOLL   3       /* Solaris /dev/poll */
 #define EVENTS_STYLE_EPOLL     4       /* Linux epoll */
 
+#if !defined(USE_SYSV_POLL) && (EVENTS_STYLE != EVENTS_STYLE_SELECT)
+#error "need USE_SYSV_POLL with EVENTS_STYLE != EVENTS_STYLE_SELECT"
+#endif
+
  /*
   * Defaults for all systems.
   */
index 970beba620888cfacf9a4a0bfb1d31cfcdb82aa2..b3b9fce5616a2226e6a3e73f30eca8f6b13a2cb3 100644 (file)
@@ -1250,7 +1250,8 @@ void    vstream_control(VSTREAM *stream, int name,...)
            break;
        case VSTREAM_CTL_EXCEPT:
            if (stream->jbuf == 0)
-               stream->jbuf = (jmp_buf *) mymalloc(sizeof(jmp_buf));
+               stream->jbuf =
+                   (VSTREAM_JMP_BUF *) mymalloc(sizeof(VSTREAM_JMP_BUF));
            break;
 
 #ifdef VSTREAM_CTL_DUPFD
index b8cdca7a5e658563611169f23df5c588d70c9993..845be337f8b440f77990f3d21c77d3c44b2cfd16 100644 (file)
 typedef ssize_t (*VSTREAM_FN) (int, void *, size_t, int, void *);
 typedef int (*VSTREAM_WAITPID_FN) (pid_t, WAIT_STATUS_T *, int);
 
+#ifdef NO_SIGSETJMP
+#define VSTREAM_JMP_BUF        jmp_buf
+#else
+#define VSTREAM_JMP_BUF        sigjmp_buf
+#endif
+
 typedef struct VSTREAM {
     VBUF    buf;                       /* generic intelligent buffer */
     int     fd;                                /* file handle, no 256 limit */
@@ -48,7 +54,7 @@ typedef struct VSTREAM {
     pid_t   pid;                       /* vstream_popen/close() */
     VSTREAM_WAITPID_FN waitpid_fn;     /* vstream_popen/close() */
     int     timeout;                   /* read/write timout */
-    jmp_buf *jbuf;                     /* exception handling */
+    VSTREAM_JMP_BUF *jbuf;             /* exception handling */
     struct timeval iotime;             /* time of last fill/flush */
     /* At bottom for Postfix 2.4 binary compatibility. */
     ssize_t req_bufsize;               /* write buffer size */
@@ -152,9 +158,18 @@ extern ssize_t vstream_peek(VSTREAM *);
  /*
   * Exception handling. We use pointer to jmp_buf to avoid a lot of unused
   * baggage for streams that don't need this functionality.
+  * 
+  * XXX sigsetjmp()/siglongjmp() save and restore the signal mask which can
+  * avoid surprises in code that manipulates signals, but unfortunately some
+  * systems have bugs in their implementation.
   */
+#ifdef NO_SIGSETJMP
 #define vstream_setjmp(stream)         setjmp((stream)->jbuf[0])
 #define vstream_longjmp(stream, val)   longjmp((stream)->jbuf[0], (val))
+#else
+#define vstream_setjmp(stream)         sigsetjmp((stream)->jbuf[0], 1)
+#define vstream_longjmp(stream, val)   siglongjmp((stream)->jbuf[0], (val))
+#endif
 
  /*
   * Tweaks and workarounds.