From 3d123ac94a9005e87403c83b1f169b595547ece2 Mon Sep 17 00:00:00 2001
From: Wietse Venema
If your Berkeley DB shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-ldb".
+Solaris needs this:
diff --git a/postfix/html/LDAP_README.html b/postfix/html/LDAP_README.html index e2f1bd23f..fae15b914 100644 --- a/postfix/html/LDAP_README.html +++ b/postfix/html/LDAP_README.html @@ -96,6 +96,10 @@ your Postfix source tree should work:+
If your LDAP shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lldap".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_LDAP. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded LDAP database client, but only the new diff --git a/postfix/html/LMDB_README.html b/postfix/html/LMDB_README.html index 3ac031cc5..caf554304 100644 --- a/postfix/html/LMDB_README.html +++ b/postfix/html/LMDB_README.html @@ -55,6 +55,10 @@ build Postfix with LMDB support, use something like:
+If your LMDB shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-llmdb".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_LMDB. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded LMDB database client, but only the new diff --git a/postfix/html/MYSQL_README.html b/postfix/html/MYSQL_README.html index 48622cfd3..8ac3826e4 100644 --- a/postfix/html/MYSQL_README.html +++ b/postfix/html/MYSQL_README.html @@ -62,6 +62,10 @@ make -f Makefile.init makefiles \ +
If your MySQL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lmysqlclient".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_MYSQL. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded MySQL database client, but only the new diff --git a/postfix/html/PGSQL_README.html b/postfix/html/PGSQL_README.html index cb9c8a5cc..98741395a 100644 --- a/postfix/html/PGSQL_README.html +++ b/postfix/html/PGSQL_README.html @@ -57,6 +57,10 @@ the location of the libpq library file.
+If your PostgreSQL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lpq".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_PGSQL. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded PostgreSQL database client, but only diff --git a/postfix/html/SASL_README.html b/postfix/html/SASL_README.html index 1f4bfdf4a..8fe305110 100644 --- a/postfix/html/SASL_README.html +++ b/postfix/html/SASL_README.html @@ -2127,6 +2127,10 @@ definitions:
-I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib -lsasl2" +If your Cyrus SASL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lsasl2".
+If your SQLite shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lsqlite3".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_SQLITE. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded SQLite database client, but only the new diff --git a/postfix/html/TLS_README.html b/postfix/html/TLS_README.html index 4c8762f80..248b5e2e4 100644 --- a/postfix/html/TLS_README.html +++ b/postfix/html/TLS_README.html @@ -3182,6 +3182,10 @@ are in directory /usr/local/lib:
+If your OpenSSL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lcrypto".
+On Solaris, specify the -R option as shown below:
diff --git a/postfix/proto/DB_README.html b/postfix/proto/DB_README.html index 79c04a5e2..cca3e2b62 100644 --- a/postfix/proto/DB_README.html +++ b/postfix/proto/DB_README.html @@ -100,6 +100,10 @@ source code, use something like:+
If your Berkeley DB shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-ldb".
+Solaris needs this:
diff --git a/postfix/proto/LDAP_README.html b/postfix/proto/LDAP_README.html index 5dc205bd8..a105ff6d5 100644 --- a/postfix/proto/LDAP_README.html +++ b/postfix/proto/LDAP_README.html @@ -96,6 +96,10 @@ your Postfix source tree should work:+
If your LDAP shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lldap".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_LDAP. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded LDAP database client, but only the new diff --git a/postfix/proto/LMDB_README.html b/postfix/proto/LMDB_README.html index 726e415f7..a9794cca6 100644 --- a/postfix/proto/LMDB_README.html +++ b/postfix/proto/LMDB_README.html @@ -55,6 +55,10 @@ build Postfix with LMDB support, use something like:
+If your LMDB shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-llmdb".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_LMDB. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded LMDB database client, but only the new diff --git a/postfix/proto/MYSQL_README.html b/postfix/proto/MYSQL_README.html index 0a1221e50..fc7bdc997 100644 --- a/postfix/proto/MYSQL_README.html +++ b/postfix/proto/MYSQL_README.html @@ -62,6 +62,10 @@ make -f Makefile.init makefiles \ +
If your MySQL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lmysqlclient".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_MYSQL. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded MySQL database client, but only the new diff --git a/postfix/proto/PGSQL_README.html b/postfix/proto/PGSQL_README.html index 7658a9b5c..61445ba4e 100644 --- a/postfix/proto/PGSQL_README.html +++ b/postfix/proto/PGSQL_README.html @@ -57,6 +57,10 @@ the location of the libpq library file.
+If your PostgreSQL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lpq".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_PGSQL. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded PostgreSQL database client, but only diff --git a/postfix/proto/SASL_README.html b/postfix/proto/SASL_README.html index 404c2c978..89a9162a6 100644 --- a/postfix/proto/SASL_README.html +++ b/postfix/proto/SASL_README.html @@ -2127,6 +2127,10 @@ definitions:
-I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib -lsasl2" +If your Cyrus SASL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lsasl2".
+If your SQLite shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lsqlite3".
+Postfix versions before 3.0 use AUXLIBS instead of AUXLIBS_SQLITE. With Postfix 3.0 and later, the old AUXLIBS variable still supports building a statically-loaded SQLite database client, but only the new diff --git a/postfix/proto/TLS_README.html b/postfix/proto/TLS_README.html index e86caad20..a58595768 100644 --- a/postfix/proto/TLS_README.html +++ b/postfix/proto/TLS_README.html @@ -3182,6 +3182,10 @@ are in directory /usr/local/lib:
+If your OpenSSL shared library is in a directory that the RUN-TIME +linker does not know about, add a "-Wl,-R,/path/to/directory" option after +"-lcrypto".
+On Solaris, specify the -R option as shown below:
diff --git a/postfix/src/global/config_known_tcp_ports.c b/postfix/src/global/config_known_tcp_ports.c index 070a5e8ea..84f66e810 100644 --- a/postfix/src/global/config_known_tcp_ports.c +++ b/postfix/src/global/config_known_tcp_ports.c @@ -77,7 +77,7 @@ void config_known_tcp_ports(const char *source, const char *settings) for (cpp = associations->argv; *cpp != 0; cpp++) { char *temp = concatenate(" ", *cpp, " ", (char *) 0); - association = argv_split(temp, "="); + association = argv_split_at(temp, '='); myfree(temp); if (association->argc == 0) { @@ -156,6 +156,13 @@ static struct test_case test_cases[] = { /* warning */ "", /* export */ "lmtp=24 smtp=25 smtps=465 submissions=465" }, + {"equal-equal", + /* config */ "smtp = 25, smtps == submissions = 465, lmtp = 24", + /* warning */ "config_known_tcp_ports: warning: equal-equal: " + "in \" smtps == submissions = 465\": missing service name before " + "\"=\"\n", + /* export */ "lmtp=24 smtp=25 smtps=465 submissions=465" + }, {"port test 1", /* config */ "smtps = submission =", /* warning */ "config_known_tcp_ports: warning: port test 1: " diff --git a/postfix/src/global/config_known_tcp_ports.ref b/postfix/src/global/config_known_tcp_ports.ref index d2bc8339d..5a35677f0 100644 --- a/postfix/src/global/config_known_tcp_ports.ref +++ b/postfix/src/global/config_known_tcp_ports.ref @@ -1,7 +1,8 @@ config_known_tcp_ports: good: PASS +config_known_tcp_ports: equal-equal: PASS config_known_tcp_ports: port test 1: PASS config_known_tcp_ports: port test 2: PASS config_known_tcp_ports: port test 3: PASS config_known_tcp_ports: service name test 1: PASS config_known_tcp_ports: service name test 2: PASS -config_known_tcp_ports: PASS=6 FAIL=0 +config_known_tcp_ports: PASS=7 FAIL=0 diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index dbf6fa769..f5967bf12 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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 "20210419" +#define MAIL_RELEASE_DATE "20210422" #define MAIL_VERSION_NUMBER "3.6" #ifdef SNAPSHOT diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index c18796978..449eae460 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -42,7 +42,7 @@ SRCS = alldig.c allprint.c argv.c argv_split.c attr_clnt.c attr_print0.c \ extpar.c dict_inline.c casefold.c dict_utf8.c strcasecmp_utf8.c \ split_qnameval.c argv_attr_print.c argv_attr_scan.c dict_file.c \ msg_logger.c logwriter.c unix_dgram_connect.c unix_dgram_listen.c \ - byte_mask.c known_tcp_ports.c + byte_mask.c known_tcp_ports.c argv_split_at.c OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \ attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \ @@ -86,7 +86,7 @@ OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ extpar.o dict_inline.o casefold.o dict_utf8.o strcasecmp_utf8.o \ split_qnameval.o argv_attr_print.o argv_attr_scan.o dict_file.o \ msg_logger.o logwriter.o unix_dgram_connect.o unix_dgram_listen.o \ - byte_mask.o known_tcp_ports.o + byte_mask.o known_tcp_ports.o argv_split_at.o # MAP_OBJ is for maps that may be dynamically loaded with dynamicmaps.cf. # When hard-linking these, makedefs sets NON_PLUGIN_MAP_OBJ=$(MAP_OBJ), # otherwise it sets the PLUGIN_* macros. @@ -1049,6 +1049,16 @@ argv_split.o: stringops.h argv_split.o: sys_defs.h argv_split.o: vbuf.h argv_split.o: vstring.h +argv_split_at.o: argv.h +argv_split_at.o: argv_split_at.c +argv_split_at.o: check_arg.h +argv_split_at.o: msg.h +argv_split_at.o: mymalloc.h +argv_split_at.o: split_at.h +argv_split_at.o: stringops.h +argv_split_at.o: sys_defs.h +argv_split_at.o: vbuf.h +argv_split_at.o: vstring.h argv_splitq.o: argv.h argv_splitq.o: argv_splitq.c argv_splitq.o: check_arg.h @@ -1977,6 +1987,8 @@ load_file.o: vbuf.h load_file.o: vstream.h load_file.o: warn_stat.h load_lib.o: load_lib.c +load_lib.o: load_lib.h +load_lib.o: msg.h load_lib.o: sys_defs.h logwriter.o: check_arg.h logwriter.o: iostuff.h diff --git a/postfix/src/util/argv.h b/postfix/src/util/argv.h index f7ce69956..1e3b46705 100644 --- a/postfix/src/util/argv.h +++ b/postfix/src/util/argv.h @@ -39,6 +39,10 @@ extern ARGV *argv_splitq(const char *, const char *, const char *); extern ARGV *argv_splitq_count(const char *, const char *, const char *, ssize_t); extern ARGV *argv_splitq_append(ARGV *, const char *, const char *, const char *); +extern ARGV *argv_split_at(const char *, int); +extern ARGV *argv_split_at_count(const char *, int, ssize_t); +extern ARGV *argv_split_at_append(ARGV *, const char *, int); + #define ARGV_FAKE_BEGIN(fake_argv, arg) { \ ARGV fake_argv; \ char *__fake_argv_args__[2]; \ diff --git a/postfix/src/util/argv_split_at.c b/postfix/src/util/argv_split_at.c new file mode 100644 index 000000000..fcdb4ff27 --- /dev/null +++ b/postfix/src/util/argv_split_at.c @@ -0,0 +1,124 @@ +/*++ +/* NAME +/* argv_split_at 3 +/* SUMMARY +/* string array utilities +/* SYNOPSIS +/* #include+/* +/* ARGV *argv_split_at(string, sep) +/* const char *string; +/* int sep; +/* +/* ARGV *argv_split_at_count(string, sep, count) +/* const char *string; +/* int sep; +/* ssize_t count; +/* +/* ARGV *argv_split_at_append(argv, string, sep) +/* ARGV *argv; +/* const char *string; +/* int sep; +/* DESCRIPTION +/* argv_split_at() splits \fIstring\fR into fields using a +/* single separator specified in \fIsep\fR. The result is a +/* null-terminated string array. +/* +/* argv_split_at_count() is like argv_split_at() but stops +/* splitting input after at most \fIcount\fR -1 times and +/* leaves the remainder, if any, in the last array element. +/* It is an error to specify a count < 1. +/* +/* argv_split_at_append() performs the same operation as +/* argv_split_at(), but appends the result to an existing +/* string array. +/* SEE ALSO +/* split_at(), trivial string splitter. +/* DIAGNOSTICS +/* Fatal errors: memory allocation problem. +/* 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 +/* +/* Wietse Venema +/* Google, Inc. +/* 111 8th Avenue +/* New York, NY 10011, USA +/*--*/ + +/* System libraries. */ + +#include +#include + +/* Application-specific. */ + +#include +#include +#include +#include +#include + +/* argv_split_at - split string into field array */ + +ARGV *argv_split_at(const char *string, int sep) +{ + ARGV *argvp = argv_alloc(1); + char *saved_string = mystrdup(string); + char *bp = saved_string; + char *arg; + + while ((arg = split_at(bp, sep)) != 0) { + argv_add(argvp, bp, (char *) 0); + bp = arg; + } + argv_add(argvp, bp, (char *) 0); + argv_terminate(argvp); + myfree(saved_string); + return (argvp); +} + +/* argv_split_at_count - split string into field array */ + +ARGV *argv_split_at_count(const char *string, int sep, ssize_t count) +{ + ARGV *argvp = argv_alloc(1); + char *saved_string = mystrdup(string); + char *bp = saved_string; + char *arg; + + if (count < 1) + msg_panic("argv_split_at_count: bad count: %ld", (long) count); + while (count-- > 1 && (arg = split_at(bp, sep)) != 0) { + argv_add(argvp, bp, (char *) 0); + bp = arg; + } + argv_add(argvp, bp, (char *) 0); + argv_terminate(argvp); + myfree(saved_string); + return (argvp); +} + +/* argv_split_at_append - split string into field array, append to array */ + +ARGV *argv_split_at_append(ARGV *argvp, const char *string, int sep) +{ + char *saved_string = mystrdup(string); + char *bp = saved_string; + char *arg; + + while ((arg = split_at(bp, sep)) != 0) { + argv_add(argvp, bp, (char *) 0); + bp = arg; + } + argv_add(argvp, bp, (char *) 0); + argv_terminate(argvp); + myfree(saved_string); + return (argvp); +}