Re: Parsing mbox files with Windows Php (correction - ignore previous) [message #181729 is a reply to message #181727] |
Tue, 28 May 2013 00:20 |
Chuck Anderson
Messages: 63 Registered: September 2010
Karma:
|
Member |
|
|
Chuck Anderson wrote:
Been studying storing/retrieving tree structures in MySQL all day and
brain fried. I had the wrong folder names in my script in the previous
post. The corrected script and it's output is below (same result).
> Jerry Stuckle wrote:
>> On 5/25/2013 6:39 PM, Chuck Anderson wrote:
>>> Peter H. Coffin wrote:
>>>> On Fri, 24 May 2013 15:57:14 -0600, Chuck Anderson wrote:
>>>> > Unfortunately, it appears that the Windows Php binary is unable to
>>>> > connect to an mbox file, so to make my job easy, I would have to
>>>> > upload the entire folder structure (it is about 200MBs) to my shared
>>>> > host and process it there. I would much rather "toy around" with
>>>> > this process on my Windows development machine and not on the shared
>>>> > host.
>>>> >
>>>> > There is a Php bug filed for this, but it was determined that the
>>>> > "underlying c-client function is unable to open a file."
>>>> > https://bugs.php.net/bug.php?id=39880 - closed as "not a bug."
>>>> >
>>>> > $mbox = imap_open('pathto/mboxfile', '', '') // works on *nix, but
>>>> > not on Windows.
>>>> > - Notice: Unknown: Can't open mailbox mboxfiles/Inbox: no such
>>>> > mailbox (errflg=2) in Unknown on line 0.
>>>> > (This second error is the one coming from the underlying c-client
>>>> > function.)
>>>>
>>>> Okay, step one: quit munging stuff around and give us the EXACT code,
>>>> the EXACT contents of variables involved, and the EXACT error
>>>> messages.
>>>> You're not revealing national secrets by posting paths to
>>>> filenames, and
>>>> what the problem is may be in what you're changing to be more general.
>>>
On Windows
c:/localhost is the document root
c:/localhost/imap is where the Php scripts are located.
c:/localhost/imap/eml is where the mbox file "Trash" is located (a
Thunderbird mbox file)
Entire Contents of imap_open_eml.php
<?php
echo '<pre style="text-align: left;">';
imap_open('localhost/imap/eml/Trash', '', ''); // same as relative to
$HOME on *nix
imap_open('/imap/eml/Trash', '', ''); // absolute path from DOCUMENT_ROOT
imap_open('eml/Trash', '', ''); // relative path
imap_open('c:/localhost/imap/eml/Trash', '', ''); // real path on disk
echo '</pre>';
?>
---------- end imap_open_eml.php ------------
Resultant output:
Warning: imap_open(): Couldn't open stream localhost/imap/eml/Trash in C:\localhost\utilities\imap\imap_open_eml.php on line 5
Warning: imap_open(): Couldn't open stream /imap/eml/Trash in C:\localhost\utilities\imap\imap_open_eml.php on line 6
Warning: imap_open(): Couldn't open stream eml/Trash in C:\localhost\utilities\imap\imap_open_eml.php on line 7
Warning: imap_open(): Couldn't open stream c:/localhost/imap/eml/Trash in C:\localhost\utilities\imap\imap_open_eml.php on line 8
Notice: Unknown: Can't open mailbox localhost/imap/eml/Trash: no such
mailbox (errflg=2) in Unknown on line 0 Notice: Unknown: Can't open
mailbox /imap/eml/Trash: no such mailbox (errflg=2) in Unknown on line 0
Notice: Unknown: Can't open mailbox eml/Trash: no such mailbox
(errflg=2) in Unknown on line 0 Notice: Unknown: Can't open mailbox
c:/localhost/imap/eml/Trash: no such mailbox (errflg=2) in Unknown on
line 0
--
*****************************
Chuck Anderson • Boulder, CO
http://cycletourist.com
Turn Off, Tune Out, Drop In
*****************************
|
|
|