Return status message in SmtpEmailTransport::deliver()
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 15 Feb 2021 11:15:54 +0000 (12:15 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 18 Feb 2021 15:24:45 +0000 (16:24 +0100)
wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php

index ee86f9b4aab5f9c941f1c6f2f19f2572a096b3f9..1398ce18b74eab7bc98b8e99fb89508d37fcd2c9 100644 (file)
@@ -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;
     }
 }