summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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*/
}