FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

ID: 18819
Updated by: alec@alec.pl
Reported By: alec at alec dot pl
Summary: Empty message sent when body starts with a dot + LF
character
Status: Open
Type: Bug
Package: Net_SMTP
Package Version: SVN
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

Another possibility of wrong dot handling is when body is a file handle
to data stream with lonely dots in some lines, because it is parsed
using fgets(). Consider text:

"aaaaa
.
bbbbb
."

I think any of dots here will be dot-stuffed. I think quotedata() should
contain additional code, e.g.:

if ($data == '.' || substr($data, 0, 3) == ".\r\n")
$data = '.' . $data;


Previous Comments:
------------------------------------------------------------------------

[2011-09-09 09:50:43] alec

Description:
------------
The alone dot in a line is not replaced with two dots when it is on the
beginning of the body.

$body = ".\ntext";
$headers = "Subject: test";
$SMTP->data($body, $headers);

------------------------------------------------------------------------

Search Discussions

  • Alec at Sep 9, 2011 at 8:47 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

    ID: 18819
    Updated by: alec@alec.pl
    Reported By: alec at alec dot pl
    Summary: Empty message sent when body starts with a dot + LF
    character
    Status: Open
    Type: Bug
    Package: Net_SMTP
    Package Version: SVN
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    It should be "I think none of dots here will be dot-stuffed." above.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-09 10:47:45] alec

    Another possibility of wrong dot handling is when body is a file handle
    to data stream with lonely dots in some lines, because it is parsed
    using fgets(). Consider text:

    "aaaaa
    .
    bbbbb
    ."

    I think any of dots here will be dot-stuffed. I think quotedata() should
    contain additional code, e.g.:

    if ($data == '.' || substr($data, 0, 3) == ".\r\n")
    $data = '.' . $data;

    ------------------------------------------------------------------------

    [2011-09-09 09:50:43] alec

    Description:
    ------------
    The alone dot in a line is not replaced with two dots when it is on the
    beginning of the body.

    $body = ".\ntext";
    $headers = "Subject: test";
    $SMTP->data($body, $headers);

    ------------------------------------------------------------------------
  • Daniel Oconnor at Sep 18, 2011 at 7:16 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

    ID: 18819
    Updated by: daniel.oconnor@gmail.com
    Reported By: alec at alec dot pl
    Summary: Empty message sent when body starts with a dot + LF
    character
    Status: Open
    Type: Bug
    Package: Net_SMTP
    Package Version: SVN
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    Thanks for hte report alec, for those of us not super familar with the
    package;
    what's the expected vs actual output of your test case?


    Expected:
    ..
    text

    Actual:
    .
    text

    ?


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-09 10:48:31] alec

    It should be "I think none of dots here will be dot-stuffed." above.

    ------------------------------------------------------------------------

    [2011-09-09 10:47:45] alec

    Another possibility of wrong dot handling is when body is a file handle
    to data stream with lonely dots in some lines, because it is parsed
    using fgets(). Consider text:

    "aaaaa
    .
    bbbbb
    ."

    I think any of dots here will be dot-stuffed. I think quotedata() should
    contain additional code, e.g.:

    if ($data == '.' || substr($data, 0, 3) == ".\r\n")
    $data = '.' . $data;

    ------------------------------------------------------------------------

    [2011-09-09 09:50:43] alec

    Description:
    ------------
    The alone dot in a line is not replaced with two dots when it is on the
    beginning of the body.

    $body = ".\ntext";
    $headers = "Subject: test";
    $SMTP->data($body, $headers);

    ------------------------------------------------------------------------
  • Daniel Oconnor at Sep 18, 2011 at 7:17 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

    ID: 18819
    Updated by: daniel.oconnor@gmail.com
    Reported By: alec at alec dot pl
    Summary: Empty message sent when body starts with a dot + LF
    character
    -Status: Open
    +Status: Feedback
    Type: Bug
    Package: Net_SMTP
    Package Version: SVN
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback



    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-18 09:17:55] doconnor

    Thanks for hte report alec, for those of us not super familar with the
    package;
    what's the expected vs actual output of your test case?


    Expected:
    ..
    text

    Actual:
    .
    text

    ?

    ------------------------------------------------------------------------

    [2011-09-09 10:48:31] alec

    It should be "I think none of dots here will be dot-stuffed." above.

    ------------------------------------------------------------------------

    [2011-09-09 10:47:45] alec

    Another possibility of wrong dot handling is when body is a file handle
    to data stream with lonely dots in some lines, because it is parsed
    using fgets(). Consider text:

    "aaaaa
    .
    bbbbb
    ."

    I think any of dots here will be dot-stuffed. I think quotedata() should
    contain additional code, e.g.:

    if ($data == '.' || substr($data, 0, 3) == ".\r\n")
    $data = '.' . $data;

    ------------------------------------------------------------------------

    [2011-09-09 09:50:43] alec

    Description:
    ------------
    The alone dot in a line is not replaced with two dots when it is on the
    beginning of the body.

    $body = ".\ntext";
    $headers = "Subject: test";
    $SMTP->data($body, $headers);

    ------------------------------------------------------------------------
  • Alec at Sep 18, 2011 at 8:55 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

    ID: 18819
    Updated by: alec@alec.pl
    Reported By: alec at alec dot pl
    Summary: Empty message sent when body starts with a dot + LF
    character
    Status: Feedback
    Type: Bug
    Package: Net_SMTP
    Package Version: SVN
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    Exactly. In SMTP protocol <CR><LF>.<CR><LF> sequence is used as end of
    data mark. So, when it appears in the body it must be replaced with
    <CR><LF>..<CR><LF>.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-18 09:18:13] doconnor

    -Status: Open
    +Status: Feedback


    ------------------------------------------------------------------------

    [2011-09-18 09:17:55] doconnor

    Thanks for hte report alec, for those of us not super familar with the
    package;
    what's the expected vs actual output of your test case?


    Expected:
    ..
    text

    Actual:
    .
    text

    ?

    ------------------------------------------------------------------------

    [2011-09-09 10:48:31] alec

    It should be "I think none of dots here will be dot-stuffed." above.

    ------------------------------------------------------------------------

    [2011-09-09 10:47:45] alec

    Another possibility of wrong dot handling is when body is a file handle
    to data stream with lonely dots in some lines, because it is parsed
    using fgets(). Consider text:

    "aaaaa
    .
    bbbbb
    ."

    I think any of dots here will be dot-stuffed. I think quotedata() should
    contain additional code, e.g.:

    if ($data == '.' || substr($data, 0, 3) == ".\r\n")
    $data = '.' . $data;

    ------------------------------------------------------------------------

    [2011-09-09 09:50:43] alec

    Description:
    ------------
    The alone dot in a line is not replaced with two dots when it is on the
    beginning of the body.

    $body = ".\ntext";
    $headers = "Subject: test";
    $SMTP->data($body, $headers);

    ------------------------------------------------------------------------
  • Jon at Sep 19, 2011 at 12:38 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

    ID: 18819
    Updated by: jon@php.net
    Reported By: alec at alec dot pl
    Summary: Empty message sent when body starts with a dot + LF
    character
    -Status: Feedback
    +Status: Closed
    Type: Bug
    Package: Net_SMTP
    Package Version: SVN
    PHP Version: Irrelevant
    -Assigned To:
    +Assigned To: jon
    Roadmap Versions:
    New Comment:

    -Status: Feedback
    +Status: Closed
    -Assigned To:
    +Assigned To: jon
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.




    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-18 10:56:36] alec

    Exactly. In SMTP protocol <CR><LF>.<CR><LF> sequence is used as end of
    data mark. So, when it appears in the body it must be replaced with
    <CR><LF>..<CR><LF>.

    ------------------------------------------------------------------------

    [2011-09-18 09:18:13] doconnor

    -Status: Open
    +Status: Feedback


    ------------------------------------------------------------------------

    [2011-09-18 09:17:55] doconnor

    Thanks for hte report alec, for those of us not super familar with the
    package;
    what's the expected vs actual output of your test case?


    Expected:
    ..
    text

    Actual:
    .
    text

    ?

    ------------------------------------------------------------------------

    [2011-09-09 10:48:31] alec

    It should be "I think none of dots here will be dot-stuffed." above.

    ------------------------------------------------------------------------

    [2011-09-09 10:47:45] alec

    Another possibility of wrong dot handling is when body is a file handle
    to data stream with lonely dots in some lines, because it is parsed
    using fgets(). Consider text:

    "aaaaa
    .
    bbbbb
    ."

    I think any of dots here will be dot-stuffed. I think quotedata() should
    contain additional code, e.g.:

    if ($data == '.' || substr($data, 0, 3) == ".\r\n")
    $data = '.' . $data;

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18819
  • Alec at Sep 19, 2011 at 7:38 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

    ID: 18819
    Updated by: alec@alec.pl
    Reported By: alec at alec dot pl
    Summary: Empty message sent when body starts with a dot + LF
    character
    -Status: Closed
    +Status: Open
    Type: Bug
    Package: Net_SMTP
    Package Version: SVN
    PHP Version: Irrelevant
    Assigned To: jon
    Roadmap Versions:
    New Comment:

    -Status: Closed
    +Status: Open
    The fix is wrong. See test case.

    "xxx.\n.xxx" => "xxx.\r\n..xxx",

    There's no line feed after the second dot. No need to
    dot-stuff it.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-19 02:39:35] jon

    -Status: Feedback
    +Status: Closed
    -Assigned To:
    +Assigned To: jon
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

    ------------------------------------------------------------------------

    [2011-09-18 10:56:36] alec

    Exactly. In SMTP protocol <CR><LF>.<CR><LF> sequence is used as end of
    data mark. So, when it appears in the body it must be replaced with
    <CR><LF>..<CR><LF>.

    ------------------------------------------------------------------------

    [2011-09-18 09:18:13] doconnor

    -Status: Open
    +Status: Feedback


    ------------------------------------------------------------------------

    [2011-09-18 09:17:55] doconnor

    Thanks for hte report alec, for those of us not super familar with the
    package;
    what's the expected vs actual output of your test case?


    Expected:
    ..
    text

    Actual:
    .
    text

    ?

    ------------------------------------------------------------------------

    [2011-09-09 10:48:31] alec

    It should be "I think none of dots here will be dot-stuffed." above.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18819
  • Jon at Sep 26, 2011 at 5:04 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18819&edit=1

    ID: 18819
    Updated by: jon@php.net
    Reported By: alec at alec dot pl
    Summary: Empty message sent when body starts with a dot + LF
    character
    -Status: Assigned
    +Status: Closed
    Type: Bug
    Package: Net_SMTP
    Package Version: SVN
    PHP Version: Irrelevant
    Assigned To: jon
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Closed
    I don't think you're correct here. The SMTP standards says that we must
    dot-stuff
    whenever a line starts with a dot.

    From RFC-2821, Section 4.5.2 Transparency:

    - 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.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-19 09:39:30] alec

    -Status: Closed
    +Status: Open
    The fix is wrong. See test case.

    "xxx.\n.xxx" => "xxx.\r\n..xxx",

    There's no line feed after the second dot. No need to
    dot-stuff it.

    ------------------------------------------------------------------------

    [2011-09-19 02:39:35] jon

    -Status: Feedback
    +Status: Closed
    -Assigned To:
    +Assigned To: jon
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

    ------------------------------------------------------------------------

    [2011-09-18 10:56:36] alec

    Exactly. In SMTP protocol <CR><LF>.<CR><LF> sequence is used as end of
    data mark. So, when it appears in the body it must be replaced with
    <CR><LF>..<CR><LF>.

    ------------------------------------------------------------------------

    [2011-09-18 09:18:13] doconnor

    -Status: Open
    +Status: Feedback


    ------------------------------------------------------------------------

    [2011-09-18 09:17:55] doconnor

    Thanks for hte report alec, for those of us not super familar with the
    package;
    what's the expected vs actual output of your test case?


    Expected:
    ..
    text

    Actual:
    .
    text

    ?

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18819

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 9, '11 at 8:46a
activeSep 26, '11 at 5:04a
posts8
users3
websitepear.php.net

3 users in discussion

Alec: 4 posts Daniel Oconnor: 2 posts Jon: 2 posts

People

Translate

site design / logo © 2022 Grokbase