Re: Parsing mbox files with Windows Php [message #181738 is a reply to message #181731] |
Tue, 28 May 2013 22:08 ![Go to previous message Go to previous message](/forum/theme/default/images/up.png) |
Christoph Becker
Messages: 91 Registered: June 2012
Karma:
|
Member |
|
|
Chuck Anderson wrote:
> Not quite yet. I might get this.
I was able to build the IMAP extension under Cygwin. I exported some
news with the Thunderbird Add-On ImportExportTools to a file in mbox
format and copied that to my home directory.
$ php -r '$imap=imap_open("test.mbox", "",
"");var_dump(imap_check($imap));'
object(stdClass)#1 (5) {
["Date"]=>
string(31) "Tue, 28 May 2013 23:53:42 +0200"
["Driver"]=>
string(4) "unix"
["Mailbox"]=>
string(19) "/home/cmb/test.mbox"
["Nmsgs"]=>
int(11)
["Recent"]=>
int(0)
}
The driver is reported as "unix"! In PHP 5.4.15 in ext/imap/php_imap.c
line 839[1] this driver is linked in only, if the system is not Win32
(PHP_WIN32).
imap_open()ing an Inbox of Thunderbird directly reports the "dummy"
driver and 0 messages (same as for an empty file).
So the solution to be able to read Thunderbird mailboxes under Windows
might to be to export them to a format that is handled by the "mbx"
driver. I do not know, how this can be accomplished.
[1] <http://lxr.php.net/xref/PHP_5_4/ext/imap/php_imap.c#839>
--
Christoph M. Becker
|
|
|