Is Cyrus nntpd "LAST" command per RFC?

Lars Kellogg-Stedman lars at oddbit.com
Sat Nov 12 09:01:37 EST 2005


Hey folks,

I'm writing an application in which I'd like to be able to retrieve the 
last <n> messages from a newsgroup hosted on a Cyrus nntp server.  I 
figured I could use the ARTICLE command to select the last article in 
the group and then use the LAST command to step backwards an appropriate 
number of articles.  Unfortunately, this results in an error:

  C: GROUP my.group
  S: 211 5 6 22 my.group
  C: ARTICLE 22
  S: 220 22 <...message id...>
  S: ...article contents...
  S: .
  C: LAST
  S: 422 No previous article in this group

The RFC implies this ought to work -- the ARTICLE command is supposed to 
update the "current article pointer", and the description of the LAST 
command says:

  The internally maintained "current article pointer" is set
  to the previous article in the current newsgroup. If already 
  positioned at the first article of the newsgroup, an error 
  message is returned and the current article remains selected.

So, is this a bug?  Or just a poorly specified RFC (it doesn't 
*explicitly* state that you have to use NEXT before you use LAST, but 
neither does it state the opposite).

There are obviously other solutions to my particular goal (e.g., using 
XOVER or LISTGROUP to get a list of valid messages), and I'll go with 
one of those right now.

-- Lars




More information about the Info-cyrus mailing list