From: Tim Düsterhus Date: Mon, 14 Apr 2014 14:37:24 +0000 (+0200) Subject: Fix SMTP delivery of email containing . X-Git-Tag: 2.1.0_Alpha_1~861^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dd1ff120798934513d3bd5877358a34b7ed4dc58;p=GitHub%2FWoltLab%2FWCF.git Fix SMTP delivery of email containing . --- diff --git a/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php b/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php index 3c606b56b1..772903b191 100644 --- a/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php +++ b/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php @@ -2,6 +2,7 @@ namespace wcf\system\mail; use wcf\system\exception\SystemException; use wcf\system\io\RemoteFile; +use wcf\util\StringUtil; /** * Sends a Mail with a connection to a smtp server. @@ -193,7 +194,15 @@ class SMTPMailSender extends MailSender { $this->write($header); $this->write(""); - $this->write($mail->getBody()); + $lines = explode(Mail::$lineEnding, $mail->getBody()); + foreach ($lines as $line) { + // 4.5.2 Transparency + // o Before sending a line of mail text, the SMTP client checks the + // first character of the line. If it is a period, one additional + // period is inserted at the beginning of the line. + if (StringUtil::startsWith($line, '.')) $line = '.'.$line; + $this->write($line); + } $this->write("."); $this->getSMTPStatus();