From dd2d45e2a6d6ca9df89e5023dea5be1f7e3d4ef7 Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Wed, 17 May 2023 10:05:36 +0200 Subject: [PATCH] Fix patch for SRV record resolution feature Related: rhbz#2134789 --- postfix-3.5.9-SRV-resolve.patch | 33 +++++++++++++++++++-------------- postfix.spec | 6 +++++- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/postfix-3.5.9-SRV-resolve.patch b/postfix-3.5.9-SRV-resolve.patch index 33e2c68..f04e43a 100644 --- a/postfix-3.5.9-SRV-resolve.patch +++ b/postfix-3.5.9-SRV-resolve.patch @@ -1,6 +1,6 @@ -commit 15dc275ce64c7c715094347456ac62a001f65b08 +commit 3a64b35100aa150ce80957dc56f0db7fbdb07017 Author: Tomas Korbar -Date: Thu Apr 27 10:45:22 2023 +0200 +Date: Wed May 17 10:01:21 2023 +0200 Backport SRV record resolution feature @@ -659,7 +659,7 @@ index 27b17d5..e8d9c28 100644 /* .ad /* .fi diff --git a/src/posttls-finger/posttls-finger.c b/src/posttls-finger/posttls-finger.c -index a3a9946..a56bad1 100644 +index a3a9946..60bf047 100644 --- a/src/posttls-finger/posttls-finger.c +++ b/src/posttls-finger/posttls-finger.c @@ -236,6 +236,8 @@ @@ -838,17 +838,22 @@ index a3a9946..a56bad1 100644 if (alldig(service)) { if ((port = atoi(service)) >= 65536 || port == 0) msg_fatal("bad network port in destination: %s", destination); -@@ -1509,15 +1587,18 @@ static void connect_remote(STATE *state, char *dest) +@@ -1507,17 +1585,21 @@ static char *parse_destination(char *destination, char *def_service, + static void connect_remote(STATE *state, char *dest) + { DNS_RR *addr; - char *buf; - char *domain; -+ char *service; +- char *buf; +- char *domain; /* When reconnecting use IP address of previous session */ if (state->addr == 0) { ++ char *buf; ++ char *domain; ++ char *service; ++ buf = parse_destination(dest, state->smtp ? "smtp" : "24", - &domain, &state->port); -+ &domain, service, &state->port); ++ &domain, &service, &state->port); if (!state->nexthop) state->nexthop = mystrdup(domain); if (state->smtp == 0 || *dest == '[') @@ -858,7 +863,7 @@ index a3a9946..a56bad1 100644 else state->addr = domain_addr(state, domain); myfree(buf); -@@ -1531,10 +1612,14 @@ static void connect_remote(STATE *state, char *dest) +@@ -1531,10 +1613,14 @@ static void connect_remote(STATE *state, char *dest) for (addr = state->addr; addr; addr = addr->next) { int level = dane_host_level(state, addr); @@ -869,13 +874,13 @@ index a3a9946..a56bad1 100644 || (state->stream = connect_addr(state, addr)) == 0) { - msg_info("Failed to establish session to %s via %s: %s", - dest, HNAME(addr), vstring_str(state->why->reason)); -+ msg_info("Failed to establish session to %s:%s via %s:%u: %s", -+ dest, service, HNAME(addr), addr->port, ++ msg_info("Failed to establish session to %s via %s:%u: %s", ++ dest, HNAME(addr), addr->port, + vstring_str(state->why->reason)); continue; } /* We have a connection */ -@@ -1819,6 +1904,7 @@ static void parse_options(STATE *state, int argc, char *argv[]) +@@ -1819,6 +1905,7 @@ static void parse_options(STATE *state, int argc, char *argv[]) state->smtp = 1; state->pass = 1; @@ -883,7 +888,7 @@ index a3a9946..a56bad1 100644 state->reconnect = -1; state->max_reconnect = 5; state->wrapper_mode = 0; -@@ -1829,7 +1915,7 @@ static void parse_options(STATE *state, int argc, char *argv[]) +@@ -1829,7 +1916,7 @@ static void parse_options(STATE *state, int argc, char *argv[]) memset((void *) &state->options, 0, sizeof(state->options)); state->options.host_lookup = mystrdup("dns"); @@ -892,7 +897,7 @@ index a3a9946..a56bad1 100644 #ifdef USE_TLS #define TLSOPTS "A:Cd:fF:g:H:k:K:l:L:m:M:p:P:r:s:wX" -@@ -1868,6 +1954,9 @@ static void parse_options(STATE *state, int argc, char *argv[]) +@@ -1868,6 +1955,9 @@ static void parse_options(STATE *state, int argc, char *argv[]) case 'o': override(optarg); break; diff --git a/postfix.spec b/postfix.spec index 67fbe7a..8a5fd40 100644 --- a/postfix.spec +++ b/postfix.spec @@ -49,7 +49,7 @@ Name: postfix Summary: Postfix Mail Transport Agent Version: 3.5.9 -Release: 20%{?dist} +Release: 21%{?dist} Epoch: 2 URL: http://www.postfix.org License: (IBM and GPLv2+) or (EPL-2.0 and GPLv2+) @@ -809,6 +809,10 @@ fi %endif %changelog +* Wed May 17 2023 Tomas Korbar - 2:3.5.9-21 +- Fix patch for SRV record resolution feature + Related: rhbz#2134789 + * Thu May 04 2023 Tomas Korbar - 2:3.5.9-20 - Backport dns SRV record resolution feature (RFC6186) Resolves: rhbz#2134789