summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2021-04-05 13:41:50 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2021-04-05 13:43:28 +0100
commit9f84d5d5eb8d2f15f9bef6d4d662a4dc5f17219c (patch)
tree5505aefb0c12ca3abce1d549175fc3d30ec59324
parent426abccb20f089343f380b1f5b4cfc0bbcf81d90 (diff)
Disable server-side close timing sophistication on MacOS
Broken-by: 001bf8f587
-rw-r--r--src/OS/os.h-Darwin5
-rw-r--r--src/src/smtp_in.c14
2 files changed, 17 insertions, 2 deletions
diff --git a/src/OS/os.h-Darwin b/src/OS/os.h-Darwin
index 1a557d829..a85e92f05 100644
--- a/src/OS/os.h-Darwin
+++ b/src/OS/os.h-Darwin
@@ -56,4 +56,9 @@ in "man 2 getgroups". */
rather than a modified sendto() */
#define EXIM_TFO_CONNECTX
+/* MacOS, at least on the buildfarm animal, does not seem to push out
+the SMTP response to QUIT with our usual handling which is trying to get
+the client to FIN first so that the server does not get the TIME_WAIT */
+#define SERVERSIDE_CLOSE_NOWAIT
+
/* End */
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 5888b8037..2bb15b698 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -3847,9 +3847,18 @@ if (*user_msgp)
else
smtp_printf("221 %s closing connection\r\n", FALSE, smtp_active_hostname);
-#ifndef DISABLE_TLS
+#ifdef SERVERSIDE_CLOSE_NOWAIT
+# ifndef DISABLE_TLS
+tls_close(NULL, TLS_SHUTDOWN_NOWAIT);
+# endif
+
+log_write(L_smtp_connection, LOG_MAIN, "%s closed by QUIT",
+ smtp_get_connection_info());
+#else
+
+# ifndef DISABLE_TLS
tls_close(NULL, TLS_SHUTDOWN_WAIT);
-#endif
+# endif
log_write(L_smtp_connection, LOG_MAIN, "%s closed by QUIT",
smtp_get_connection_info());
@@ -3866,6 +3875,7 @@ The socket should become readble (though with no data) */
FD_SET(fd, &fds);
(void) select(fd + 1, (SELECT_ARG2_TYPE *)&fds, NULL, NULL, &t_limit);
}
+#endif /*!DAEMON_CLOSE_NOWAIT*/
}