]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4.7 v2.4.7
authorWietse Venema <wietse@porcupine.org>
Thu, 31 Jan 2008 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 20:20:43 +0000 (15:20 -0500)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/milter/milter8.c
postfix/src/oqmgr/qmgr_entry.c
postfix/src/pipe/pipe.c
postfix/src/qmgr/qmgr_entry.c
postfix/src/smtp/smtp_proto.c
postfix/src/util/vstream.c
postfix/src/xsasl/xsasl_dovecot_server.c

index b435cb177e482d083451bb8938be6f69a7f0065f..73db63f58c1f56ba96df7d7d19be88821128be36 100644 (file)
@@ -13562,3 +13562,40 @@ Apologies for any names omitted.
        for the per-destination logfile, to prevent an excessive
        rate of delivery attempts when the queue file system is
        mounted with "noatime".  File: flush/flush.c.
+
+20071030
+
+       Bugfix (introduced Postfix 2.3): Postfix mistakenly enforced
+       the 64kbyte limit (for sending body parts TO Milter
+       applications) also while receiving packets FROM Milter
+       applications.  The limit is now at least 1GB.  File:
+       milter/milter8.c.
+
+20071202
+
+       Bugfix (introduced Postfix 2.2): don't update the back-to-back
+       delivery time stamp while deferring mail. File: *qmgr/qmgr_entry.c.
+
+20071211
+
+       Bugfix (introduced 19980315): the "write" equivalent of
+       bugfix 20030104. File: util/vstream.c.
+
+20071213
+
+       Bugfix (introduced Postfix 2.3): the SMTP client never
+       marked corrupt files as corrupt. Victor Duchovni. File:
+       smtp/smtp_proto.c.
+
+20071229
+
+       Bugfix: the Milter client did not replace the Postfix-specific
+       form for unknown host names by the Sendmail-specific form.
+       File: milter/milter8.c.
+
+20080104
+
+       Workaround: minor change to the Dovecot AUTH request to
+       prevent dovecot-auth memory wastage. Timo Sirainen.  File:
+       xsasl/xsasl_dovecot_server.c.
+
index b6bf1907732582c3e625928d7c8b89047e7eee81..ae94ab9ee3eee99ddc659ee8a5d4798c9f73fd04 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      "20071017"
-#define MAIL_VERSION_NUMBER    "2.4.6"
+#define MAIL_RELEASE_DATE      "20080131"
+#define MAIL_VERSION_NUMBER    "2.4.7"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index 2a0dc75004c961c859cc3d41441f0ef154afe63b..27cba9738776d98e86b6ce251eae73240b790179 100644 (file)
@@ -63,6 +63,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
+#include <limits.h>                    /* INT_MAX */
 
 #ifndef SHUT_RDWR
 #define SHUT_RDWR      2
@@ -281,7 +282,7 @@ typedef struct {
  /*
   * We don't accept insane amounts of data.
   */
-#define XXX_MAX_DATA   (MILTER_CHUNK_SIZE * 2)
+#define XXX_MAX_DATA   (INT_MAX / 2)
 #define XXX_TIMEOUT    10
 
 #ifndef USE_LIBMILTER_INCLUDES
@@ -1682,6 +1683,17 @@ static const char *milter8_conn_event(MILTER *m,
     const char *myname = "milter8_conn_event";
     MILTER8 *milter = (MILTER8 *) m;
     int     port;
+    const char *sm_name;
+    char   *ptr = 0;
+    const char *resp;
+
+    /*
+     * Need a global definition for "unknown" host name or address that is
+     * shared by smtpd, cleanup and libmilter.
+     */
+#define XXX_UNKNOWN    "unknown"
+#define STR_EQ(x,y)    (strcmp((x), (y)) == 0)
+#define STR_NE(x,y)    (strcmp((x), (y)) != 0)
 
     /*
      * XXX Sendmail 8 libmilter closes the MTA-to-filter socket when it finds
@@ -1713,40 +1725,51 @@ static const char *milter8_conn_event(MILTER *m,
            port = 0;
        }
        milter->state = MILTER8_STAT_ENVELOPE;
+       /* Transform unknown hostname from Postfix to Sendmail form. */
+       sm_name = (STR_NE(client_name, XXX_UNKNOWN) ? client_name :
+                  STR_EQ(client_addr, XXX_UNKNOWN) ? client_name :
+                  (ptr = concatenate("[", client_addr, "]", (char *) 0)));
        switch (addr_family) {
        case AF_INET:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 DONT_SKIP_REPLY, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_INET,
-                                 MILTER8_DATA_NSHORT, htons(port),
-                                 MILTER8_DATA_STRING, client_addr,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                DONT_SKIP_REPLY, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_INET,
+                                MILTER8_DATA_NSHORT, htons(port),
+                                MILTER8_DATA_STRING, client_addr,
+                                MILTER8_DATA_END);
+           break;
 #ifdef HAS_IPV6
        case AF_INET6:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 DONT_SKIP_REPLY, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_INET6,
-                                 MILTER8_DATA_NSHORT, htons(port),
-                                 MILTER8_DATA_STRING, client_addr,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                DONT_SKIP_REPLY, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_INET6,
+                                MILTER8_DATA_NSHORT, htons(port),
+                                MILTER8_DATA_STRING, client_addr,
+                                MILTER8_DATA_END);
+           break;
 #endif
        case AF_UNIX:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 DONT_SKIP_REPLY, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_UNIX,
-                                 MILTER8_DATA_NSHORT, htons(0),
-                                 MILTER8_DATA_STRING, client_addr,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                DONT_SKIP_REPLY, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_UNIX,
+                                MILTER8_DATA_NSHORT, htons(0),
+                                MILTER8_DATA_STRING, client_addr,
+                                MILTER8_DATA_END);
+           break;
        default:
-           return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
-                                 DONT_SKIP_REPLY, macros,
-                                 MILTER8_DATA_STRING, client_name,
-                                 MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
-                                 MILTER8_DATA_END));
+           resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
+                                DONT_SKIP_REPLY, macros,
+                                MILTER8_DATA_STRING, sm_name,
+                                MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
+                                MILTER8_DATA_END);
+           break;
        }
+       if (ptr != 0)
+           myfree(ptr);
+       return (resp);
     default:
        msg_panic("%s: milter %s: bad state %d",
                  myname, milter->m.name, milter->state);
index fda4e5790e1f180abfcbf43c7a79073311dc0206..e2e6a80f699aa30fee44093557e77ee5355af7e0 100644 (file)
@@ -242,7 +242,8 @@ void    qmgr_entry_done(QMGR_ENTRY *entry, int which)
     /*
      * Maintain back-to-back delivery status.
      */
-    queue->last_done = event_time();
+    if (which == QMGR_QUEUE_BUSY)
+       queue->last_done = event_time();
 
     /*
      * When the in-core queue for this site is empty and when this site is
index d56584ca7b077e0c12f4d8927ff7319a746a515e..6cff6b2a77d6f004505d363517f722ef32109775 100644 (file)
@@ -848,7 +848,7 @@ static void get_service_attr(PIPE_ATTR *attr, char **argv)
        /*
         * null_sender=string
         */
-       else if (strncasecmp("null_sender=", *argv, sizeof("eol=") - 1) == 0) {
+       else if (strncasecmp("null_sender=", *argv, sizeof("null_sender=") - 1) == 0) {
            vstring_strcpy(attr->null_sender, *argv + sizeof("null_sender=") - 1);
        }
 
index 6e4477be442cd8e274ac726aedd0118fa44fff8b..b5f0ae321b23abc0caffe135c99451cfb3b90dcb 100644 (file)
@@ -334,7 +334,8 @@ void    qmgr_entry_done(QMGR_ENTRY *entry, int which)
     /*
      * Maintain back-to-back delivery status.
      */
-    queue->last_done = event_time();
+    if (which == QMGR_QUEUE_BUSY)
+       queue->last_done = event_time();
 
     /*
      * When the in-core queue for this site is empty and when this site is
index 2d1a12c5fe3f5c64cb9226456023b47a153e7d66..00461f36e6be2fa7a531dcf0ca3b7d4e12c96b16 100644 (file)
@@ -1769,7 +1769,7 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
                    fail_status = smtp_mesg_fail(state, DSN_BY_LOCAL_MTA,
                                             SMTP_RESP_FAKE(&fake, "5.3.0"),
                                             "unreadable mail queue entry");
-                   if (fail_status == 0)
+                   if (state->status == 0)
                        (void) mark_corrupt(state->src);
                    RETURN(fail_status);
                }
index ba94a1ce541ed31a008685942e9ad1d5735a0a9f..75b035984ae42f34a8e346a92a83c97e37ad1352 100644 (file)
@@ -494,6 +494,7 @@ static void vstream_buf_init(VBUF *bp, int flags)
 
 static void vstream_buf_alloc(VBUF *bp, ssize_t len)
 {
+    VSTREAM *stream = VBUF_TO_APPL(bp, VSTREAM, buf);
     ssize_t used = bp->ptr - bp->data;
     const char *myname = "vstream_buf_alloc";
 
@@ -509,10 +510,15 @@ static void vstream_buf_alloc(VBUF *bp, ssize_t len)
     bp->data = (unsigned char *)
        (bp->data ? myrealloc((char *) bp->data, len) : mymalloc(len));
     bp->len = len;
-    if (bp->flags & VSTREAM_FLAG_READ)
+    if (bp->flags & VSTREAM_FLAG_READ) {
        bp->ptr = bp->data + used;
-    else
+       if (bp->flags & VSTREAM_FLAG_DOUBLE)
+           VSTREAM_SAVE_STATE(stream, read_buf, read_fd);
+    } else {
        VSTREAM_BUF_AT_OFFSET(bp, used);
+       if (bp->flags & VSTREAM_FLAG_DOUBLE)
+           VSTREAM_SAVE_STATE(stream, write_buf, write_fd);
+    }
 }
 
 /* vstream_buf_wipe - reset buffer to initial state */
@@ -680,11 +686,8 @@ static int vstream_buf_get_ready(VBUF *bp)
      * allocation gives the application a chance to override the default
      * buffering policy.
      */
-    if (bp->data == 0) {
+    if (bp->data == 0)
        vstream_buf_alloc(bp, VSTREAM_BUFSIZE);
-       if (bp->flags & VSTREAM_FLAG_DOUBLE)
-           VSTREAM_SAVE_STATE(stream, read_buf, read_fd);
-    }
 
     /*
      * If the stream is double-buffered and the write buffer is not empty,
index 47b6bc98479cc107e0f640e8c3a82cabec6f9df9..817dde73c21371a5827f17b620922a3a2490b50e 100644 (file)
@@ -453,7 +453,7 @@ int     xsasl_dovecot_server_first(XSASL_SERVER *xp, const char *sasl_method,
        /* send the request */
        server->last_request_id = ++server->impl->request_id_counter;
        vstream_fprintf(server->impl->sasl_stream,
-                       "AUTH\t%u\t%s\tservice=%s",
+                       "AUTH\t%u\t%s\tservice=%s\tnologin",
                        server->last_request_id, sasl_method,
                        server->service);
        if (init_response) {