Forum Moderators: coopster

Message Too Old, No Replies

How can i load a plain-text email with imap open().

         

BlackDex

8:57 am on Sep 4, 2008 (gmt 0)

10+ Year Member



Hello there,

I Am having trouble with imap_open() on my local (test) server.
I Can't seem to open the file, while this does work on the live server.

I keep getting the error: "Couldn't open stream /path/to/mail.eml: no such mailbox".

The file is accessable since i can open it with file_get_contents() and fopen() etc..

Does someone have an idea how i can fix this?

BlackDex

11:25 am on Sep 4, 2008 (gmt 0)

10+ Year Member



I have it fixed now.
The problem was a newer version of the libc-client200x.

In the older versions they allowed a full-path to the file.
In the newer versions they droped that because of security.

To fix this is relativly simple.

The imap_open() starts from the $HOME path.
What i do is, i set the $HOME path with putenv() to the location where the mail is located.

After that i can just give the filename to imap_open() and it will read the file.

Hope this can help some other ppl.