php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49750 feof return true even this should not happen
Submitted: 2009-10-02 15:30 UTC Modified: 2009-10-03 09:58 UTC
From: donauinsel at hotmail dot com Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 5.2.11 OS: Windows 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: donauinsel at hotmail dot com
New email:
PHP Version: OS:

 

 [2009-10-02 15:30 UTC] donauinsel at hotmail dot com
Description:
------------
Any SMTP Class may return "end-of-data"



Reproduce code:
---------------
<?php
$fp = fsockopen('localhost', 25, $errno, $errstr, 10);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
      if(!feof($fp)) {
      echo fgets($fp, 100);  
      }  
    }
    fclose($fp);
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-02 21:44 UTC] fa@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

I don't really get what you mean.
The only reference to "end of data" I could find in the RFC 821 is:

>end of mail data indication
>      A special sequence of characters that indicates the end of the
>      mail data.  In particular, the five characters carriage return,
>      line feed, period, carriage return, line feed, in that order.

But I can't make the connection to feof.

Could you please elaborate and also give example output of your mailserver (and version, etc.)
Your code snippet gives me this:
string(52) "220 XXXXXXXXX.XXXXX.XXXX ESMTP Postfix (Debian/GNU)
"
 [2009-10-03 08:58 UTC] donauinsel at hotmail dot com
It's possibly a duplicate of http://bugs.php.net/bug.php?id=49706 on same platform (W2K3)
 [2009-10-03 09:58 UTC] pajoye@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See #49706
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 05:01:33 2024 UTC