From 5b970527ae5f32c4425ad8411b77912ca68d5cf9 Mon Sep 17 00:00:00 2001 From: Christian Seel Date: Mon, 11 Aug 2025 14:09:44 +0200 Subject: [PATCH] Enhance interrupted system call check for non-english locale on applications with a different locale than english, the message "interrupted system call" is not found because it's translated. So we also check for the SOCKET_EINTR constant which is defined under Windows and UNIX-like platforms (if available on the platform). --- src/SMTP.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SMTP.php b/src/SMTP.php index e6170f71..4181eaea 100644 --- a/src/SMTP.php +++ b/src/SMTP.php @@ -1340,7 +1340,16 @@ class SMTP //stream_select returns false when the `select` system call is interrupted //by an incoming signal, try the select again - if (stripos($message, 'interrupted system call') !== false) { + if ( + stripos($message, 'interrupted system call') !== false || + ( + // on applications with a different locale than english, the message above is not found because + // it's translated. So we also check for the SOCKET_EINTR constant which is defined under + // Windows and UNIX-like platforms (if available on the platform). + defined('SOCKET_EINTR') && + stripos($message, 'stream_select(): Unable to select [' . SOCKET_EINTR . ']') !== false + ) + ) { $this->edebug( 'SMTP -> get_lines(): retrying stream_select', self::DEBUG_LOWLEVEL