Couldn't open stream {localhost/imap : 143} in /usr/local/httpd/htdocs/view.php
i'm somehow a newbie , i'm running a linux machine with redhat 9. i'm tryng to implement a site with email facilities. i've already compile php4.2.2 with the imap library .i can see that php 4.2.2 and the imap library has been correctly installed in my test.php file where i wrote <? phpinfo(); ?>.whenever i'm trying to open connection with the imap server i'm getting the following messages:
Warning: Couldn't open stream {localhost/imap : 143} in /usr/local/httpd/htdocs/view.php on line 4 Warning: imap_header(): supplied argument is not a valid imap resource in /usr/local/httpd/htdocs/view.php on line 5 From: To: Date: Subject: Warning: imap_body(): supplied argument is not a valid imap resource in /usr/local/httpd/htdocs/view.php on line 11 here are the contents of view.php : <?php $MAILSERVER="{localhost/imap : 143}"; $link=imap_open($MAILSERVER,$PHP_AUTH_USER,$PHP_AUTH_PW); $header=imap_header($link,$num); echo "From: $header[fromaddress]<br>"; echo "To: $header[toaddress]<br>"; echo "Date: $header[Date]<br>"; echo "Subject: $header[Subject]<br><br>"; echo imap_body($link,$num); ?> please i need your help . thanx in advance |
Do you have an IMAP server installed on this machine? If yes, which one?
|
i think it's the uw imap server. apart form the php-imap installation leme explain whatever i've done since i started :
in the redhat 9.0 there's a imap package i selected it then after the installation i went to the xinetd.d directory and in the imap file i set the disable option to no then i went to the xinetd.conf file i added the following line : imap stream tcp nowait root /usr/sbin/tcpd imapd. then i restarted the xinetd by doing the following : /etc/init.d/xinetd restart after restarting the xinetd services i tried to start the imapd typing the following : /usr/sbin/imapd but i got : * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN] dyn-10-213.nur.l ocal IMAP4rev1 2001.315rh at Mon, 20 Oct 2003 10:57:49 +0200 (CAT) * BYE Autologout; idle for too long. i don't really what's going wrong, but i think it should work. as far as i'm a newbie it seems very strange for me. thanx in advance mara for your help |
Hmm...The line you added to xinetd.conf file looks like inetd format, not xinetd's.
What happens when you have xientd running (with current configuration) when you run telnet localhost 143 |
can you tell me the xinetd's format?
when i run telnet localhost 143 i'm getting : Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused could you give me all the steps to make imap server running ? then i'll see if there is any steps that i've jumped over. thanx mara |
Delete the line you've added to /etc/xintetd.conf, then create a new file in /etc/xinetd.d directory (filename: 'imap', for example). Inside the file there should be something like this:
Code:
service imap |
i removed the lines i added in xinetd.conf, and there is already an imap file in the xinetd.d , i've already set the disable option to yes then what to do ?
thanx mara for your help |
Quote:
|
ok i set disable option to no and i've restarted xinetd , when i'm doing telnet localhost 143 , i'm getting the following :
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN] localhost.locald omain IMAP4rev1 2001.315rh at Thu, 23 Oct 2003 09:34:37 +0200 (CAT) * BYE Autologout; idle for too long Connection closed by foreign host. now what do i have to do ? thanx mara |
What happens when you set up a mail program to use IMAP from your server?
|
Couldn't open stream {localhost/imap : 143}
how can i set up a mail program to use IMAP from your
server?.may be i have already but i do'nt really know what i did , explain me in deep., thanx mara |
how can i set up a mail program to use IMAP from my
server?.may be i have already done but i do'nt really know that i did , explain me in deep., thanx mara |
this problem really seems to confuse me, it's the first time to get such problem.
thanx mara , i believe that your help will pay |
All times are GMT -5. The time now is 07:11 AM. |