php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39880 imap_open('/localfile') fails
Submitted: 2006-12-18 22:29 UTC Modified: 2006-12-19 19:47 UTC
From: ceo at l-i-e dot com Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 5.2.0 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ceo at l-i-e dot com
New email:
PHP Version: OS:

 

 [2006-12-18 22:29 UTC] ceo at l-i-e dot com
Description:
------------
imap_open('/localfile', '', '')

fails on Windows, but works on Linux.

I get this in the error log for Windows:
[Mon Dec 18 16:18:56 2006] [error] [client 127.0.0.1] PHP Warning:  imap_open() [<a href='function.imap-open'>function.i
map-open</a>]: Couldn't open stream C:/www/complaints.com/data/testdos.mbox in C:\\www\\complaints.com\\imap_bug.php on
line 9
[Mon Dec 18 16:18:56 2006] [error] [client 127.0.0.1] PHP Notice:  Unknown: Can't open mailbox C:/www/complaints.com/dat
a/testdos.mbox: no such mailbox (errflg=2) in Unknown on line 0

Note that it's neither a path nor permissions problem, as fopen(..., 'r') and fgets() succeed.

Also note that it is not a cr/lf problem as the testunix.mbox and testdos.mbox files are identical except for ^M at the ends.

Linux happily works with either line-ending.
Windows just plain doesn't work.

The Linux box is running 5.1.4, while the Windows is running 5.2.0, so it *could* be a change from 5.1.4 to 5.2.0

Reproduce code:
---------------
http://acousticdemo.com/complaints/imap_bug.phps


Expected result:
----------------
Linux Output:
http://acousticdemo.com/complaints/imap_bug.php


Actual result:
--------------
Line 1 of testdos.mbox: From "Richard Lynch" Fri Dec 15 17:13:48 2006

Line 1 of testunix.mbox: From "Richard Lynch" Fri Dec 15 17:13:48 2006

Failed to imap_open(C:/www/complaints.com/data/testdos.mbox)
array(1) {
  [0]=>
  string(75) "Can't open mailbox C:/www/complaints.com/data/testdos.mbox: no such mailbox"
}
bool(false)
 messages in C:/www/complaints.com/data/testdos.mbox:

bool(false)
bool(false)



Failed to imap_open(C:/www/complaints.com/data/testunix.mbox)
bool(false)
array(1) {
  [0]=>
  string(76) "Can't open mailbox C:/www/complaints.com/data/testunix.mbox: no such mailbox"
}
 messages in C:/www/complaints.com/data/testunix.mbox:


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-19 09:07 UTC] tony2001@php.net
This is what I see - the underlying c-client function is unable to open a file. Right?
Why do you think it's PHP problem?
 [2006-12-19 19:28 UTC] ceo at l-i-e dot com
So I should be bugging the IMAP folks?

Some c-client (whatever that is) folks?

I have no idea what you're asking for, actually.

All I know is, the function works as documented in Linux, and fails to work as documented in Windows.

Doesn't seem like it should be rocket science to read a simple text file instead of opening up a network connection and all that...

What am I missing here?

I'm happy to take this issue elsewhere, but it's a Black Box to me, and imap_open() is my only doorway.
 [2006-12-19 19:47 UTC] tony2001@php.net
>Some c-client (whatever that is) folks?
Yes, as I doubt we can fix c-client on Windows.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 06:01:32 2024 UTC