Fix handling of unsupported EHLO in SmtpEmailTransport
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 9 Sep 2022 08:54:24 +0000 (10:54 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 9 Sep 2022 08:54:24 +0000 (10:54 +0200)
This was broken, because the SMTP exceptions are no longer `SystemException`s
since 280b49db3ccccb2c3db34d429cf760221d56116f.

wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php

index 1b38ffb66c6e920be3ff38d83a4775e1da9c5a7e..4aa78d0610c4e3454818dd7c142a20b9b6fbab86 100644 (file)
@@ -262,10 +262,12 @@ class SmtpEmailTransport implements IStatusReportingEmailTransport
                 'strtolower',
                 \explode("\n", StringUtil::unifyNewlines($this->read([250])[1]))
             );
-        } catch (SystemException $e) {
+        } catch (\Exception $e) {
             if ($this->starttls == 'encrypt') {
                 throw new PermanentFailure(
-                    "Remote SMTP server does not support EHLO, but \$starttls is set to 'encrypt'."
+                    "Remote SMTP server does not support EHLO, but \$starttls is set to 'encrypt'.",
+                    0,
+                    $e
                 );
             }