From b0bc46acf4699458537b690f47320a5277f2fda0 Mon Sep 17 00:00:00 2001 From: Wietse Z Venema Date: Fri, 5 Dec 2025 00:00:00 -0500 Subject: [PATCH] postfix-3.11-20251205 --- postfix/HISTORY | 14 ++++++++++++ postfix/html/postconf.5.html | 2 +- postfix/man/man5/postconf.5 | 2 +- postfix/proto/postconf.proto | 2 +- postfix/src/global/haproxy_srvr.c | 12 +++++------ postfix/src/global/mail_version.h | 2 +- postfix/src/milter/test-milter.c | 25 +++++++++++----------- postfix/src/postalias/postalias.c | 1 + postfix/src/util/dict_debug.c | 8 ++++--- postfix/src/util/myaddrinfo.h | 1 + postfix/src/util/normalize_v4mapped_addr.c | 4 ++-- postfix/src/util/quote_for_json.c | 2 +- 12 files changed, 47 insertions(+), 28 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index 72d75def5..82e060266 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -30120,3 +30120,17 @@ Apologies for any names omitted. local/local.c, oqmgr/qmgr.c, postconf/extract.awk, qmgr/qmgr.c, smtp/smtp.c, smtpd/smtpd.c, trivial-rewrite/trivial-rewrite.c, util/sys_defs.h. + +20251202 + + Fix recent changes that broke builds with -DNO_IPV6. Files: + util/myaddrinfo.h, util/normalize_v4mapped_addr.c, + global/haproxy_srvr.c. + + Portability: makedefs, postalias/postalias.c, util/dict_debug.c, + util/quote_for_json.c. + +20251204 + + Bitrot: non-functional code changes to silence compiler + errors/warnings. File: milter/test-milter.c. diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 950bd6def..cbc1ab488 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -12438,7 +12438,7 @@ used because the remote server did not support STARTTLS.
tls=xxx/!requiretls:noencryption
'Enforce' or 'opportunistic+starttls' policy violation. No connection was made -used because the TLS security policy disabled encryption.
+because the TLS security policy disabled encryption.
tls=xxx/!requiretls:none
'Enforce' policy violation. After a successful TLS handshake, the connection was not used because diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index d95a6b227..6f7309638 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -7922,7 +7922,7 @@ used because the remote server did not support STARTTLS. .IP "tls=xxx/!requiretls:noencryption" \&'Enforce' or \&'opportunistic+starttls' policy violation. No connection was made -used because the TLS security policy disabled encryption. +because the TLS security policy disabled encryption. .br .IP "tls=xxx/!requiretls:none" \&'Enforce' policy violation. diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index ff3ed381d..0295df267 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -20072,7 +20072,7 @@ used because the remote server did not support STARTTLS.
tls=xxx/!requiretls:noencryption
'Enforce' or 'opportunistic+starttls' policy violation. No connection was made -used because the TLS security policy disabled encryption.
+because the TLS security policy disabled encryption.
tls=xxx/!requiretls:none
'Enforce' policy violation. After a successful TLS handshake, the connection was not used because diff --git a/postfix/src/global/haproxy_srvr.c b/postfix/src/global/haproxy_srvr.c index 9c8456ad9..c52941a59 100644 --- a/postfix/src/global/haproxy_srvr.c +++ b/postfix/src/global/haproxy_srvr.c @@ -162,7 +162,7 @@ static int haproxy_srvr_parse_proto(const char *str, int *addr_family) if (str == 0) return (-1); -#ifdef AF_INET6 +#ifdef HAS_IPV6 if (strcasecmp(str, "TCP6") == 0) { if (strchr((char *) proto_info->sa_family_list, AF_INET6) != 0) { *addr_family = AF_INET6; @@ -199,7 +199,7 @@ static int haproxy_srvr_parse_addr(const char *str, MAI_HOSTADDR_STR *addr, return (-1); switch (addr_family) { -#ifdef AF_INET6 +#ifdef HAS_IPV6 case AF_INET6: if (!valid_ipv6_hostaddr(str, DONT_GRIPE)) return (-1); @@ -238,7 +238,7 @@ static int haproxy_srvr_parse_addr(const char *str, MAI_HOSTADDR_STR *addr, *sa_len = res->ai_addrlen; memcpy((void *) sa, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); -#ifdef AF_INET6 +#ifdef HAS_IPV6 if (sa->sa_family == AF_INET6) normalize_v4mapped_sockaddr(sa, sa_len); #endif @@ -265,7 +265,7 @@ static int haproxy_srvr_parse_port(const char *str, MAI_SERVPORT_STR *port, memcpy(port->buf, str, strlen(str) + 1); if (sa != 0) { switch (sa->sa_family) { -#ifdef AF_INET6 +#ifdef HAS_IPV6 case AF_INET6: SOCK_ADDR_IN6_PORT(sa) = htons(atoi(str)); break; @@ -318,7 +318,7 @@ static int haproxy_srvr_parse_v2_addr_v4(uint32_t sin_addr, return (0); } -#ifdef AF_INET6 +#ifdef HAS_IPV6 /* haproxy_srvr_parse_v2_addr_v6 - parse IPv6 info from v2 header */ @@ -418,7 +418,7 @@ static const char *haproxy_srvr_parse_v2_hdr(const char *str, ssize_t *str_len, break; } case PP2_FAM_INET6 | PP2_TRANS_STREAM:{/* TCP6 */ -#ifdef AF_INET6 +#ifdef HAS_IPV6 if (strchr((char *) proto_info->sa_family_list, AF_INET6) == 0) return ("Postfix IPv6 support is disabled"); if (ntohs(hdr_v2->len) < PP2_ADDR_LEN_INET6) diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 9f03c4eeb..36b169cdb 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 "20251201" +#define MAIL_RELEASE_DATE "20251205" #define MAIL_VERSION_NUMBER "3.11" #ifdef SNAPSHOT diff --git a/postfix/src/milter/test-milter.c b/postfix/src/milter/test-milter.c index 90c644387..49c1baced 100644 --- a/postfix/src/milter/test-milter.c +++ b/postfix/src/milter/test-milter.c @@ -87,6 +87,7 @@ #include #include +#define SM_CONF_STDBOOL_H 1 #include "libmilter/mfapi.h" #include "libmilter/mfdef.h" @@ -302,7 +303,7 @@ static sfsistat test_rcpt(SMFICTX *ctx, char **argv) } -sfsistat test_header(SMFICTX *ctx, char *name, char *value) +static sfsistat test_header(SMFICTX *ctx, char *name, char *value) { printf("test_header \"%s\" \"%s\"\n", name, value); return (test_reply(ctx, test_header_reply)); @@ -341,7 +342,7 @@ static sfsistat test_eom(SMFICTX *ctx) len = strcspn(buf, "\n"); buf[len + 0] = '\r'; buf[len + 1] = '\n'; - if (smfi_replacebody(ctx, buf, len + 2) == MI_FAILURE) { + if (smfi_replacebody(ctx,(unsigned char *) buf, len + 2) == MI_FAILURE) { fprintf(stderr, "body replace failure\n"); exit(1); } @@ -490,7 +491,7 @@ static const char *macro_states[] = { static int set_macro_state; static char *set_macro_list; -typedef sfsistat (*FILTER_ACTION) (); +typedef sfsistat (*FILTER_ACTION) (SMFICTX *, unsigned char *, size_t); struct noproto_map { const char *name; @@ -501,15 +502,15 @@ struct noproto_map { }; static const struct noproto_map noproto_map[] = { - "connect", SMFIP_NOCONNECT, SMFIP_NR_CONN, &test_connect_reply, &smfilter.xxfi_connect, - "helo", SMFIP_NOHELO, SMFIP_NR_HELO, &test_helo_reply, &smfilter.xxfi_helo, - "mail", SMFIP_NOMAIL, SMFIP_NR_MAIL, &test_mail_reply, &smfilter.xxfi_envfrom, - "rcpt", SMFIP_NORCPT, SMFIP_NR_RCPT, &test_rcpt_reply, &smfilter.xxfi_envrcpt, - "data", SMFIP_NODATA, SMFIP_NR_DATA, &test_data_reply, &smfilter.xxfi_data, - "header", SMFIP_NOHDRS, SMFIP_NR_HDR, &test_header_reply, &smfilter.xxfi_header, - "eoh", SMFIP_NOEOH, SMFIP_NR_EOH, &test_eoh_reply, &smfilter.xxfi_eoh, - "body", SMFIP_NOBODY, SMFIP_NR_BODY, &test_body_reply, &smfilter.xxfi_body, - "unknown", SMFIP_NOUNKNOWN, SMFIP_NR_UNKN, &test_unknown_reply, &smfilter.xxfi_unknown, + "connect", SMFIP_NOCONNECT, SMFIP_NR_CONN, &test_connect_reply, (FILTER_ACTION *) & smfilter.xxfi_connect, + "helo", SMFIP_NOHELO, SMFIP_NR_HELO, &test_helo_reply, (FILTER_ACTION *) & smfilter.xxfi_helo, + "mail", SMFIP_NOMAIL, SMFIP_NR_MAIL, &test_mail_reply, (FILTER_ACTION *) & smfilter.xxfi_envfrom, + "rcpt", SMFIP_NORCPT, SMFIP_NR_RCPT, &test_rcpt_reply, (FILTER_ACTION *) & smfilter.xxfi_envrcpt, + "data", SMFIP_NODATA, SMFIP_NR_DATA, &test_data_reply, (FILTER_ACTION *) & smfilter.xxfi_data, + "header", SMFIP_NOHDRS, SMFIP_NR_HDR, &test_header_reply, (FILTER_ACTION *) & smfilter.xxfi_header, + "eoh", SMFIP_NOEOH, SMFIP_NR_EOH, &test_eoh_reply, (FILTER_ACTION *) & smfilter.xxfi_eoh, + "body", SMFIP_NOBODY, SMFIP_NR_BODY, &test_body_reply, (FILTER_ACTION *) & smfilter.xxfi_body, + "unknown", SMFIP_NOUNKNOWN, SMFIP_NR_UNKN, &test_unknown_reply, (FILTER_ACTION *) & smfilter.xxfi_unknown, 0, }; diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index 2ab13426a..710b3add0 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -254,6 +254,7 @@ #include #include #include +#include /* Utility library. */ diff --git a/postfix/src/util/dict_debug.c b/postfix/src/util/dict_debug.c index 8fde809e0..046ad646a 100644 --- a/postfix/src/util/dict_debug.c +++ b/postfix/src/util/dict_debug.c @@ -139,6 +139,8 @@ static void dict_debug_close(DICT *dict) DICT *dict_debug_open(const char *name, int open_flags, int dict_flags) { static const char myname[] = "dict_debug_open"; + DICT *real_dict; + DICT_DEBUG *dict_debug; if (msg_verbose) msg_info("%s: %s", myname, name); @@ -148,9 +150,9 @@ DICT *dict_debug_open(const char *name, int open_flags, int dict_flags) * prevents a config containing both debug:foo:bar and foo:bar from * creating two DICT objects for foo:bar. */ - DICT *real_dict = dict_open(name, open_flags, dict_flags); - DICT_DEBUG *dict_debug = (DICT_DEBUG *) dict_alloc(DICT_TYPE_DEBUG, name, - sizeof(*dict_debug)); + real_dict = dict_open(name, open_flags, dict_flags); + dict_debug = (DICT_DEBUG *) dict_alloc(DICT_TYPE_DEBUG, name, + sizeof(*dict_debug)); dict_debug->dict.flags = real_dict->flags; /* XXX not synchronized */ dict_debug->dict.lookup = dict_debug_lookup; diff --git a/postfix/src/util/myaddrinfo.h b/postfix/src/util/myaddrinfo.h index 14a6baece..7b3f5785f 100644 --- a/postfix/src/util/myaddrinfo.h +++ b/postfix/src/util/myaddrinfo.h @@ -59,6 +59,7 @@ struct addrinfo { * Modern systems define this in . */ struct sockaddr_storage { + sa_family_t ss_family; struct sockaddr_in dummy; /* alignment!! */ }; diff --git a/postfix/src/util/normalize_v4mapped_addr.c b/postfix/src/util/normalize_v4mapped_addr.c index 40f864a45..0186a29f8 100644 --- a/postfix/src/util/normalize_v4mapped_addr.c +++ b/postfix/src/util/normalize_v4mapped_addr.c @@ -55,7 +55,7 @@ int normalize_v4mapped_sockaddr(struct sockaddr *sa, SOCKADDR_SIZE *sa_len) { -#ifdef AF_INET6 +#ifdef HAS_IPV6 struct sockaddr_in sin; if (sa->sa_family == AF_INET6 @@ -78,7 +78,7 @@ int normalize_v4mapped_sockaddr(struct sockaddr *sa, SOCKADDR_SIZE *sa_len) int normalize_v4mapped_hostaddr(MAI_HOSTADDR_STR *addr) { -#ifdef AF_INET6 +#ifdef HAS_IPV6 if (addr->buf[0] == ':' && strncasecmp("::ffff:", addr->buf, 7) == 0 && strchr((char *) inet_proto_info()->sa_family_list, AF_INET) != 0) { diff --git a/postfix/src/util/quote_for_json.c b/postfix/src/util/quote_for_json.c index 81af57ac7..686f62fee 100644 --- a/postfix/src/util/quote_for_json.c +++ b/postfix/src/util/quote_for_json.c @@ -148,10 +148,10 @@ char *quote_for_json(VSTRING *result, const char *text, ssize_t len) char *quote_for_json_var(VSTRING *result,...) { - VSTRING_RESET(result); const char *in; va_list ap; + VSTRING_RESET(result); va_start(ap, result); while ((in = va_arg(ap, const char *)) != 0) quote_for_json_append(result, in, -1); -- 2.47.3