473,396 Members | 2,002 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,396 software developers and data experts.

argument is not a valid imap resource

Hello,

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)
5 UID SEARCH UNSEEN UNDELETED\r\n
Request Tag: 5
Request: UID SEARCH UNSEEN UNDELETED

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

- and so on ...

Obviously gnus does not send the LOGOUT request after receiving the
FLAGS.

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
--------------------
great
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-mysql=/usr/local/mysql-standard-4.0.20-pc-linux-i686'
'--with-libxml-dir=[Path to libxml2]'
'--without-iconv'
'--with-imap=/usr/local/imap-2004d/'

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
installed.
Jul 17 '05 #1
1 3243
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.

Mike
Jul 17 '05 #2

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

Similar topics

6
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...
6
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...
2
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....
4
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...
2
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...
1
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...
11
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...
2
bilibytes
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...
2
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.