imap_open() error. (Can't open mailbox)

View: New views
8 Messages — Rating Filter:   Alert me  

imap_open() error. (Can't open mailbox)

by Mathijs van Veluw-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello there,

i use imap to read incoming mail from the the SMTP server.
On the live server everythings works as it should.
I can use imap_open('/path/to/file', '', ''), to read just one raw-mail.
On my test env i can't get this to work.

I get the error message: "Can't open mailbox".
While on the live server it works and i get the correct resource "resource(42) of type (imap)".

I realy don't know what the problem is.
Can someone help me with this?

Thanks in advance.
Mathijs.

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


Re: imap_open() error. (Can't open mailbox)

by Thijs Lensselink :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quoting Mathijs van Veluw <mathijs.van.veluw@...>:

> Hello there,
>
> i use imap to read incoming mail from the the SMTP server.
> On the live server everythings works as it should.
> I can use imap_open('/path/to/file', '', ''), to read just one raw-mail.
> On my test env i can't get this to work.
>
> I get the error message: "Can't open mailbox".
> While on the live server it works and i get the correct resource
> "resource(42) of type (imap)".
>
> I realy don't know what the problem is.
> Can someone help me with this?
>
> Thanks in advance.
> Mathijs.
>

I didn't work with IMAP much. So one suggestion could be to check if  
your dev box is behind a proxy server. If you're using SSL check if  
it's enabled on your dev box.



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


Re: imap_open() error. (Can't open mailbox)

by Mathijs van Veluw-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thijs Lensselink wrote:

> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
>
>> Hello there,
>>
>> i use imap to read incoming mail from the the SMTP server.
>> On the live server everythings works as it should.
>> I can use imap_open('/path/to/file', '', ''), to read just one raw-mail.
>> On my test env i can't get this to work.
>>
>> I get the error message: "Can't open mailbox".
>> While on the live server it works and i get the correct resource
>> "resource(42) of type (imap)".
>>
>> I realy don't know what the problem is.
>> Can someone help me with this?
>>
>> Thanks in advance.
>> Mathijs.
>>
>
> I didn't work with IMAP much. So one suggestion could be to check if
> your dev box is behind a proxy server. If you're using SSL check if it's
> enabled on your dev box.
>
>
the imap_open() only gets a file location.
This file containts a raw-mail, so no need for ssl or proxy stuff etc..

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


Re: imap_open() error. (Can't open mailbox)

by Thijs Lensselink :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quoting Mathijs van Veluw <mathijs.van.veluw@...>:

> Thijs Lensselink wrote:
>> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
>>
>>> Hello there,
>>>
>>> i use imap to read incoming mail from the the SMTP server.
>>> On the live server everythings works as it should.
>>> I can use imap_open('/path/to/file', '', ''), to read just one raw-mail.
>>> On my test env i can't get this to work.
>>>
>>> I get the error message: "Can't open mailbox".
>>> While on the live server it works and i get the correct resource
>>> "resource(42) of type (imap)".
>>>
>>> I realy don't know what the problem is.
>>> Can someone help me with this?
>>>
>>> Thanks in advance.
>>> Mathijs.
>>>
>>
>> I didn't work with IMAP much. So one suggestion could be to check  
>> if your dev box is behind a proxy server. If you're using SSL check  
>>  if it's enabled on your dev box.
>>
>>
> the imap_open() only gets a file location.
> This file containts a raw-mail, so no need for ssl or proxy stuff etc..
>

It doesn't give a file location. it creates a resource. This resource  
you can use to retrieve the data.

SSL is no option like you said. I would at least check the proxy. I'm  
behind a proxy here also. And for remote communication i use a proxy  
class.

Maybe somebody else on the list can point you in the right direction.





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


Re: imap_open() error. (Can't open mailbox)

by Mathijs van Veluw-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thijs Lensselink wrote:

> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
>
>> Thijs Lensselink wrote:
>>> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
>>>
>>>> Hello there,
>>>>
>>>> i use imap to read incoming mail from the the SMTP server.
>>>> On the live server everythings works as it should.
>>>> I can use imap_open('/path/to/file', '', ''), to read just one
>>>> raw-mail.
>>>> On my test env i can't get this to work.
>>>>
>>>> I get the error message: "Can't open mailbox".
>>>> While on the live server it works and i get the correct resource
>>>> "resource(42) of type (imap)".
>>>>
>>>> I realy don't know what the problem is.
>>>> Can someone help me with this?
>>>>
>>>> Thanks in advance.
>>>> Mathijs.
>>>>
>>>
>>> I didn't work with IMAP much. So one suggestion could be to check  if
>>> your dev box is behind a proxy server. If you're using SSL check  if
>>> it's enabled on your dev box.
>>>
>>>
>> the imap_open() only gets a file location.
>> This file containts a raw-mail, so no need for ssl or proxy stuff etc..
>>
>
> It doesn't give a file location. it creates a resource. This resource
> you can use to retrieve the data.
>
> SSL is no option like you said. I would at least check the proxy. I'm
> behind a proxy here also. And for remote communication i use a proxy class.
>
> Maybe somebody else on the list can point you in the right direction.
>
>
>
>

Ill explain it a bit more better.
I have a file with something like the contents at the bottom (without the --).
Now on my live server i can use: <?php $imapResource = imap_open('/path/to/file-with-contents-at-bottom', '', ''); ?>.
This works like a charm, and i can use that resource to extract the information of that contents of that file.

Now if i use that same script on my test server, it doesn't work anymore.
And i get the following error: "Warning: imap_open() [function.imap-open]: Couldn't open stream /path/to/file-with-contents-at-bottom in ...".
This file is located (for example) in the document_root of the web server.
While on the live server the $imapResource is an 'resource(42) of type (imap)'.

So i wonder how i can fix this imap_open() problem.

Im sorry if i don't understand your response very well if that could be the solution.

Thx in advanced.

-------------------------------------------------------
        Delivered-To: address@...
        Received: by 10.0.0.1 with SMTP id xxxxxxxxxxxxx;
                Sun, 8 Jun 2008 02:00:12 -0700 (PDT)
        Received: by 10.0.0.1 with SMTP id xxxxxxxxxxxxxxx.1111111111111111;
                Sun, 08 Jun 2008 02:00:11 -0700 (PDT)
        Return-Path: <return@...>
        Received: from smtp.mail.com (smtp.mail.com [10.0.0.1])
                by mx.mail.com with ESMTP id xxxxxxxxxxxxxxx.222222222222222222222;
                Sun, 08 Jun 2008 02:00:11 -0700 (PDT)
        Received: from 10.0.0.1 (smtp.mail.com [10.0.0.1])
                by smtp.mail.com (8.13.1/8.13.1) with SMTP id xxxxxxxxxxxxxx
                for address@...; Sun, 8 Jun 2008 11:00:05 +0200
        Date: Sun, 8 Jun 2008 11:00:05 +0200
        Message-Id: <200806080900.xxxxxxxxxxxxxx@...>
        Reply-To: name <reply@...>
        From: from <from@...>
        To: to <to@...>
        Subject: Subject
        Content-Type: text/plain; charset=utf-8
        Content-Transfer-Encoding: 8bit
        MIME-Version: 1.0
       
        This is my mail blah blah blah
        Blah blah blah blah foobar etc.. etc...
       
       
-------------------------------------------------------

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


Re: imap_open() error. (Can't open mailbox)

by Michael Kubler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

File Permissions? PHP safe mode?
Mail server locking the file?

Can you >/tail /path/to/file-with-contents-at-bottom /  ??

Michael Kubler
*G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>



Mathijs van Veluw wrote:

>>>>>
>>>>> I get the error message: "Can't open mailbox".
>>>>> While on the live server it works and i get the correct resource
>>>>> "resource(42) of type (imap)".
>>>>>
>>>>> I realy don't know what the problem is.
>>>>> Can someone help me with this?
>>>>>
>>>>> Thanks in advance.
>>>>> Mathijs.

RE: imap_open() error. (Can't open mailbox)

by Edward Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



> -----Original Message-----
> From: Thijs Lensselink [mailto:dev@...]
> Sent: 09 June 2008 13:43
> To: php-general@...
> Subject: Re: [PHP] imap_open() error. (Can't open mailbox)
>
>
> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
>
> > Thijs Lensselink wrote:
> >> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
> >>
> >>> Hello there,
> >>>
> >>> i use imap to read incoming mail from the the SMTP server.
> >>> On the live server everythings works as it should.
> >>> I can use imap_open('/path/to/file', '', ''), to read just
> one raw-mail.
> >>> On my test env i can't get this to work.
> >>>
> >>> I get the error message: "Can't open mailbox".
> >>> While on the live server it works and i get the correct resource
> >>> "resource(42) of type (imap)".
> >>>
> >>> I realy don't know what the problem is.
> >>> Can someone help me with this?
> >>>
> >>> Thanks in advance.
> >>> Mathijs.
> >>>
> >>
> >> I didn't work with IMAP much. So one suggestion could be to check
> >> if your dev box is behind a proxy server. If you're using SSL check
> >>  if it's enabled on your dev box.
> >>
> >>
> > the imap_open() only gets a file location.
> > This file containts a raw-mail, so no need for ssl or proxy stuff etc..
> >
>

Have you checked the permissions on the mail file? Are your dev and live
boxes both running PHP in the same manner (Apache module vs CGI)? Can you
open the same file with fopen?

Edward


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


Re: imap_open() error. (Can't open mailbox)

by Mathijs van Veluw-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Edward Kay wrote:

>
>> -----Original Message-----
>> From: Thijs Lensselink [mailto:dev@...]
>> Sent: 09 June 2008 13:43
>> To: php-general@...
>> Subject: Re: [PHP] imap_open() error. (Can't open mailbox)
>>
>>
>> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
>>
>>> Thijs Lensselink wrote:
>>>> Quoting Mathijs van Veluw <mathijs.van.veluw@...>:
>>>>
>>>>> Hello there,
>>>>>
>>>>> i use imap to read incoming mail from the the SMTP server.
>>>>> On the live server everythings works as it should.
>>>>> I can use imap_open('/path/to/file', '', ''), to read just
>> one raw-mail.
>>>>> On my test env i can't get this to work.
>>>>>
>>>>> I get the error message: "Can't open mailbox".
>>>>> While on the live server it works and i get the correct resource
>>>>> "resource(42) of type (imap)".
>>>>>
>>>>> I realy don't know what the problem is.
>>>>> Can someone help me with this?
>>>>>
>>>>> Thanks in advance.
>>>>> Mathijs.
>>>>>
>>>> I didn't work with IMAP much. So one suggestion could be to check
>>>> if your dev box is behind a proxy server. If you're using SSL check
>>>>  if it's enabled on your dev box.
>>>>
>>>>
>>> the imap_open() only gets a file location.
>>> This file containts a raw-mail, so no need for ssl or proxy stuff etc..
>>>
>
> Have you checked the permissions on the mail file? Are your dev and live
> boxes both running PHP in the same manner (Apache module vs CGI)? Can you
> open the same file with fopen?
>
> Edward
>

The file is accessable, and they both run using the apache2 module etc..
Both have the same version PHP and same IMAP version.

So i find it strange.

For the output see my last post.

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