]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3.16 v2.3.16
authorWietse Venema <wietse@porcupine.org>
Sat, 3 Jan 2009 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 21:08:40 +0000 (16:08 -0500)
postfix/HISTORY
postfix/src/cleanup/Makefile.in
postfix/src/cleanup/cleanup.h
postfix/src/cleanup/cleanup_api.c
postfix/src/cleanup/cleanup_extracted.c
postfix/src/cleanup/cleanup_final.c [new file with mode: 0644]
postfix/src/global/mail_version.h
postfix/src/smtp/smtp_reuse.c

index 48ff0d9ae541541d6d866c664759e534869d601a..3e35a69a38e463d8d46dc8f0995df0d6539d7cf4 100644 (file)
@@ -13173,3 +13173,15 @@ Apologies for any names omitted.
        legitimate configurations that deliver mail to a symbolic
        link in a directory with less restrictive permissions.
 
+20080908
+
+       Bugfix: the cleanup server did not update the recipient
+       count after Milter application access. Backported from
+       Postfix 2.4 update 20070215. Files: cleanup_api.c,
+       cleanup_extracted.c, cleanup_final.c.
+
+20081203
+
+       Cleanup: adjust the VSTREAM buffer strategy when reusing
+       an SMTP connection with a large TCP MSS value. File:
+       smtp/smtp_reuse.c.
index 983442683094765e806f48679baf02455ff0e97d..3c79ad600328db5de0de90069287090b23e58cee 100644 (file)
@@ -3,12 +3,12 @@ SRCS  = cleanup.c cleanup_out.c cleanup_envelope.c cleanup_message.c \
        cleanup_extracted.c cleanup_state.c cleanup_rewrite.c \
        cleanup_map11.c cleanup_map1n.c cleanup_masquerade.c \
        cleanup_out_recipient.c cleanup_init.c cleanup_api.c \
-       cleanup_addr.c cleanup_bounce.c cleanup_milter.c
+       cleanup_addr.c cleanup_bounce.c cleanup_milter.c cleanup_final.c
 OBJS   = cleanup.o cleanup_out.o cleanup_envelope.o cleanup_message.o \
        cleanup_extracted.o cleanup_state.o cleanup_rewrite.o \
        cleanup_map11.o cleanup_map1n.o cleanup_masquerade.o \
        cleanup_out_recipient.o cleanup_init.o cleanup_api.o \
-       cleanup_addr.o cleanup_bounce.o cleanup_milter.o
+       cleanup_addr.o cleanup_bounce.o cleanup_milter.o cleanup_final.o
 HDRS   =
 TESTSRC        = 
 DEFS   = -I. -I$(INC_DIR) -D$(SYSTYPE)
@@ -321,6 +321,32 @@ cleanup_extracted.o: ../../include/vstream.h
 cleanup_extracted.o: ../../include/vstring.h
 cleanup_extracted.o: cleanup.h
 cleanup_extracted.o: cleanup_extracted.c
+cleanup_final.o: ../../include/argv.h
+cleanup_final.o: ../../include/been_here.h
+cleanup_final.o: ../../include/cleanup_user.h
+cleanup_final.o: ../../include/dict.h
+cleanup_final.o: ../../include/header_opts.h
+cleanup_final.o: ../../include/htable.h
+cleanup_final.o: ../../include/mail_conf.h
+cleanup_final.o: ../../include/mail_stream.h
+cleanup_final.o: ../../include/maps.h
+cleanup_final.o: ../../include/match_list.h
+cleanup_final.o: ../../include/match_ops.h
+cleanup_final.o: ../../include/milter.h
+cleanup_final.o: ../../include/mime_state.h
+cleanup_final.o: ../../include/msg.h
+cleanup_final.o: ../../include/mymalloc.h
+cleanup_final.o: ../../include/nvtable.h
+cleanup_final.o: ../../include/rec_type.h
+cleanup_final.o: ../../include/resolve_clnt.h
+cleanup_final.o: ../../include/string_list.h
+cleanup_final.o: ../../include/sys_defs.h
+cleanup_final.o: ../../include/tok822.h
+cleanup_final.o: ../../include/vbuf.h
+cleanup_final.o: ../../include/vstream.h
+cleanup_final.o: ../../include/vstring.h
+cleanup_final.o: cleanup.h
+cleanup_final.o: cleanup_final.c
 cleanup_init.o: ../../include/argv.h
 cleanup_init.o: ../../include/been_here.h
 cleanup_init.o: ../../include/dict.h
index 2c7637ecb8cb1922d5d52ef1301ddf096bc32407..d92fca8531b70b11c1f999169e413e34bbfa8ba4 100644 (file)
@@ -219,6 +219,11 @@ extern void cleanup_message(CLEANUP_STATE *, int, const char *, ssize_t);
   */
 extern void cleanup_extracted(CLEANUP_STATE *, int, const char *, ssize_t);
 
+ /*
+  * cleanup_final.c
+  */
+extern void cleanup_final(CLEANUP_STATE *);
+
  /*
   * cleanup_rewrite.c
   */
index 88bf17e4e6b7a2aa6fb83e71022d3fbcd0a44d6c..74ed42d464cd3e74842871cfb8b4bc01e1153989 100644 (file)
@@ -234,6 +234,13 @@ int     cleanup_flush(CLEANUP_STATE *state)
        }
     }
 
+    /*
+     * Update the preliminary message size and count fields with the actual
+     * values.
+     */
+    if (CLEANUP_OUT_OK(state))
+       cleanup_final(state);
+
     /*
      * If there was an error that requires us to generate a bounce message
      * (mail submitted with the Postfix sendmail command, mail forwarded by
index 60f0ab345e267dedeb2d97800cd4dda70decb596..33a4d30bbeba74ca3cc312e368aab18cf10c596e 100644 (file)
@@ -300,32 +300,4 @@ void    cleanup_extracted_finish(CLEANUP_STATE *state)
      * Terminate the extracted segment.
      */
     cleanup_out_string(state, REC_TYPE_END, "");
-
-    /*
-     * vstream_fseek() would flush the buffer anyway, but the code just reads
-     * better if we flush first, because it makes seek error handling more
-     * straightforward.
-     */
-    if (vstream_fflush(state->dst)) {
-       if (errno == EFBIG) {
-           msg_warn("%s: queue file size limit exceeded", state->queue_id);
-           state->errs |= CLEANUP_STAT_SIZE;
-       } else {
-           msg_warn("%s: write queue file: %m", state->queue_id);
-           state->errs |= CLEANUP_STAT_WRITE;
-       }
-       return;
-    }
-
-    /*
-     * Update the preliminary message size and count fields with the actual
-     * values.
-     */
-    if (vstream_fseek(state->dst, 0L, SEEK_SET) < 0)
-       msg_fatal("%s: vstream_fseek %s: %m", myname, cleanup_path);
-    cleanup_out_format(state, REC_TYPE_SIZE, REC_TYPE_SIZE_FORMAT,
-           (REC_TYPE_SIZE_CAST1) (state->xtra_offset - state->data_offset),
-                      (REC_TYPE_SIZE_CAST2) state->data_offset,
-                      (REC_TYPE_SIZE_CAST3) state->rcpt_count,
-                      (REC_TYPE_SIZE_CAST4) state->qmgr_opts);
 }
diff --git a/postfix/src/cleanup/cleanup_final.c b/postfix/src/cleanup/cleanup_final.c
new file mode 100644 (file)
index 0000000..701548d
--- /dev/null
@@ -0,0 +1,76 @@
+/*++
+/* NAME
+/*     cleanup_final 3
+/* SUMMARY
+/*     finalize queue file
+/* SYNOPSIS
+/*     #include "cleanup.h"
+/*
+/*     void    cleanup_final(state)
+/*     CLEANUP_STATE *state;
+/* DESCRIPTION
+/*     cleanup_final() performs final queue file content (not
+/*     attribute) updates so that the file is ready to be closed.
+/* 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 <errno.h>
+
+/* Utility library. */
+
+#include <msg.h>
+
+/* Global library. */
+
+#include <cleanup_user.h>
+#include <rec_type.h>
+
+/* Application-specific. */
+
+#include "cleanup.h"
+
+/* cleanup_final - final queue file content updates */
+
+void    cleanup_final(CLEANUP_STATE *state)
+{
+    const char *myname = "cleanup_final";
+
+    /*
+     * vstream_fseek() would flush the buffer anyway, but the code just reads
+     * better if we flush first, because it makes seek error handling more
+     * straightforward.
+     */
+    if (vstream_fflush(state->dst)) {
+       if (errno == EFBIG) {
+           msg_warn("%s: queue file size limit exceeded", state->queue_id);
+           state->errs |= CLEANUP_STAT_SIZE;
+       } else {
+           msg_warn("%s: write queue file: %m", state->queue_id);
+           state->errs |= CLEANUP_STAT_WRITE;
+       }
+       return;
+    }
+
+    /*
+     * Update the preliminary message size and count fields with the actual
+     * values.
+     */
+    if (vstream_fseek(state->dst, 0L, SEEK_SET) < 0)
+       msg_fatal("%s: vstream_fseek %s: %m", myname, cleanup_path);
+    cleanup_out_format(state, REC_TYPE_SIZE, REC_TYPE_SIZE_FORMAT,
+           (REC_TYPE_SIZE_CAST1) (state->xtra_offset - state->data_offset),
+                      (REC_TYPE_SIZE_CAST2) state->data_offset,
+                      (REC_TYPE_SIZE_CAST3) state->rcpt_count,
+                      (REC_TYPE_SIZE_CAST4) state->qmgr_opts);
+}
index 23adc69f65460e7ca1843b3eb5274a0aa4bad1a1..24d01bc3d5638485cf470b77ed584fefe763e888 100644 (file)
@@ -20,8 +20,8 @@
   * 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_VERSION_NUMBER    "2.3.15"
+#define MAIL_RELEASE_DATE      "20090103"
+#define MAIL_VERSION_NUMBER    "2.3.16"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index 1ed72d73bd58e7f39c2373c5ccceb5eb4e75f4f3..0eb989f18b8b729c8cb042e38ced7c16df13b7d7 100644 (file)
@@ -213,6 +213,11 @@ static SMTP_SESSION *smtp_reuse_common(SMTP_STATE *state, int fd,
        return (state->session = 0);
     }
 
+    /*
+     * Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE.
+     */
+    vstream_tweak_sock(session->stream);
+
     /*
      * Update the list of used cached addresses.
      */