]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.5.14 v2.5.14
authorWietse Venema <wietse@porcupine.org>
Thu, 7 Jul 2011 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 19:57:40 +0000 (14:57 -0500)
13 files changed:
postfix/HISTORY
postfix/makedefs
postfix/postfix-install
postfix/src/global/abounce.c
postfix/src/global/abounce.h
postfix/src/global/mail_version.h
postfix/src/local/mailbox.c
postfix/src/local/unknown.c
postfix/src/milter/milter8.c
postfix/src/oqmgr/qmgr_active.c
postfix/src/qmgr/qmgr_active.c
postfix/src/smtpd/smtpd_check.c
postfix/src/util/sys_defs.h

index 193f8fe228ba631c530f7b6a63e47468b46e3a98..db434c13fa39468625d74d38473611a230cc7d48 100644 (file)
@@ -14685,3 +14685,39 @@ Apologies for any names omitted.
         reuse a server SASL handle after authentication failure.
         Problem reported by Thomas Jarosch of Intra2net AG. File:
         smtpd/smtpd_proto.c.
+
+20110418
+
+       Bugfix (introduced Postfix 2.3): the Milter client reported
+       some "file too large" errors as temporary errors. Problem
+       reported by Michael Tokarev. File: milter/milter8.c.
+
+20110420
+
+       Performance: a high load of DSN success notification requests
+       could slow down the queue manager. Solution: make the trace
+       client asynchronous, just like the bounce and defer clients.
+       Problem reported by Eduardo M. Stelmaszczyk of terra.com.br.
+       Files: global/abounce.[hc], *qmgr/qmgr_active.c (the
+       qmgr_active.c files are identical).
+
+20110426
+
+       Bugfix (introduced in Postfix 1.1): the local(8) delivery
+       agent ignored table lookup errors in mailbox_command_maps,
+       mailbox_transport_maps, and fallback_transport_maps. Problem
+       reported by William Ono. Files: local/command.c, local/mailbox.c,
+       local/unknown.c.
+
+20110614
+
+       Linux kernel version 3 support. Linus Torvalds has reset
+       the counters for reasons not related to changes in code.
+       Files: makedefs, util/sys_defs.h.
+
+20110615
+
+       Workaround: some Spamhaus RHSBL rejects lookups with "No
+       IP queries" even if the name has an alphanumerical prefix.
+       We play safe, and skip RHSBL queries for names ending in a
+       numerical suffix.  File: smtpd/smtpd_check.c.
index 51e094d3d3a9269605089ba4f1ce7c39094f7787..8212b66e8fef67c4701ee640bbfcd00266211203 100644 (file)
@@ -319,6 +319,33 @@ EOF
                rm -f makedefs.test makedefs.test.o makedefs.test.c;;
                esac
                ;;
+    Linux.3*)  SYSTYPE=LINUX3
+               if [ -f /usr/include/db.h ]
+               then
+                   : we are all set
+               elif [ -f /usr/include/db/db.h ]
+               then
+                   CCARGS="$CCARGS -I/usr/include/db"
+               else
+                   # On a properly installed system, Postfix builds
+                   # by including <db.h> and by linking with -ldb
+                   echo "No <db.h> include file found." 1>&2
+                   echo "Install the appropriate db*-devel package first." 1>&2
+                   echo "See the RELEASE_NOTES file for more information." 1>&2
+                   exit 1
+               fi
+               SYSLIBS="-ldb"
+               for name in nsl resolv
+               do
+                   for lib in /usr/lib64 /lib64 /usr/lib /lib
+                   do
+                       test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
+                           SYSLIBS="$SYSLIBS -l$name"
+                           break
+                       }
+                   done
+               done
+               ;;
      GNU.0*|GNU/kFreeBSD.[567]*)
                SYSTYPE=GNU0
                # Postfix no longer needs DB 1.85 compatibility
index b8286a5d46d67ebad0c9cf91588b60827f59c965..b7742cb7903adac938090c608f115240e1a29e0d 100644 (file)
@@ -305,7 +305,7 @@ esac
 
 install_root_prompt="the prefix for installed file names. Specify
 this ONLY if you are building ready-to-install packages for
-distribution to other machines."
+distribution to OTHER machines. See PACKAGE_README for instructions."
 
 tempdir_prompt="a directory for scratch files while installing
 Postfix.  You must have write permission in this directory."
index 8c31694265aebbab6f26e49cff91f31f97684e8c..105b9f6b8b5cf252fd46cfb9a1791a7a95130cae 100644 (file)
 /*     int     dsn_ret;
 /*     void    (*callback)(int status, char *context);
 /*     char    *context;
+/*
+/*     void    atrace_flush(flags, queue, id, encoding, sender,
+/*                             dsn_envid, dsn_ret, callback, context)
+/*     int     flags;
+/*     const char *queue;
+/*     const char *id;
+/*     const char *encoding;
+/*     const char *sender;
+/*     const char *dsn_envid;
+/*     int     dsn_ret;
+/*     void    (*callback)(int status, char *context);
+/*     char    *context;
 /* DESCRIPTION
 /*     This module implements an asynchronous interface to the
-/*     bounce/defer service for submitting sender notifications
+/*     bounce/defer/trace service for submitting sender notifications
 /*     without waiting for completion of the request.
 /*
 /*     abounce_flush() bounces the specified message to
 /*     the specified sender, including the defer log that was
 /*     built with defer_append().
 /*
+/*     atrace_flush() returns the specified message to the specified
+/*     sender, including the message delivery record log that was
+/*     built with vtrace_append().
+/*
 /*     Arguments:
 /* .IP flags
 /*     The bitwise OR of zero or more of the following (specify
@@ -359,3 +375,15 @@ void    adefer_warn(int flags, const char *queue, const char *id,
                    flags, queue, id, encoding, sender, dsn_envid, dsn_ret,
                    callback, context);
 }
+
+/* atrace_flush - asynchronous trace flush */
+
+void    atrace_flush(int flags, const char *queue, const char *id,
+                            const char *encoding, const char *sender,
+                            const char *dsn_envid, int dsn_ret,
+                            ABOUNCE_FN callback, char *context)
+{
+    abounce_request(MAIL_CLASS_PRIVATE, var_trace_service, BOUNCE_CMD_TRACE,
+                   flags, queue, id, encoding, sender, dsn_envid, dsn_ret,
+                   callback, context);
+}
index 521499cf38e04ec6af790c95d4e386c2c7deb789..dc4264b6b871efff7e87b45aa02ee82d2754e2a8 100644 (file)
@@ -24,6 +24,7 @@ typedef void (*ABOUNCE_FN) (int, char *);
 extern void abounce_flush(int, const char *, const char *, const char *, const char *, const char *, int, ABOUNCE_FN, char *);
 extern void adefer_flush(int, const char *, const char *, const char *, const char *, const char *, int, ABOUNCE_FN, char *);
 extern void adefer_warn(int, const char *, const char *, const char *, const char *, const char *, int, ABOUNCE_FN, char *);
+extern void atrace_flush(int, const char *, const char *, const char *, const char *, const char *, int, ABOUNCE_FN, char *);
 
 extern void abounce_flush_verp(int, const char *, const char *, const char *, const char *, const char *, int, const char *, ABOUNCE_FN, char *);
 extern void adefer_flush_verp(int, const char *, const char *, const char *, const char *, const char *, int, const char *, ABOUNCE_FN, char *);
index bbc2e9eadf95a558cce39a17ed53d8aa5195767a..4d11674beb3ca0af3491273881acff43bfa6591d 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      "20110509"
-#define MAIL_VERSION_NUMBER    "2.5.13"
+#define MAIL_RELEASE_DATE      "20110707"
+#define MAIL_VERSION_NUMBER    "2.5.14"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index d35ef66b4cf33f5b6564135c96f325ecd5cb333f..58b01f79f2fb8f14fdab84ccf42ed893d9d66302 100644 (file)
@@ -278,6 +278,7 @@ int     deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
        transp_maps = maps_create(VAR_MBOX_TRANSP_MAPS, var_mbox_transp_maps,
                                  DICT_FLAG_LOCK | DICT_FLAG_NO_REGSUB);
     /* The -1 is a hint for the down-stream deliver_completed() function. */
+    dict_errno = 0;
     if (*var_mbox_transp_maps
        && (map_transport = maps_find(transp_maps, state.msg_attr.user,
                                      DICT_FLAG_NONE)) != 0) {
@@ -285,6 +286,11 @@ int     deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
        *statusp = deliver_pass(MAIL_CLASS_PRIVATE, map_transport,
                                state.request, &state.msg_attr.rcpt);
        return (YES);
+    } else if (dict_errno != 0) {
+       /* Details in the logfile. */
+       dsb_simple(state.msg_attr.why, "4.3.0", "table lookup failure");
+       *statusp = DEL_STAT_DEFER;
+       return (YES);
     }
     if (*var_mailbox_transport) {
        state.msg_attr.rcpt.offset = -1L;
@@ -319,10 +325,15 @@ int     deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
        cmd_maps = maps_create(VAR_MAILBOX_CMD_MAPS, var_mailbox_cmd_maps,
                               DICT_FLAG_LOCK | DICT_FLAG_PARANOID);
 
+    dict_errno = 0;
     if (*var_mailbox_cmd_maps
        && (map_command = maps_find(cmd_maps, state.msg_attr.user,
                                    DICT_FLAG_NONE)) != 0) {
        status = deliver_command(state, usr_attr, map_command);
+    } else if (dict_errno != 0) {
+       /* Details in the logfile. */
+       dsb_simple(state.msg_attr.why, "4.3.0", "table lookup failure");
+       status = DEL_STAT_DEFER;
     } else if (*var_mailbox_command) {
        status = deliver_command(state, usr_attr, var_mailbox_command);
     } else if (*var_home_mailbox && LAST_CHAR(var_home_mailbox) == '/') {
index 068f9eed2683ca44e59e069861112e9a2e5c42e8..eb5bbf25054ef29e75512f0b08d0dd60b59c0e01 100644 (file)
@@ -110,12 +110,17 @@ int     deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr)
        transp_maps = maps_create(VAR_FBCK_TRANSP_MAPS, var_fbck_transp_maps,
                                  DICT_FLAG_LOCK | DICT_FLAG_NO_REGSUB);
     /* The -1 is a hint for the down-stream deliver_completed() function. */
+    dict_errno = 0;
     if (*var_fbck_transp_maps
        && (map_transport = maps_find(transp_maps, state.msg_attr.user,
                                      DICT_FLAG_NONE)) != 0) {
        state.msg_attr.rcpt.offset = -1L;
        return (deliver_pass(MAIL_CLASS_PRIVATE, map_transport,
                             state.request, &state.msg_attr.rcpt));
+    } else if (dict_errno != 0) {
+       /* Details in the logfile. */
+       dsb_simple(state.msg_attr.why, "4.3.0", "table lookup failure");
+       return (DEL_STAT_DEFER);
     }
     if (*var_fallback_transport) {
        state.msg_attr.rcpt.offset = -1L;
index b139636027424e37816923dfa59379c98f9d384f..aa1a75c7ebc0c30870e621a8a54dd577aecd5b67 100644 (file)
@@ -2406,6 +2406,7 @@ static const char *milter8_message(MILTER *m, VSTREAM *qfile,
     int     mime_errs = 0;
     MILTER_MSG_CONTEXT msg_ctx;
     VSTRING *buf;
+    int     saved_errno;
 
     switch (milter->state) {
     case MILTER8_STAT_ERROR:
@@ -2419,8 +2420,12 @@ static const char *milter8_message(MILTER *m, VSTREAM *qfile,
        if (msg_verbose)
            msg_info("%s: message to milter %s", myname, milter->m.name);
        if (vstream_fseek(qfile, data_offset, SEEK_SET) < 0) {
+           saved_errno = errno;
            msg_warn("%s: vstream_fseek %s: %m", myname, VSTREAM_PATH(qfile));
-           return ("450 4.3.0 Queue file write error");
+           /* XXX This should be available from cleanup_strerror.c. */
+           return (saved_errno == EFBIG ?
+                   "552 5.3.4 Message file too big" :
+                   "451 4.3.0 Queue file write error");
        }
        msg_ctx.milter = milter;
        msg_ctx.eoh_macros = eoh_macros;
index eeec88d3b40d81dbc4f57d157af5db7bd799dd70..eea9d71d0c6c3e1604736ef2fcd1a2320d745583 100644 (file)
   */
 static void qmgr_active_done_2_bounce_flush(int, char *);
 static void qmgr_active_done_2_generic(QMGR_MESSAGE *);
+static void qmgr_active_done_25_trace_flush(int, char *);
+static void qmgr_active_done_25_generic(QMGR_MESSAGE *);
 static void qmgr_active_done_3_defer_flush(int, char *);
 static void qmgr_active_done_3_defer_warn(int, char *);
 static void qmgr_active_done_3_generic(QMGR_MESSAGE *);
@@ -336,10 +338,8 @@ static void qmgr_active_done_2_bounce_flush(int status, char *context)
 
 static void qmgr_active_done_2_generic(QMGR_MESSAGE *message)
 {
-    const char *myname = "qmgr_active_done_2_generic";
     const char *path;
     struct stat st;
-    int     status;
 
     /*
      * A delivery agent marks a queue file as corrupt by changing its
@@ -372,10 +372,6 @@ static void qmgr_active_done_2_generic(QMGR_MESSAGE *message)
     }
 
     /*
-     * As a temporary implementation, synchronously inform the sender of
-     * trace information. This will block for 10 seconds when the qmgr FIFO
-     * is full.
-     * 
      * XXX With multi-recipient mail, some recipients may have NOTIFY=SUCCESS
      * and others not. Depending on what subset of recipients are delivered,
      * a trace file may or may not be created. Even when the last partial
@@ -388,18 +384,45 @@ static void qmgr_active_done_2_generic(QMGR_MESSAGE *message)
      */
     if ((message->tflags & (DEL_REQ_FLAG_USR_VRFY | DEL_REQ_FLAG_RECORD))
        || (message->rflags & QMGR_READ_FLAG_NOTIFY_SUCCESS)) {
-       status = trace_flush(message->tflags,
-                            message->queue_name,
-                            message->queue_id,
-                            message->encoding,
-                            message->sender,
-                            message->dsn_envid,
-                            message->dsn_ret);
-       if (status == 0 && message->tflags_offset)
-           qmgr_message_kill_record(message, message->tflags_offset);
-       message->flags |= status;
+       atrace_flush(message->tflags,
+                    message->queue_name,
+                    message->queue_id,
+                    message->encoding,
+                    message->sender,
+                    message->dsn_envid,
+                    message->dsn_ret,
+                    qmgr_active_done_25_trace_flush,
+                    (char *) message);
+       return;
     }
 
+    /*
+     * Asynchronous processing does not reach this point.
+     */
+    qmgr_active_done_25_generic(message);
+}
+
+/* qmgr_active_done_25_trace_flush - continue after atrace_flush() completion */
+
+static void qmgr_active_done_25_trace_flush(int status, char *context)
+{
+    QMGR_MESSAGE *message = (QMGR_MESSAGE *) context;
+
+    /*
+     * Process atrace_flush() status and continue processing.
+     */
+    if (status == 0 && message->tflags_offset)
+       qmgr_message_kill_record(message, message->tflags_offset);
+    message->flags |= status;
+    qmgr_active_done_25_generic(message);
+}
+
+/* qmgr_active_done_25_generic - continue processing */
+
+static void qmgr_active_done_25_generic(QMGR_MESSAGE *message)
+{
+    const char *myname = "qmgr_active_done_25_generic";
+
     /*
      * If we get to this point we have tried all recipients for this message.
      * If the message is too old, try to bounce it.
index eeec88d3b40d81dbc4f57d157af5db7bd799dd70..eea9d71d0c6c3e1604736ef2fcd1a2320d745583 100644 (file)
   */
 static void qmgr_active_done_2_bounce_flush(int, char *);
 static void qmgr_active_done_2_generic(QMGR_MESSAGE *);
+static void qmgr_active_done_25_trace_flush(int, char *);
+static void qmgr_active_done_25_generic(QMGR_MESSAGE *);
 static void qmgr_active_done_3_defer_flush(int, char *);
 static void qmgr_active_done_3_defer_warn(int, char *);
 static void qmgr_active_done_3_generic(QMGR_MESSAGE *);
@@ -336,10 +338,8 @@ static void qmgr_active_done_2_bounce_flush(int status, char *context)
 
 static void qmgr_active_done_2_generic(QMGR_MESSAGE *message)
 {
-    const char *myname = "qmgr_active_done_2_generic";
     const char *path;
     struct stat st;
-    int     status;
 
     /*
      * A delivery agent marks a queue file as corrupt by changing its
@@ -372,10 +372,6 @@ static void qmgr_active_done_2_generic(QMGR_MESSAGE *message)
     }
 
     /*
-     * As a temporary implementation, synchronously inform the sender of
-     * trace information. This will block for 10 seconds when the qmgr FIFO
-     * is full.
-     * 
      * XXX With multi-recipient mail, some recipients may have NOTIFY=SUCCESS
      * and others not. Depending on what subset of recipients are delivered,
      * a trace file may or may not be created. Even when the last partial
@@ -388,18 +384,45 @@ static void qmgr_active_done_2_generic(QMGR_MESSAGE *message)
      */
     if ((message->tflags & (DEL_REQ_FLAG_USR_VRFY | DEL_REQ_FLAG_RECORD))
        || (message->rflags & QMGR_READ_FLAG_NOTIFY_SUCCESS)) {
-       status = trace_flush(message->tflags,
-                            message->queue_name,
-                            message->queue_id,
-                            message->encoding,
-                            message->sender,
-                            message->dsn_envid,
-                            message->dsn_ret);
-       if (status == 0 && message->tflags_offset)
-           qmgr_message_kill_record(message, message->tflags_offset);
-       message->flags |= status;
+       atrace_flush(message->tflags,
+                    message->queue_name,
+                    message->queue_id,
+                    message->encoding,
+                    message->sender,
+                    message->dsn_envid,
+                    message->dsn_ret,
+                    qmgr_active_done_25_trace_flush,
+                    (char *) message);
+       return;
     }
 
+    /*
+     * Asynchronous processing does not reach this point.
+     */
+    qmgr_active_done_25_generic(message);
+}
+
+/* qmgr_active_done_25_trace_flush - continue after atrace_flush() completion */
+
+static void qmgr_active_done_25_trace_flush(int status, char *context)
+{
+    QMGR_MESSAGE *message = (QMGR_MESSAGE *) context;
+
+    /*
+     * Process atrace_flush() status and continue processing.
+     */
+    if (status == 0 && message->tflags_offset)
+       qmgr_message_kill_record(message, message->tflags_offset);
+    message->flags |= status;
+    qmgr_active_done_25_generic(message);
+}
+
+/* qmgr_active_done_25_generic - continue processing */
+
+static void qmgr_active_done_25_generic(QMGR_MESSAGE *message)
+{
+    const char *myname = "qmgr_active_done_25_generic";
+
     /*
      * If we get to this point we have tried all recipients for this message.
      * If the message is too old, try to bounce it.
index d890054e0f44bcafd627410ba929ad81d5718665..932e704196d6e87c47c0a383537163df8012e924 100644 (file)
@@ -3176,6 +3176,7 @@ static int reject_rbl_domain(SMTPD_STATE *state, const char *rbl_domain,
     SMTPD_RBL_STATE *rbl;
     const char *domain;
     const char *reply_addr;
+    const char *suffix;
 
     if (msg_verbose)
        msg_info("%s: %s %s", myname, reply_class, what);
@@ -3190,7 +3191,16 @@ static int reject_rbl_domain(SMTPD_STATE *state, const char *rbl_domain,
            return (SMTPD_CHECK_DUNNO);
     } else
        domain = what;
-    if (domain[0] == 0)
+
+    /*
+     * XXX Some Spamhaus RHSBL rejects lookups with "No IP queries" even if
+     * the name has an alphanumerical prefix. We play safe, and skip RHSBL
+     * queries for names ending in a numerical suffix.
+     */
+    if (domain[0] == 0 || valid_hostname(domain, DONT_GRIPE) == 0)
+       return (SMTPD_CHECK_DUNNO);
+    suffix = strrchr(domain, '.');
+    if (alldig(suffix == 0 ? domain : suffix + 1))
        return (SMTPD_CHECK_DUNNO);
 
     query = vstring_alloc(100);
@@ -3702,8 +3712,7 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions,
                         name);
            else {
                cpp += 1;
-               if (state->helo_name
-                   && valid_hostname(state->helo_name, DONT_GRIPE))
+               if (state->helo_name)
                    status = reject_rbl_domain(state, *cpp, state->helo_name,
                                               SMTPD_NAME_HELO);
            }
index e1ab6b701b06db4bf8938e8e2bca9cbb5cc09d52..e2028850e494431aea725a448d12e68c84f94c5f 100644 (file)
@@ -696,7 +696,7 @@ extern int initgroups(const char *, int);
  /*
   * LINUX.
   */
-#ifdef LINUX2
+#if defined(LINUX2) || defined(LINUX3)
 #define SUPPORTED
 #include <sys/types.h>
 #define UINT32_TYPE    unsigned int