imap_open('/path/to/mbox', '', '')

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm having trouble with Windows imap_open.

I have the exact same mbox on a Linux box, with the exact same PHP
code opening it just fine.

I FTP (binary) to the Windows box (and a second time to be sure it
wasn't an FTP flake-out).

Opening the mbox in Windows yields a message like:
PHP Notice:
Unknown:
C:\\data\\mbox.excerpt (file C:\\data\\mbox.excerpt) is not in valid
mailbox format (errflg=2)

I can fopen and fread the same file just fine.

I've tried copying out just ONE email from the mbox.

I've been searching and reading quite a bit, but virtually all the
docs and examples are all about problems with connection to live IMAP
server, and very few even mention that one can open a local file mbox.

There is a User Contributed note at http://php.net/imap_open that says:
"...This specifies a mailbox in the default format (usually >Berkeley
format for most default library builds)..."

I now have 2 theories:

1. Windows IMAP is expecting a different newline in headers and/or
body of the mbox email. :-(

2. Windows build is not using "Berkeley format", whatever that is, and
I need to convert the mbox to "Berkeley format" or convince the DLL to
use whatever format it is that I have, which I have no idea what it
is...

Far as I can tell, the "format" of the mbox is just one raw email
message after another, with a blank line in between.

It was actually converted from MS Exchange .pst to mbox using the
(gasp) pst2mbox converter commonly known as readpst:
http://alioth.debian.org/projects/libpst/

Note that the resulting mbox works fine under Linux, so it seems
unlikely that the mbox itself is at fault.

So now to some questions:

There does not seem to be any choice with imap_open.

Is that because it can allegedly open *any* mailbox format, including
"Berkeley format" and mbox and whatever it is that I have?

Or is that because only an idiot like me would FTP an mbox from Un*x
to Windows and expect to open it, and I have to do something else to
it?

Is the mailbox format hard-wired into the PHP compilation?
I see no settings in php.ini for an [IMAP] section to change anything.

Would converting Un*x newlines to Windows on the entire mbox help?
Seems to me that the RFC is quite specific about the newlines of
headers and body, and converting the mbox in toto is unlikely to be
useful.

Guess I can try it on my tiny sample and find out, but even if it
worked, it would seem more like a bug than a feature, so I'm wanting
some input on this topic no matter how it pans out.

Can somebody point me to anything that would de-mystify (errflg = 2)
in the error message?
Obviously that '2' has SOME kind of meaning, but is that from PHP,
IMAP, Windows OS, File System, ...?


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux