]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4-20070214
authorWietse Venema <wietse@porcupine.org>
Wed, 14 Feb 2007 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:32:55 +0000 (06:32 +0000)
17 files changed:
postfix/HISTORY
postfix/README_FILES/LMTP_README [deleted file]
postfix/README_FILES/OVERVIEW
postfix/conf/postfix-files
postfix/html/LMTP_README.html [deleted file]
postfix/html/OVERVIEW.html
postfix/makedefs
postfix/proto/LMTP_README.html [deleted file]
postfix/proto/Makefile.in
postfix/proto/OVERVIEW.html
postfix/src/global/mail_version.h
postfix/src/oqmgr/qmgr_transport.c
postfix/src/qmgr/qmgr_transport.c
postfix/src/util/events.c
postfix/src/util/sys_defs.h
postfix/src/util/vstream.c
postfix/src/util/vstream.h

index 613550be2e4fe78a2ee0f3adf464ba86e3487945..14cb15f59b90cefff99dc32288b20b739b3ce3a1 100644 (file)
@@ -13225,8 +13225,19 @@ Apologies for any names omitted.
        events.c handler, undid some unnecessary changes to the
        {read,write}{_wait,able}.c modules, and addressed Victor's
        paranoia for multi-client servers with a thousand clients
-       while linked with third-party libraries that can't handle
-       file descriptors >= FD_SETSIZE.
+       while linked with library routines that can't handle file
+       descriptors >= FD_SETSIZE.
+
+       Cleanup: while debugging the new events.c handler, removed
+       an unnecessary "write after connect" call-back event. File:
+       global/post_mail.c.
+
+20070214
+
+       Robustness: in the queue manager keep a number of free file
+       descriptor slots at the low end, to work around library
+       routines that can't handle file descriptors >= FD_SETSIZE.
+       Files: *qmgr/qmgr_transport.c, util/vstream.[hc]
 
 Wish list:
 
diff --git a/postfix/README_FILES/LMTP_README b/postfix/README_FILES/LMTP_README
deleted file mode 100644 (file)
index 256bf46..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-P\bPo\bos\bst\btf\bfi\bix\bx L\bLM\bMT\bTP\bP H\bHo\bow\bwt\bto\bo
-
--------------------------------------------------------------------------------
-This document will be made available via http://www.postfix.org/.
-
index 1d9ae180f5118dbbdfefb2145f7b41a607c9f67e..7331c2b1b9de81544b4b3fe084441a9a003071d5 100644 (file)
@@ -136,8 +136,7 @@ unnumbered names inside shaded areas represent Postfix queues.
     delivery to mailbox servers such as Cyrus. The advantage of this setup is
     that one Postfix machine can feed multiple mailbox servers over LMTP. The
     opposite is true as well: one mailbox server can be fed over LMTP by
-    multiple Postfix machines. The LMTP_README document gives examples of how
-    to use the lmtp(8) client.
+    multiple Postfix machines.
 
   * The local(8) delivery agent understands UNIX-style mailboxes, qmail-
     compatible maildir files, Sendmail-style system-wide aliases(5) databases,
index b0a0bfe6866faa0e9f7b32bcb9c45856abbfa614..b483b9146ad37dd6e796962c15c42d33b8fb391d 100644 (file)
@@ -242,7 +242,6 @@ $readme_directory/INSTALL:f:root:-:644
 $readme_directory/IPV6_README:f:root:-:644
 $readme_directory/LDAP_README:f:root:-:644
 $readme_directory/LINUX_README:f:root:-:644
-$readme_directory/LMTP_README:f:root:-:644
 $readme_directory/LOCAL_RECIPIENT_README:f:root:-:644
 $readme_directory/MACOSX_README:f:root:-:644:o
 $readme_directory/MAILDROP_README:f:root:-:644
@@ -292,7 +291,6 @@ $html_directory/INSTALL.html:f:root:-:644
 $html_directory/IPV6_README.html:f:root:-:644
 $html_directory/LDAP_README.html:f:root:-:644
 $html_directory/LINUX_README.html:f:root:-:644
-$html_directory/LMTP_README.html:f:root:-:644
 $html_directory/LOCAL_RECIPIENT_README.html:f:root:-:644
 $html_directory/MAILDROP_README.html:f:root:-:644
 $html_directory/MILTER_README.html:f:root:-:644
diff --git a/postfix/html/LMTP_README.html b/postfix/html/LMTP_README.html
deleted file mode 100644 (file)
index 715c216..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
-        "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
-
-<head>
-
-<title>Postfix LMTP Howto</title>
-
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
-
-</head>
-
-<body>
-
-<h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix LMTP Howto</h1>
-
-<hr>
-
-<p> This document will be made available via <a href="http://www.postfix.org/">http://www.postfix.org/</a>. </p>
-
-</body>
-
-</html>
index 9bdf973e62da0a23576f546b4cd3ee06249f0e1c..015f6e940335b34ffef5401922988d70734729ce 100644 (file)
@@ -359,8 +359,7 @@ is optimized for delivery to mailbox servers such as Cyrus.  The
 advantage of this setup is that one Postfix machine can feed multiple
 mailbox servers over LMTP. The opposite is true as well:  one
 mailbox server can be fed over LMTP by multiple Postfix machines.
-The <a href="LMTP_README.html">LMTP_README</a> document gives examples of how to use the <a href="lmtp.8.html">lmtp(8)</a>
-client.  </p>
+</p>
 
 <li> <p> The <a href="local.8.html">local(8)</a> delivery agent understands UNIX-style mailboxes,
 qmail-compatible maildir files, Sendmail-style system-wide <a href="aliases.5.html">aliases(5)</a>
index 4e80525dc61592f0751410dda0d2481052d7648a..3a6842861ba88fd45abe474898173128333f432f 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
@@ -162,7 +166,7 @@ case "$SYSTEM.$RELEASE" in
     SunOS.5*)  SYSTYPE=SUNOS5
                RANLIB=echo
                SYSLIBS="-lresolv -lsocket -lnsl"
-               # Solaris 8 added usleep() and POSIX regular expressions
+               # Solaris 5 added usleep() and POSIX regular expressions
                case $RELEASE in
                    5.[0-4]) CCARGS="$CCARGS -DMISSING_USLEEP -DNO_POSIX_REGEXP";;
                esac
diff --git a/postfix/proto/LMTP_README.html b/postfix/proto/LMTP_README.html
deleted file mode 100644 (file)
index 1cf2b7c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
-        "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
-
-<head>
-
-<title>Postfix LMTP Howto</title>
-
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
-
-</head>
-
-<body>
-
-<h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix LMTP Howto</h1>
-
-<hr>
-
-<p> This document will be made available via http://www.postfix.org/. </p>
-
-</body>
-
-</html>
index 17b3e41e833057cd0cce56b53b115b59c0b97eba..594b32bae1cc94a3f6f9d95a737e1ea56a6f4ab7 100644 (file)
@@ -22,7 +22,7 @@ HTML  = ../html/ADDRESS_CLASS_README.html \
        ../html/ETRN_README.html ../html/FILTER_README.html \
        ../html/INSTALL.html ../html/IPV6_README.html \
        ../html/LDAP_README.html \
-       ../html/LINUX_README.html ../html/LMTP_README.html \
+       ../html/LINUX_README.html \
        ../html/LOCAL_RECIPIENT_README.html ../html/MAILDROP_README.html \
        ../html/MILTER_README.html \
        ../html/MYSQL_README.html ../html/NFS_README.html \
@@ -58,7 +58,7 @@ README        = ../README_FILES/ADDRESS_CLASS_README \
        ../README_FILES/ETRN_README ../README_FILES/FILTER_README \
        ../README_FILES/INSTALL ../README_FILES/IPV6_README \
        ../README_FILES/LDAP_README \
-       ../README_FILES/LINUX_README ../README_FILES/LMTP_README \
+       ../README_FILES/LINUX_README \
        ../README_FILES/LOCAL_RECIPIENT_README ../README_FILES/MAILDROP_README \
        ../README_FILES/MILTER_README \
        ../README_FILES/MYSQL_README ../README_FILES/NFS_README \
@@ -183,9 +183,6 @@ clobber:
 ../html/LINUX_README.html: LINUX_README.html
        $(POSTLINK) $? >$@
 
-../html/LMTP_README.html: LMTP_README.html
-       $(POSTLINK) $? >$@
-
 ../html/LOCAL_RECIPIENT_README.html: LOCAL_RECIPIENT_README.html
        $(POSTLINK) $? >$@
 
@@ -327,9 +324,6 @@ clobber:
 ../README_FILES/LINUX_README: LINUX_README.html
        $(HT2READ) $? >$@
 
-../README_FILES/LMTP_README: LMTP_README.html
-       $(HT2READ) $? >$@
-
 ../README_FILES/LOCAL_RECIPIENT_README: LOCAL_RECIPIENT_README.html
        $(HT2READ) $? >$@
 
index c6a83be83879322838743758a43ba7e671ac0c20..946837d154e6e81bbc6194287e264ac8b916a551 100644 (file)
@@ -359,8 +359,7 @@ is optimized for delivery to mailbox servers such as Cyrus.  The
 advantage of this setup is that one Postfix machine can feed multiple
 mailbox servers over LMTP. The opposite is true as well:  one
 mailbox server can be fed over LMTP by multiple Postfix machines.
-The LMTP_README document gives examples of how to use the lmtp(8)
-client.  </p>
+</p>
 
 <li> <p> The local(8) delivery agent understands UNIX-style mailboxes,
 qmail-compatible maildir files, Sendmail-style system-wide aliases(5)
index 8742a07dda553ef16ad1a3d954d0febcf2a5dcdb..4a9f60a5d90348a8da1b608667cf02165e2c5a65 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      "20070212"
+#define MAIL_RELEASE_DATE      "20070214"
 #define MAIL_VERSION_NUMBER    "2.4"
 
 #ifdef SNAPSHOT
index 7ff31c57fcc33167473c148d61819bc6bfa0a648..768c39bfe554c3d6cfe1932073ada3bf25fd9252 100644 (file)
 #include <sys_defs.h>
 #include <unistd.h>
 
+#include <sys/time.h>                  /* FD_SETSIZE */
+#include <sys/types.h>                 /* FD_SETSIZE */
+#include <unistd.h>                    /* FD_SETSIZE */
+
+#ifdef USE_SYS_SELECT_H
+#include <sys/select.h>                        /* FD_SETSIZE */
+#endif
+
 /* Utility library. */
 
 #include <msg.h>
@@ -333,6 +341,11 @@ void    qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOT
        event_request_timer(qmgr_transport_event, (char *) alloc, 0);
        return;
     }
+#if !defined(USE_SELECT_EVENTS) && defined(VSTREAM_CTL_DUPFD)
+    vstream_control(alloc->stream,
+                   VSTREAM_CTL_DUPFD, FD_SETSIZE / 8,
+                   VSTREAM_CTL_END);
+#endif
     event_enable_read(vstream_fileno(alloc->stream), qmgr_transport_event,
                      (char *) alloc);
 
index de04bd1925fbb54340516cf9b42e6ed604154338..862979dd2f8a6f53d0b3d4ad069ac2de9129fa59 100644 (file)
 #include <sys_defs.h>
 #include <unistd.h>
 
+#include <sys/time.h>                  /* FD_SETSIZE */
+#include <sys/types.h>                 /* FD_SETSIZE */
+#include <unistd.h>                    /* FD_SETSIZE */
+
+#ifdef USE_SYS_SELECT_H
+#include <sys/select.h>                        /* FD_SETSIZE */
+#endif
+
 /* Utility library. */
 
 #include <msg.h>
@@ -338,6 +346,11 @@ void    qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOT
        event_request_timer(qmgr_transport_event, (char *) alloc, 0);
        return;
     }
+#if !defined(USE_SELECT_EVENTS) && defined(VSTREAM_CTL_DUPFD)
+    vstream_control(alloc->stream,
+                   VSTREAM_CTL_DUPFD, FD_SETSIZE / 8,
+                   VSTREAM_CTL_END);
+#endif
     event_enable_read(vstream_fileno(alloc->stream), qmgr_transport_event,
                      (char *) alloc);
 
index e12f4bcdadf99f43483446831ece67d3bb1d783d..81f2e6b806f5d97eedecdd0bee33ae88d06e001a 100644 (file)
@@ -328,6 +328,7 @@ typedef struct kevent EVENT_BUFFER;
        (event_count) = kevent(event_kq, (struct kevent *) 0, 0, (event_buf), \
                          (buflen), (tsp)); \
     } while (0)
+#define EVENT_BUFFER_READ_TEXT "kevent"
 
  /*
   * Macros to process event buffers from the kernel; see event_loop().
@@ -396,6 +397,7 @@ typedef struct pollfd EVENT_BUFFER;
        dvpoll.dp_timeout = (delay) < 0 ? -1 : (delay) * 1000; \
        (event_count) = ioctl(event_pollfd, DP_POLL, &dvpoll); \
     } while (0)
+#define EVENT_BUFFER_READ_TEXT "ioctl DP_POLL"
 
  /*
   * Macros to process event buffers from the kernel; see event_loop().
@@ -465,6 +467,7 @@ typedef struct epoll_event EVENT_BUFFER;
        (event_count) = epoll_wait(event_epollfd, (event_buf), (buflen), \
                                  (delay) < 0 ? -1 : (delay) * 1000); \
     } while (0)
+#define EVENT_BUFFER_READ_TEXT "epoll_wait"
 
  /*
   * Macros to process event buffers from the kernel; see event_loop().
@@ -918,9 +921,9 @@ void    event_loop(int delay)
 #else
     EVENT_BUFFER event_buf[100];
     EVENT_BUFFER *bp;
-    int     event_count;
 
 #endif
+    int     event_count;
     EVENT_TIMER *timer;
     int     fd;
     EVENT_FDTABLE *fdp;
@@ -982,7 +985,8 @@ void    event_loop(int delay)
     wmask = event_wmask;
     xmask = event_xmask;
 
-    if (select(event_max_fd + 1, &rmask, &wmask, &xmask, tvp) < 0) {
+    event_count = select(event_max_fd + 1, &rmask, &wmask, &xmask, tvp);
+    if (event_count < 0) {
        if (errno != EINTR)
            msg_fatal("event_loop: select: %m");
        return;
@@ -993,7 +997,7 @@ void    event_loop(int delay)
                      select_delay);
     if (event_count < 0) {
        if (errno != EINTR)
-           msg_fatal("event_loop: kevent: %m");
+           msg_fatal("event_loop: " EVENT_BUFFER_READ_TEXT ": %m");
        return;
     }
 #endif
@@ -1034,7 +1038,7 @@ void    event_loop(int delay)
      * application to determine when a read or write is complete.
      */
 #ifdef USE_SELECT_EVENTS
-    for (fd = 0; fd <= event_max_fd; fd++) {
+    for (fd = 0; event_count > 0 && fd <= event_max_fd; fd++) {
        if (FD_ISSET(fd, &event_xmask)) {
            /* In case event_fdtable is updated. */
            fdp = event_fdtable + fd;
index 6d4b8e4c246619f953d055accfb80644a9f3ed81..e4e5af3a434fb5dc1bcd49a9623026c54184038e 100644 (file)
 # define USE_SYSV_POLL
 #endif
 
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 410000) \
+#ifndef NO_KQUEUE
+# if (defined(__FreeBSD_version) && __FreeBSD_version >= 410000) \
     || (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 200000000) \
     || (defined(OpenBSD) && OpenBSD >= 200105) /* OpenBSD 2.9 */
-# define USE_KQUEUE_EVENTS
+#  define USE_KQUEUE_EVENTS
+# endif
 #endif
 
 #endif
index 602d659d32351c56154a12a54417816e2a8c60b6..90d3ab2ed30cdc8208850f81fcdbf3b63230a1a6 100644 (file)
 /*     The argument specifies the file descriptor to be used for writing.
 /*     This feature is limited to double-buffered streams, and makes the
 /*     stream non-seekable.
+/* .IP "VSTREAM_CTL_DUPFD (int)"
+/*     The argument specifies a minimum file descriptor value. If
+/*     the actual stream's file descriptors are below the minimum,
+/*     reallocate the descriptors to the first free value greater
+/*     than or equal to the minimum. The VSTREAM_CTL_DUPFD macro
+/*     is defined only on systems with fcntl() F_DUPFD support.
 /* .IP "VSTREAM_CTL_WAITPID_FN (int (*)(pid_t, WAIT_STATUS_T *, int))"
 /*     A pointer to function that behaves like waitpid(). This information
 /*     is used by the vstream_pclose() routine.
@@ -1163,6 +1169,8 @@ void    vstream_control(VSTREAM *stream, int name,...)
 {
     const char *myname = "vstream_control";
     va_list ap;
+    int     floor;
+    int     old_fd;
 
     for (va_start(ap, name); name != VSTREAM_CTL_END; name = va_arg(ap, int)) {
        switch (name) {
@@ -1216,6 +1224,30 @@ void    vstream_control(VSTREAM *stream, int name,...)
            if (stream->jbuf == 0)
                stream->jbuf = (jmp_buf *) mymalloc(sizeof(jmp_buf));
            break;
+
+#ifdef VSTREAM_CTL_DUPFD
+
+#define VSTREAM_TRY_DUPFD(backup, fd, floor) do { \
+       if (((backup) = (fd)) < floor) { \
+           if (((fd) = fcntl((backup), F_DUPFD, (floor))) < 0) \
+               msg_fatal("fcntl F_DUPFD %d: %m", (floor)); \
+           (void) close(backup); \
+       } \
+    } while (0)
+
+       case VSTREAM_CTL_DUPFD:
+           floor = va_arg(ap, int);
+           if (stream->buf.flags & VSTREAM_FLAG_DOUBLE) {
+               VSTREAM_TRY_DUPFD(old_fd, stream->read_fd, floor);
+               if (stream->write_fd == old_fd)
+                   stream->write_fd = stream->read_fd;
+               else
+                   VSTREAM_TRY_DUPFD(old_fd, stream->write_fd, floor);
+           } else {
+               VSTREAM_TRY_DUPFD(old_fd, stream->fd, floor);
+           }
+           break;
+#endif
        default:
            msg_panic("%s: bad name %d", myname, name);
        }
index 6253092980e8375d2a8269e6150deb5b1ada0800..dc2ebb9f8fea360fdb68175c0e35e7d6ed182574 100644 (file)
@@ -120,6 +120,9 @@ extern void vstream_control(VSTREAM *, int,...);
 #define VSTREAM_CTL_TIMEOUT    8
 #define VSTREAM_CTL_EXCEPT     9
 #define VSTREAM_CTL_CONTEXT    10
+#ifdef F_DUPFD
+#define VSTREAM_CTL_DUPFD      11
+#endif
 
 extern VSTREAM *PRINTFLIKE(1, 2) vstream_printf(const char *,...);
 extern VSTREAM *PRINTFLIKE(2, 3) vstream_fprintf(VSTREAM *, const char *,...);