From 5b3c06237e1a0427ed64bd9ac9dd679673cde4fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 14 Jun 2016 23:22:25 +0200 Subject: [PATCH] Check return value of mail() --- .../system/email/transport/PhpEmailTransport.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php b/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php index 2f649ffd11..3f97c14313 100644 --- a/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php +++ b/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php @@ -1,5 +1,6 @@ getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers, '-f'.$email->getSender()->getAddress()); + $return = mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers, '-f'.$email->getSender()->getAddress()); } else { - mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers); + $return = mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers); + } + + if (!$return) { + throw new TransientFailure("mail() returned false"); } } } -- 2.20.1