IMAP and NNTP
| From: | {R}ichard Ashton | Date: | Mon, 28 Jul 2003 09:13:42 +0000 |
| Subject: | IMAP and NNTP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157144@lists.php.net to get a copy of this message | ||
The manual says that the majority of IMAP commands can be used for NNTP
access.
This code works fine.
$status =
imap_status($nntp,"{news.gradwell.net:119/nntp}#news.gradwell.
lists.test",SA_ALL);
if($status)
{
print("Messages: ". $status->messages )."<br>\n";
print("Recent: ". $status->recent )."<br>\n";
print("Unseen: ". $status->unseen )."<br>\n";
print("UIDnext: ". $status->uidnext )."<br>\n";
print("UIDvalidity:". $status->uidvalidity)."<br>\n";
This produces the following output.
Messages: 7
Recent: 7
Unseen: 7
UIDnext: 111
UIDvalidity:-1091568946
The 111 is reasonable as there are 6 messages on the server, numbered
104-109 on the server.
The code $msgno = imap_msgno($nntp, '106');
echo " msgno is: $msgno <br>\n";
outputs msgno is: 2
the inverse
$uidno = imap_uid($nntp, $msgno);
echo " uidno is: $uidno <br>\n";
outputs
Warning: Bad message number in /nfs1/corixa/webs/cgi-user/news/news.php
on line 60
uidno is:
So it appears that 106 looks up as 2, but 2 doesn't produce 106, but an
error instead.
Has anybody honestly used the IMAP functions to drive and NNTP server
or am I wasting my time.
{R}