[imp] Incorrect handling of '.' character in IMP 2.3
Chuck Hagenbuch
chuck@horde.org
Wed, 30 May 2001 22:33:15 -0400
Quoting Ray Jackson <Ray.Jackson@cern.ch>:
> Any quick fix out there by some SMTP wizards?
This patch to PEAR's Net/SMTP.php fixes the problem:
Index: SMTP.php
===================================================================
RCS file: /repository/php4/pear/Net/SMTP.php,v
retrieving revision 1.2
diff -u -r1.2 SMTP.php
--- SMTP.php 2001/01/10 01:01:56 1.2
+++ SMTP.php 2001/05/31 02:31:43
@@ -200,7 +200,7 @@
function data($data) {
$data = preg_replace("/([^\r]{1})\n/", "\\1\r\n", $data);
$data = preg_replace("/\n\n/", "\n\r\n", $data);
- $data = preg_replace("/^(\..*)/", ".\\1", $data);
+ $data = preg_replace("/\n\./", "\n..", $data);
if (PEAR::isError($this->socket->write("DATA\r\n"))) { return
new PEAR_Error('write to socket failed'); }
if (!($this->validateResponse('354'))) { return new PEAR_Error
('354 not received'); }
I've committed it to php CVS, also.
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
Black and white and grey, all the shades of truth.