From b17d3ee2e7c3ccda4feecbeb01fbf4704d373058 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 15 Feb 2021 12:15:54 +0100 Subject: [PATCH] Return status message in SmtpEmailTransport::deliver() --- .../system/email/transport/SmtpEmailTransport.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php b/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php index ee86f9b4aa..1398ce18b7 100644 --- a/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php +++ b/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php @@ -20,7 +20,7 @@ use wcf\util\StringUtil; * @package WoltLabSuite\Core\System\Email\Transport * @since 3.0 */ -class SmtpEmailTransport implements IEmailTransport +class SmtpEmailTransport implements IStatusReportingEmailTransport { /** * SMTP connection @@ -426,7 +426,7 @@ class SmtpEmailTransport implements IEmailTransport * @throws \Exception * @throws PermanentFailure */ - public function deliver(Email $email, Mailbox $envelopeFrom, Mailbox $envelopeTo) + public function deliver(Email $email, Mailbox $envelopeFrom, Mailbox $envelopeTo): string { // delivery is locked if ($this->locked instanceof \Exception) { @@ -468,6 +468,8 @@ class SmtpEmailTransport implements IEmailTransport return $item; }, \explode("\r\n", $email->getEmail()))) . "\r\n"); $this->write("."); - $this->read([250]); + [, $message] = $this->read([250]); + + return $message; } } -- 2.20.1