php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15470 imap_headers() does not work
Submitted: 2002-02-09 14:20 UTC Modified: 2002-02-10 05:57 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: darek at my dot tenbit dot pl Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.1.1 OS: Solaris 2.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: darek at my dot tenbit dot pl
New email:
PHP Version: OS:

 

 [2002-02-09 14:20 UTC] darek at my dot tenbit dot pl
On PHP 4.0.6 this script works fine, but after upgrade to 4.1.1 there is a problem...

<?
$mbox = imap_open("{my.host.com:143}","user","password")
      or die("can't connect: ".imap_last_error());

echo "<p><h1>Mailboxes</h1>\n";
$folders = imap_listmailbox ($mbox, "{my.host.com:143}", "*");

if ($folders == false) {
    echo "Call failed: ".imap_last_error()."<br>\n";
} else {
    while (list ($key, $val) = each ($folders)) {
        echo $val."<br>\n";
    }
}

echo "<br>==========INBOX=============<br>";

$status = imap_status($mbox,"{my.host.com:143}INBOX",SA_ALL);
if($status) {
  print("Messages:   ". $status->messages   )."<br>\n";
  print("Recent:     ". $status->recent     )."<br>\n";
  print("Unseen:     ". $status->unseen     )."<br>\n";
  print("UIDnext:    ". $status->uidnext    )."<br>\n";
  print("UIDvalidity:". $status->uidvalidity)."<br>\n";
} else
  print "imap_status failed: ".imap_last_error()."\n";

echo "<p><h1>Headers in INBOX</h1>\n";
$headers = imap_headers ($mbox);

if ($headers == false) {
    echo "Call failed: ".imap_last_error()."<br>\n";
} else {
    while (list ($key,$val) = each ($headers)) {
        echo $val."<br>\n";
    }
}

imap_close($mbox);
?>

Result on PHP 4.0.6:
                                                    Mailboxes
{my.host.com:143}DRAFT
{my.host.com:143}INBOX
{my.host.com:143}SENT
==========INBOX=============
Messages: 67
Recent: 0
Unseen: 63
UIDnext: 4227
UIDvalidity:242664002

Headers in INBOX
1) 2-Feb-2002 user@my.host.com Subject1 (447 chars)
U 2) 3-Feb-2002 user@my.host.com Subject2 (455 chars)
U 3) 3-Feb-2002 user@my.host.com Subject3 (458 chars)
...
...
...

Result on PHP 4.1.1:

Mailboxes
{my.host.com:143}DRAFT
{my.host.com:143}INBOX
{my.host.com:143}SENT
==========INBOX=============
Messages: 67
Recent: 0
Unseen: 63
UIDnext: 4227
UIDvalidity:242664002

Headers in INBOX
Call failed:


phpinfo():

Configure Command './configure' '--with-oci8=/opt/ORCL/oracle/product/8.1.7' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-sigchild' '--with-imap=../pine4.44/imap' '--with-gd=../gd-1.8.4' '--with-png-dir=../gd-1.8.4' '--with-jpeg-dir=../jpeg-6b' '--with-zlib-dir=../zlib-1.1.3' '--without-mysql' '--disable-wddx' '--disable-xml' '--disable-posix' '--enable-ftp' '--with-recode'

IMAP Support      enabled
IMAP c-Client Version 2001


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-09 19:39 UTC] darek at my dot tenbit dot pl
I recompiled 4.1.1 with imap2000c. imap_headers() is working now, but phpinfo() reports my imap as "IMAP c-Client Version 4.1" :(
 [2002-02-10 05:57 UTC] sander@php.net
AFAIK, c-client 4.1 is the newest (stable) version. So that's OK.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 21:01:30 2025 UTC