473,231 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

argument is not a valid imap resource


I would like to access (open) my remote IMAP Mailbox with the
imap_open() function in PHP Version 5.0.4. The Mailbox is located at
the german provider freenet.de.

The imap_open() function does not produce an error message as you can
see below. But when I call the imap_headers() function the warning
message mentioned in the subject as well as below is returned.

Access to the same Mailbox with my mail/news programm gnus works.

I monitored the communication between my computer and freenet while I
was accessing the mailbox using gnus and while I tryed to access it
with the php script. I used tethereal for doing this. There is a
difference between the communication logs that could be
important. Using the php Script a relevant part of the communication
looks like this:

- PHP sends (Frame 21)
Internet Message Access Protocol
00000003 SELECT inbox.fab\r\n
Request Tag: 00000003
Request: SELECT inbox.fab

- freenet sends (Frame 22)
Internet Message Access Protocol
* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)\r\n
Response Tag: *
Response: FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)

- PHP sends (Frame 23)
00000004 LOGOUT\r\n
Request Tag: 00000004
Request: LOGOUT

- freenet sends (Frame 24)
* BYE Courier-IMAP server shutting down\r\n
Response Tag: *
Response: BYE Courier-IMAP server shutting down

Why does PHP send the "Request: LOGOUT" in Frame 23? Is that normal
behaviour? I am asking because the communication between gnus and
freenet differs from the communication shown above. I show you a small
part of this conversation as well.

- gnus sends (Frame 95)
Internet Message Access Protocol
4 SELECT "inbox.fab"\r\n
Request Tag: 4
Request: SELECT "inbox.fab"

- freenet sends (Frame 96)
* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)\r\n
Response Tag: *
Response: FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)

- gnus sends (Frame 98) (Frame 97 does not have anything to do with IMAP)
Request Tag: 5

- freenet sends
* SEARCH\r\n
Response Tag: *
Response: SEARCH

- and so on ...

Obviously gnus does not send the LOGOUT request after receiving the

Further information that I consider relevant follows at the end of
this message.

Thanx very much in advance for any hints.

Greetings, Fabian Müller

php code
$inbox = imap_open("{mx.freenet.de:143}inbox.fab", "UserName", "Password") || die(imap_errors());;
if ($inbox == false) {
echo "problem<br>";
} else {
echo "great<br>";
$mails = imap_headers($inbox);

output in my browser
Warning: imap_headers(): supplied argument is not a valid imap resource in mail_first.php on line 8

phpinfo() shows this among other things
'./configure' '--with-apxs2=/opt/httpd-2.0.54/bin/apxs'
'--with-libxml-dir=[Path to libxml2]'

Registered Stream Socket Transports: tcp, udp, unix, udg

Loaded Modules: mod_imap is listed

The info box about imap says that I have IMAP c-Client Version 2004
Jul 17 '05 #1
1 3229
Fabian Müller,

My suggestion on this imap problem would be to take a look at the open
source projects and see how there implementation works. See if it is
the same thing and works.

This is always a good place to start if you can't get a certain type of
thing to work.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: aa | last post by:
I use the following fragment of code to output datf from MySQL: ====================================================== $chan = mysql_connect ($db_host, $username, $password); mysql_select_db...
by: Steven Bethard | last post by:
I was wondering if there's any plans to add a "key" argument to max (and min) like was done for sort(ed)? I fairly often run into a situation where I have something like: counts = {} for item...
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
by: Ryanlawrence1 | last post by:
Heya, I get these 2 errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 20 You have not entered all the...
by: techjohnny | last post by:
Error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/jplane/certcent/phpweb/quiz/index.php on line 20 Warning: mysql_num_rows(): supplied argument is...
by: lsmamadele | last post by:
I am getting the following error messages in my search: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mamadele/public_html/BESTPLAYS/search.php on...
by: Breana | last post by:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/breana/public_html/category.php on line 88 ------------------------------------------- It does this...
by: bilibytes | last post by:
hi, i tried to create sort of a db abstraction layer in order to be able to change of database (Mysql | oracle | pg |...). i implemented that on a obejct oriented way. i made a sql factory in...
by: perhapscwk | last post by:
When I run my site from localhost, no error, but when I move it to webhosting, it show below error, why? Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in...
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.