Subject: PHP, imap_open, NNTP and Auth

From: Thierry Thomas <[email-masked]>
Date: Thu, 3 Oct 2002 22:40:46 +0200

Hello,

I am using imap_open (from PHP4) to get Usenet post from an NNTP server,
and it runs fine with this imap_open:

imap_open("{localhost:143/imap/notls}{localhost:119/nntp}group",
     "imapuser", "imappass", OP_HALFOPEN)

But I cannot find the good syntax to connect to an NNTP server if an
authentication is needed.

The following command:

imap_open("{localhost:143/imap/notls}{nntpuser:nntppass@localhost:119/nntp}group",
     "imapuser", "imappass", OP_HALFOPEN)

seems correct and return a resource, but with this resource
imap_getmailboxes does not find anything.

How could I pass nntpuser and nntppass?

Regards,
-- 
Th. Thomas.
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Thu, 3 Oct 2002 14:31:32 -0700 (Pacific Daylight Time)

I do not have anything to do with PHP, but I hope that "imap_open" is some
sort of PHP operation and *NOT* a call to the c-client imap_open()
function which is strictly internal to c-client.

>      "imapuser", "imappass", OP_HALFOPEN)

This strongly suggests that this imap_open is not the same as the c-client
imap_open() function.  Anyway, it looks like the first argument is a
c-client mailbox name.  If so, you are stipulating a proxy open via IMAP.
Is there some reason why you are doing this, instead of a direct NNTP
session?  That is, why aren't you using
	{localhost/nntp}group

Anyway, because you are using OP_HALFOPEN, you are just opening an IMAP
connection without ever doing anything with NNTP.

Is there some reason why you are specifying the port number?  c-client
knows the correct port number to you.

> imap_getmailboxes does not find anything.

Once again, this is only getting you an open IMAP session not open on any
mailbox, because you are using OP_HALFOPEN.

If you want to specify a user name, the syntax is /user=, as in:
	{localhost/nntp/user=nntpuser}group

There is no way to pass a separate NNTP password if you insist upon using
a separate proxy via IMAP.

Furthermore, note that the use of an IMAP proxy is a UW imapd (c-client
imapd) feature, and is not likely to be offered on any other IMAP server.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.

---

From: Thierry Thomas <[email-masked]>
Date: Fri, 4 Oct 2002 00:46:57 +0200

> session?  That is, why aren't you using

This way, c-client handles a .newsrc file. Without imap proxying, it does
not.

> connection without ever doing anything with NNTP.

I'm using imap_getmailboxes / imap_getsubscribed, imap_headerinfo,
imap_fetchbody (all PHP functions), etc. for a web-based newsreader, and
OP_HALFOPEN is working.

> knows the correct port number to you.

Yes, but actually these are parameters...

> 	{localhost/nntp/user=nntpuser}group

OK.

> a separate proxy via IMAP.

I had tried with /authuser=nntppass without success! That's a problem
for me.

> imapd) feature, and is not likely to be offered on any other IMAP server.

Thanks for your answers.
-- 
Th. Thomas.