Problem With Understanding Article Numbering And MessageID

Giganews Newsgroups
Subject: Problem With Understanding Article Numbering And MessageID
Posted by:  Francis Bishop (francis12…@fairpoint.net)
Date: Mon, 28 Jul 2008

using
Delphi 6 and
Delphi BDS2006
with Indy 10.2.3

I am a little confused on this issue.

When I retrieve a list of headers for a specific group

I can parse that data into an article number and a message ID along with
a few other fields.

My question concerns the use of the article number.

Is the article number consistent from one session to the next?
In other words if I connect up to a server from home in the morning
and later connect up to that same NNTP server from work in the evening
does the article number remain consistent. I appears to me that this is
generally the case.

I wonder if two different servers which carry the same newsgroups would
have the same article numbering.

I have found the message ID field to be an effective unique reference to
a specific news article and in general expect to use this.

So After Connecting and selecting a group I use GetArticle to Retrieve a
Individual Message

Thier are 9 Overloads On GetArticle

3 For TStream

3 For TString

3 For TIdMessage

depending on how I prefer to interact with Indy

I've chosen to use TIdMessage although I imagine if I was getting alot
of messages TStream might be faster.

Anyway

Why are their duplicate article numbers?

I have found a number of duplicate articles numbers tied to unique
messageid numbers.

atozedsoftware.indy.client.tcp

1244
1244- Duplicate
1245
....
1248
1248- Duplicate
1248- Duplicate
1249

atozedsoftware.indy.coders

155
156
156- Duplicate
157

atozedsoftware.indy.documentation

58
59
59- Duplicate
60

atozedsoftware.indy.protocol.ftp

884
885
885- Duplicate
886
....
910
911
911- Duplicate
911- Duplicate
912

My problem is that I seem to be able to use the message id for getting
articles for most news servers

news.digital-metaphors.com
newsgroups.borland.com
news.microsoft.com

yet I have to use the article id for this one

news.atozedsoftware.com

so I'm not sure if I need to use ?? for getting each article

sample code below (assumes 1 nntp component, 1 button TIdMessage created
dynamically)
------------

procedure TForm1.Button1Click(Sender: TObject);
var
  NewsServer    : string;
  NewsGroup    : string;
  NewsArticle  : integer;
  NewsMessageID : string;
  IdMessage1 : TIdMessage;
  IdMessage2 : TIdMessage;
begin

  NewsServer := 'news.atozedsoftware.com';
  NewsGroup  := 'atozedsoftware.indy.client.tcp';

  IdNNTP1.Host := NewsServer;

  IdMessage1 := TIdMessage.Create(self);
  IdMessage2 := TIdMessage.Create(self);

  IdNNTP1.Connect;

  IdNNTP1.SelectGroup(NewsGroup);

  //NewsMessageID := '<328750A441A6A5BABEgcaram…@abasrl.com>';
  // NewsMessageID := '<E75167C2AB17A8F8249Ametis_…@yahoo.co.uk>';
  NewsMessageID := '<C35B84E82DB8E240mark-ne…@quarella.co.uk>';

  NewsArticle := 1248;

// Test Case 1 Using MessageID        
// doesnt appear to work for news.atozedsoftware.com

  IdNNTP1.GetArticle(NewsMessageID, IdMessage1);

  IdMessage1.SaveToFile('Message1.txt');

    (*

// Test Case 2 Using Article No
// works for news.atozedsoftware.com but
// thier are multiple articles 1248

  IdNNTP1.GetArticle(NewsArticle, IdMessage2);

  IdMessage2.SaveToFile('Message2.txt');

    *)

  FreeAndNil(IdMessage1);
  FreeAndNil(IdMessage2);

  IdNNTP1.Disconnect;

  Memo1.Lines.Add('Done');

(*  other possible examples to use

group              'atozedsoftware.indy.client.tcp'
article number      1244
MessageID          '<5EAB8040BC44ADECCB58gcaram…@abasrl.com>'
MessageID          '<B7AB1B7007B8E240mark-ne…@quarella.co.uk>'

article number        1248
MessageID            '<328750A441A6A5BABEgcaram…@abasrl.com>'
MessageID            '<E75167C2AB17A8F8249Ametis_…@yahoo.co.uk>'
MessageID            '<C35B84E82DB8E240mark-ne…@quarella.co.uk>'

group                'atozedsoftware.indy.coders'
article number        156
MessageID            '<7FF2CF3681AB452327Bkir…@stonline.sk>'
MessageID            '<CB6C696B92B9E240no.spam@no.spam.com>'

*)

end;

------------------------------------

message results from individual files

when I use Test Case 1 Using MessageID        
  IdNNTP1.GetArticle(NewsMessageID, IdMessage1);

Date: Mon, 28 Jul 2008 14:30:02 +0000

..

------------------------------------

when I use
// Test Case 2 Using Article No
  IdNNTP1.GetArticle(NewsArticle, IdMessage2);
I get what I would expect

From: "Giovanni Caramia" <gcaram…@abasrl.com>
Subject: Re: Re: idTime
Date: Sat, 30 Dec 1899 04:00:00 +0000
Message-ID: <328750A441A6A5BABEgcaram…@abasrl.com>
References: <C1DD262CF43CDF46311gcaram…@abasrl.com>
  <FCB3D114F3B7E240no.spam@no.spam.com>
  <5EAB8040BC44ADECCB58gcaram…@abasrl.com>
<27FC2B5911B8E240no.spam@no.spam.com>
Lines: 27
Newsgroups: atozedsoftware.indy.client.tcp
User-Agent: ELK News Web
Content-Type: text/plain
In-Reply-To: <328750A441A6A5BABEgcaram…@abasrl.com>

>
> "Giovanni Caramia" <gcaram…@abasrl.com> wrote in message
> news:5EAB8040BC44ADECCB58gcaram…@abasrl.com...
>
> > I tried to use TIdTime and TIdSNTP as well.
> > But i need help!
>
> Such as?  Please be more specific.
>
> > IdTime1.host := 'time.nist.gov';
> > IdTime1.connect();
>
> You do not need to call Connect() and Disconnect() yourself.  SyncTime()
> does that internally for you.
>
> > i'm afraid this is not sufficient ...
>
> Please elaborate.  You did not say what the actual problem is.
>
>
> Gambit
Thanks, It works !!

I received error: 'Already Connected' because of IdTime1.Connect();

Thanks again
Giovanni Caramia

..

------------------------------------

Thanks for taking the time to listen

Frank

Replies