]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.4-20180401
authorWietse Venema <wietse@porcupine.org>
Sun, 1 Apr 2018 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Wed, 4 Apr 2018 17:17:04 +0000 (13:17 -0400)
postfix/HISTORY
postfix/makedefs
postfix/src/global/dict_mysql.c
postfix/src/global/mail_version.h
postfix/src/local/Makefile.in
postfix/src/local/unknown.c
postfix/src/postconf/extract_cfg.sh
postfix/src/util/sys_defs.h

index 21af1dbc570da6a979be4967428a0a151f3cf3dd..165e75670510ed95559919482e5ce5588b083c95 100644 (file)
@@ -23342,3 +23342,24 @@ Apologies for any names omitted.
        built-in or service-defined parameters for ldap, *sql, etc.
        database names. Problem reported by Christian Rößner. Files:
        postconf/postconf_user.c.
+
+20180224
+
+       Workaround: postconf build did not abort if the m4 command
+       is not installed (on a system that does have the make command,
+       the awk command, the perl command, and the C compiler?!).
+       File: postconf/extract_cfg.sh.
+
+20180303
+
+       Portability: slight differences between MySQL and MariaDB.
+       Olli Hauer. File: global/dict_mysql.c.
+
+20180306
+
+       Bugfix (introduced: 19990302): when luser_relay specifies
+       a non-existent local address, the luser_relay feature becomes
+       a black hole. Reported by Jørgen Thomsen. File: local/unknown.c.
+
+       Portability: FreeBSD 11 is supported. Files: makedefs,
+       util/sys_defs.h.
index 4e2952b455f43c1a6565636e45505f90d0fd0a47..5449732b09a57c45c9a027bc08208cd05f39f26f 100644 (file)
@@ -287,6 +287,15 @@ case "$SYSTEM.$RELEASE" in
                : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
                : ${PLUGIN_LD="${CC} -shared"}
                ;;
+   FreeBSD.11*) SYSTYPE=FREEBSD11
+               : ${CC=cc}
+               : ${SHLIB_SUFFIX=.so}
+               : ${SHLIB_CFLAGS=-fPIC}
+               : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'}
+               : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
+               : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
+               : ${PLUGIN_LD="${CC} -shared"}
+               ;;
  DragonFly.*)  SYSTYPE=DRAGONFLY
                ;;
   OpenBSD.2*)  SYSTYPE=OPENBSD2
index 3a31a7e9ac9513859d52004f501a132ee2322809..77adb42a4907b80f8c7be04bf1e229930a57852f 100644 (file)
 
 #include "dict_mysql.h"
 
+/* MySQL 8.x API change */
+
+#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50023
+#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT
+#elif MYSQL_VERSION_ID >= 80000
+#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_MODE
+#endif
+
 /* need some structs to help organize things */
 typedef struct {
     MYSQL  *db;
@@ -237,7 +245,7 @@ typedef struct {
     char   *tls_CAfile;
     char   *tls_CApath;
     char   *tls_ciphers;
-#if MYSQL_VERSION_ID >= 50023
+#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
     int     tls_verify_cert;
 #endif
 #endif
@@ -656,9 +664,9 @@ static void plmysql_connect_single(DICT_MYSQL *dict_mysql, HOST *host)
                      dict_mysql->tls_key_file, dict_mysql->tls_cert_file,
                      dict_mysql->tls_CAfile, dict_mysql->tls_CApath,
                      dict_mysql->tls_ciphers);
-#if MYSQL_VERSION_ID >= 50023
+#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
     if (dict_mysql->tls_verify_cert != -1)
-       mysql_options(host->db, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+       mysql_options(host->db, DICT_MYSQL_SSL_VERIFY_SERVER_CERT,
                      &dict_mysql->tls_verify_cert);
 #endif
 #endif
@@ -723,7 +731,7 @@ static void mysql_parse_config(DICT_MYSQL *dict_mysql, const char *mysqlcf)
     dict_mysql->tls_CAfile = cfg_get_str(p, "tls_CAfile", NULL, 0, 0);
     dict_mysql->tls_CApath = cfg_get_str(p, "tls_CApath", NULL, 0, 0);
     dict_mysql->tls_ciphers = cfg_get_str(p, "tls_ciphers", NULL, 0, 0);
-#if MYSQL_VERSION_ID >= 50023
+#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
     dict_mysql->tls_verify_cert = cfg_get_bool(p, "tls_verify_cert", -1);
 #endif
 #endif
index 601f09a17574687dddf2574e073c55e205cf5bf8..e636521618a6b70b17f6354a5cda1e9175dc76fa 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      "20180222"
+#define MAIL_RELEASE_DATE      "20180401"
 #define MAIL_VERSION_NUMBER    "3.4"
 
 #ifdef SNAPSHOT
index a1f6816025afcea6be83736fd51cc3a3aad99f05..648ad5133c9d6a56e16310e18ab0acc5738cce0d 100644 (file)
@@ -651,6 +651,7 @@ unknown.o: ../../include/argv.h
 unknown.o: ../../include/attr.h
 unknown.o: ../../include/been_here.h
 unknown.o: ../../include/bounce.h
+unknown.o: ../../include/canon_addr.h
 unknown.o: ../../include/check_arg.h
 unknown.o: ../../include/defer.h
 unknown.o: ../../include/deliver_pass.h
index 733aa1350dbf00fb85048bbf1719b28b2ab9df3a..c97cef39bf1557c17614e32e12f0b5608385b7b4 100644 (file)
 #include <sent.h>
 #include <deliver_pass.h>
 #include <defer.h>
+#include <canon_addr.h>
 
 /* Application-specific. */
 
 #include "local.h"
 
+#define STREQ(x,y) (strcasecmp((x),(y)) == 0)
+
 /* deliver_unknown - delivery for unknown recipients */
 
 int     deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr)
@@ -85,6 +88,7 @@ int     deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr)
     const char *myname = "deliver_unknown";
     int     status;
     VSTRING *expand_luser;
+    VSTRING *canon_luser;
     static MAPS *transp_maps;
     const char *map_transport;
 
@@ -139,8 +143,20 @@ int     deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr)
     if (*var_luser_relay) {
        state.msg_attr.unmatched = 0;
        expand_luser = vstring_alloc(100);
+       canon_luser = vstring_alloc(100);
        local_expand(expand_luser, var_luser_relay, &state, &usr_attr, (void *) 0);
-       status = deliver_resolve_addr(state, usr_attr, STR(expand_luser));
+       /* In case luser_relay specifies a domain-less address. */
+       canon_addr_external(canon_luser, vstring_str(expand_luser));
+       /* Assumes that the address resolver won't change the address. */
+       if (STREQ(vstring_str(canon_luser), state.msg_attr.rcpt.address)) {
+           dsb_simple(state.msg_attr.why, "5.1.1",
+                      "unknown user: \"%s\"", state.msg_attr.user);
+           status = bounce_append(BOUNCE_FLAGS(state.request),
+                                  BOUNCE_ATTR(state.msg_attr));
+       } else {
+           status = deliver_resolve_addr(state, usr_attr, STR(expand_luser));
+       }
+       vstring_free(canon_luser);
        vstring_free(expand_luser);
        return (status);
     }
@@ -149,8 +165,6 @@ int     deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr)
      * If no alias was found for a required reserved name, toss the message
      * into the bit bucket, and issue a warning instead.
      */
-#define STREQ(x,y) (strcasecmp(x,y) == 0)
-
     if (STREQ(state.msg_attr.user, MAIL_ADDR_MAIL_DAEMON)
        || STREQ(state.msg_attr.user, MAIL_ADDR_POSTMASTER)) {
        msg_warn("required alias not found: %s", state.msg_attr.user);
index d2faf98ab1ae1b88bd94e65a3d20a996d7e6c6fc..5901e951410221cf339f5f5508b0dbfae1335d45 100644 (file)
@@ -38,6 +38,9 @@
 #      New York, NY 10011, USA
 #--
 
+# In case not installed.
+m4 </dev/null || exit 1
+
 # Flags to add db_common parameter names.
 add_legacy_sql_query_params=
 add_domain_param=
index f4f53300f317383621abd2299de544ad19ed26c2..a8d25712630a576a1bff5a7efb2550cd90118645 100644 (file)
@@ -30,6 +30,7 @@
 #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \
     || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \
     || defined(FREEBSD8) || defined(FREEBSD9) || defined(FREEBSD10) \
+    || defined(FREEBSD11) \
     || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \
     || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \
     || defined(OPENBSD5) || defined(OPENBSD6) \