RFC977:[Previous][Up to Table of Contents] [Next]
RFC977 3.10. The POST command |
---|
RFC977 3.10.1. POST 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] |
#include <stdio.h> #include <libmib/comm.h> main() { void *_pPR_ = 0; void *conn; PVNETWORK *pNetwork = ILibmibNetwork_GetNetwork(); if (ILibmibNetwork_Startup(pNetwork)) { PR_CRIT(TSD(0,"FXXXX Network not ready\n")); exit(-1); } void *conn = Libmib_NNTP_GetConnection(pNetwork,"news.domain.com",_pPR_); Libmib_NNTP_PostFile(conn,stdin,0,_pPR_); ILibmibNetworkconn_Writesz(conn,"quit\r\n"); ILibmibNetworkconn_CloseConn(conn); ILibmibNetwork_Cleanup(pNetwork); } /* main */