Basic NNTP Protocol

Be sure to read the "RKT couplings" below for additional information, comments, and links.

RFC977:[Previous][Up to Table of Contents] [Next]

RFC977 3.10. The POST command

RFC977 3.10.1.  POST


   If posting is allowed, response code 340 is returned to indicate that
   the article to be posted should be sent. Response code 440 indicates
   that posting is prohibited for some installation-dependent reason.

   If posting is permitted, the article should be presented in the
   format specified by RFC850, and should include all required header
   lines. After the article's header and body have been completely sent
   by the client to the server, a further response code will be returned
   to indicate success or failure of the posting attempt.

   The text forming the header and body of the message to be posted
   should be sent by the client using the conventions for text received
   from the news server:  A single period (".") on a line indicates the
   end of the text, with lines starting with a period in the original
   text having that period doubled during transmission.

   No attempt shall be made by the server to filter characters, fold or
   limit lines, or otherwise process incoming text.  It is our intent
   that the server just pass the incoming message to be posted to the
   server installation's news posting software, which is separate from
   this specification.  See RFC850 for more details.

   Since most installations will want the client news program to allow
   the user to prepare his message using some sort of text editor, and
   transmit it to the server for posting only after it is composed, the
   client program should take note of the herald message that greeted it
   when the connection was first established. This message indicates
   whether postings from that client are permitted or not, and can be
   used to caution the user that his access is read-only if that is the
   case. This will prevent the user from wasting a good deal of time
   composing a message only to find posting of the message was denied.
   The method and determination of which clients and hosts may post is
   installation dependent and is not covered by this specification.

RFC977 3.10.2.  Responses

   240 article posted ok
   340 send article to be posted. End with <CR-LF>.<CR-LF>
   440 posting not allowed
   441 posting failed

   (for reference, one of the following codes will be sent upon initial
   connection; the client program should determine whether posting is
   generally permitted from these:) 200 server ready - posting allowed
   201 server ready - no posting allowed
[Source:"RFC977"] [Last Changed:February 1986]
[Copyright: 1986 Brian Kantor, Phil Lapsley]

RFC977:[Previous][Up to Table of Contents] [Next]

(Corrections, notes, and links for Usenet RKT.)
by Mib Software, INN customization and consulting

Note that all RFC977 2.4.3. General Responses may also be received.
RFC850 is obsoleted by RFC1036

More Detailed Topics
NNTP-Ext 4.2 The Required Headers in an Article and the POST command
RFC977 4.4. Example 4 - posting a news article

Don't reinvent the wheel! The Libmib_NNTP functions do all of the NNTP work for you.
The code to POST message data from stdin to an NNTP server is this simple, and runs under Unix or Windows:

#include <stdio.h>
#include <libmib/comm.h>

void *_pPR_ = 0;
void *conn;

    	PVNETWORK *pNetwork = ILibmibNetwork_GetNetwork();
    	if (ILibmibNetwork_Startup(pNetwork)) {
		PR_CRIT(TSD(0,"FXXXX Network not ready\n"));
    	void *conn = Libmib_NNTP_GetConnection(pNetwork,"",_pPR_);

} /* main */

Overview and Related Topics
Up to: RFC977 3. Command and Response Details
NNTP Command Syntax
NNTP Response Syntax
RFC977 3.4. The IHAVE command

RKT Rapid-Links:[Search] [RKT Tips] Path:For Developers / NNTProtocol / RFC977 3. Command and Response Details / 0027.htm