LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Couldn't open stream {localhost/imap : 143} in /usr/local/httpd/htdocs/view.php (https://www.linuxquestions.org/questions/linux-newbie-8/couldnt-open-stream-%7Blocalhost-imap-143%7D-in-usr-local-httpd-htdocs-view-php-105819/)

nshoboul 10-19-2003 05:01 AM

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

Mara 10-19-2003 03:38 PM

Do you have an IMAP server installed on this machine? If yes, which one?

nshoboul 10-20-2003 04:02 AM

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

Mara 10-20-2003 03:37 PM

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

nshoboul 10-21-2003 03:19 AM

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

Mara 10-21-2003 03:28 PM

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
{
        socket_type    = stream
        protocol        = tcp
        user            = root
        wait            = no
        disable        = no

The code above may be wrong (I don't use xinetd very often). You can read the format description when you type 'man xinetd.conf' (if it doesn't work as a normal user, try as root).

nshoboul 10-22-2003 06:55 AM

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

Mara 10-22-2003 03:01 PM

Quote:

i've already set the disable option to yes
To yes? It should be no. When it's done, restard xinetd and try if it works (telnet localhost 143)

nshoboul 10-23-2003 02:35 AM

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

Mara 10-24-2003 12:37 PM

What happens when you set up a mail program to use IMAP from your server?

nshoboul 10-24-2003 02:11 PM

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

nshoboul 10-24-2003 02:18 PM

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

nshoboul 10-24-2003 02:23 PM

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.