smtp : manage the dot on first column : double it before sending the email

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2865 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-07-12 07:03:36 +00:00
parent 2297b99845
commit 2e9ec0d2ee

View File

@@ -159,6 +159,10 @@ class smtp
$this->putLine ("DATA\r\n");
if (substr ($completeMail, -2) !== "\r\n")
$completeMail .= "\r\n";
// Dot on first column : must be doubled to not be detected as the end
// of SMTP transaction. The SMTP server will remove it before distribute
// http://tools.ietf.org/html/rfc5321#section-4.5.2
$completeMail = preg_replace ("#^\.#m", "..", $completeMail);
return $this->putLine ("$completeMail.\r\n");
}