LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2003, 05:01 AM   #1
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Rep: Reputation: 15
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
 
Old 10-19-2003, 03:38 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Do you have an IMAP server installed on this machine? If yes, which one?
 
Old 10-20-2003, 04:02 AM   #3
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 10-20-2003, 03:37 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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
 
Old 10-21-2003, 03:19 AM   #5
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 10-21-2003, 03:28 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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).

Last edited by Mara; 10-21-2003 at 03:32 PM.
 
Old 10-22-2003, 06:55 AM   #7
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 10-22-2003, 03:01 PM   #8
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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)

Last edited by Mara; 10-22-2003 at 03:03 PM.
 
Old 10-23-2003, 02:35 AM   #9
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 10-24-2003, 12:37 PM   #10
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
What happens when you set up a mail program to use IMAP from your server?
 
Old 10-24-2003, 02:11 PM   #11
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 10-24-2003, 02:18 PM   #12
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 10-24-2003, 02:23 PM   #13
nshoboul
Member
 
Registered: Sep 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/libaprutil-0.so. bijuhpd Linux - Newbie 1 10-30-2005 05:07 PM
php error failed to open stream mhatre kedar Linux - Newbie 2 03-20-2005 03:47 PM
Apache/PHP - failed to open stream ridertech Linux - Software 1 08-10-2004 09:38 PM
no php.ini file under /usr/local/lib/ !! jogurt666 Linux - Software 1 12-16-2003 12:06 AM
IMAP port 143 ... and I'm an I-dot onescrewloose13 Linux - General 2 09-19-2003 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration