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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-19-2003, 05:01 AM
|
#1
|
Member
Registered: Sep 2003
Posts: 30
Rep:
|
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
|
|
|
10-19-2003, 03:38 PM
|
#2
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
Do you have an IMAP server installed on this machine? If yes, which one?
|
|
|
10-20-2003, 04:02 AM
|
#3
|
Member
Registered: Sep 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
10-20-2003, 03:37 PM
|
#4
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
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
|
|
|
10-21-2003, 03:19 AM
|
#5
|
Member
Registered: Sep 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
10-21-2003, 03:28 PM
|
#6
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
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.
|
|
|
10-22-2003, 06:55 AM
|
#7
|
Member
Registered: Sep 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
10-22-2003, 03:01 PM
|
#8
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
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.
|
|
|
10-23-2003, 02:35 AM
|
#9
|
Member
Registered: Sep 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
10-24-2003, 12:37 PM
|
#10
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
What happens when you set up a mail program to use IMAP from your server?
|
|
|
10-24-2003, 02:11 PM
|
#11
|
Member
Registered: Sep 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
10-24-2003, 02:18 PM
|
#12
|
Member
Registered: Sep 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
10-24-2003, 02:23 PM
|
#13
|
Member
Registered: Sep 2003
Posts: 30
Original Poster
Rep:
|
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 06:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|