I am trying to post the same message to selected newsgroups, but I am
able to post the body of the message only to the first one. Here is
the relevant part of my code:
~
IFl = new File(aIFl); aIFl = IFl.getAbsolutePath();
if(IFl.exists()){
FRdr = new FileReader(IFl);
// __
if((aNewsGroup != null) && (aNewsGroup.length > 0)){
for(int iNG = 0; (iNG < aNewsGroup.length); ++iNG){
// __
SimpleNNTPHdr = new SimpleNNTPHeader(aFrom, aSubject);
SimpleNNTPHdr.addNewsgroup(aNewsGroup[iNG]);
if(aOrg != null && aOrg.length() > 0){
SimpleNNTPHdr.addHeaderField("Organization", aOrg); }
if(aRefs != null && aRefs.length() > 0){
SimpleNNTPHdr.addHeaderField("References", aRefs); }
// __ In-Reply-To:
if(aReply2 != null && aReply2.length() > 0){
SimpleNNTPHdr.addHeaderField("In-Reply-To", aReply2); }
SimpleNNTPHdr.addHeaderField("X-Newsreader", "NetComponents");
// __
NNTPClnt = new NNTPClient();
NNTPClnt.addProtocolCommandListener(new PrintCommandListener(new
PrintWriter(System.err)));
NNTPClnt.connect(aSrvr);
if(!NNTPReply.isPositiveCompletion(NNTPClnt.getReplyCode())){
NNTPClnt.disconnect(); System.err.println("NNTP " + aSrvr + "
refused connection!");
}
if(NNTPClnt.isAllowedToPost()){
Writer Wrtr = NNTPClnt.postArticle();
if(Wrtr != null){
Wrtr.write(SimpleNNTPHdr.toString());
Util.copyReader(FRdr, Wrtr);
Wrtr.close();
NNTPClnt.completePendingCommand();
}
}
// __
NNTPClnt.logout();
NNTPClnt.disconnect();
}// iNG
}// ((aNewsGroup != null) && (aNewsGroup.length > 0))
// __
FRdr.close();
}// (IFl.exists())
~
and the response of the NNTP server I use:
~
200 nntp.aceinnovative.com NNTPCache server V3.0.1 [see
www.nntpcache.org] (c) 1996-2002 Julian Assange <[email protected]> May 24
2006 ready (posting ok, 109387 groups available).
POST
340 Ok
441 Article has no body -- just headers
QUIT
205
~
What is wrong with the code? How can I fix that problem?
~
Thank you
lbrtchx
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]