Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Aug : NNTP IHave and Post

www.cryer.info
Managed Newsgroup Archive

NNTP IHave and Post

Subject:NNTP IHave and Post
Posted by:"Bill Miller" (w2m..@hicomponents00.com)
Date:Mon, 20 Aug 2007 11:10:05

I have developed a newsreader using Synapse nttpSend that allows me to read
headers and message bodies.  I am now attempting to try to add posing a
message to the application.  I have not been able to find a good explanation
as to how to post a message to a newsgroup using NTTP.  So I tried calling
this to post a message:

ntp.Login; // log in to server
ntp.SelectGroup( Community ); // select a community
IHaveResult := ntp.IHave( MessageID ); // advise server that i have a
message to post
// Add the header and message body
ntp.Data.Add( FrmEditMessage.From1.Text );
ntp.Data.Add( FrmEditMessage.Subject1.Text );
ntp.Data.Add( FrmEditMessage.Newsgroup1.Text );
ntp.Data.Add( FrmEditMessage.Distributon1.Text );
ntp.Data.Add( FrmEditMessage.Path1.Text );
ntp.Data.Add( FrmEditMessage.Date1.Text );
ntp.Data.Add( MessageID );
ntp.Data.Add( FrmEditMessage.Body1.Text );
PostedArticle := ntp.PostArticle; // post the article

But ntp.IHave returns "transfer permission denied".

What should be contained in the MessageID string?
Should the message header and body of the message be added to ntp.Data
string list before calling IHave or after?
I assume that when ntp.PostArticle is called it gets the header and body
from ntp.Data?

I read on the internet that the header should have this format:
ntp.Data.Add( 'Path: "not-for-mail" ' );
ntp.Data.Add( 'Sender: Reply-to: From: system/user/email' );
ntp.Data.Add( 'Subject: "Test message"' );
ntp.Data.Add( 'Newsgroups: "alt.test"' );
ntp.Data.Add( 'Message-ID: none');
ntp.Data.Add( 'Organization: "Docs For All"' );
ntp.Data.Add( 'Keywords: "Test"' );
ntp.Data.Add( 'Summary: "A test message"' );

What should be placed in ntp data?
Should ntp.Data be filled before calling  ntp.IHave?

Anyone have any quick tips?

Regards,

Bill

Replies:

www.cryer.info
Managed Newsgroup Archive