From 2e9ec0d2ee788d8a9b29aa5e35a97bb94632f5c6 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 12 Jul 2016 07:03:36 +0000 Subject: [PATCH] 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 --- smtp.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smtp.php b/smtp.php index 45e6e97..5d456ad 100644 --- a/smtp.php +++ b/smtp.php @@ -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"); }