MSGID, crossposting and dupes

Pablo Saratxaga (srtxg@linux.chanae.stben.be)
Mon, 10 Feb 1997 16:41:56 +0100 (MET)

Hello,

We have had several dupes here in Belgium lately; looking at the sources
I saw why.
Consider this case:

gateway A gates usenet.group.one --> FIDO-ONE
usenet.group.two --> FIDO-TWO
gateway B gates usenet.group.two --> FIDO-TWO only.

Well, a message arrives from usenet, whith a line
Newsgroups: usenet.group.one,usenet.group.two

At gateway A two messages, one for FIDO-ONE and one for FIDO-TWO are make
At gateway B only a message for FIDO-TWO is made.

Well, \1MSGID for message in FIDO-TWO area should be the same at gateway A and
gateway B. But it isn't !

in ifmail.c there is :

if (area_count > 1)
fmsg->msgid_n ^= crc(area->name);

If at a given gateway only a newsgroup is gated the line won't be executed,
the MSGID will be different than on a gateway that gates at least two groups
of the Newsgroups: line.
Shouldn't it be better to comment out the if ?

/* if (area_count > 1) */
fmsg->msgid_n ^= crc(area->name);

Of course that introduces an incompatibility whith previous versions, and
should be decided carefully. But IMHO it will avoid dupes.
Maybe we should even move the ^= crc(area->name); to the ftnmsgid() function ?
There is a little patch that does that, I tested it and MSGID/REPLY are
identical for a given area, no matter how many newsgroups crossposts are done
nor how many of them are gated.
But as I said previously for non crossposted messages and for crossposted ones
where only one newsgroup is gated the MSGID generated are not compatible and
REPLY are allways different as whith the current method. A good idea would
be to, enclose the code whith a test about a given date, instead against a
compile define; so at that date any ifnews in will be change, at the same time
worldwide. The problems due to the change will then be minimized.

There are the results of a test:

>before

a) gates only POLITIC.B
AREA:POLITIC.B
MSGID: chaos.kulnet.kuleuven.ac.be 24360afc
REPLY: chaos.kulnet.kuleuven.ac.be 587da913

b) gates BE.POLITC and POLITIC.B
AREA:BE.POLITICS
MSGID: chaos.kulnet.kuleuven.ac.be 40bc0b4c
REPLY: chaos.kulnet.kuleuven.ac.be 587da913
AREA:POLITIC.B
MSGID: chaos.kulnet.kuleuven.ac.be c7a3bbd7
REPLY: chaos.kulnet.kuleuven.ac.be 587da913

>after

a)
AREA:POLITIC.B
MSGID: chaos.kulnet.kuleuven.ac.be c7a3bbd7
REPLY: chaos.kulnet.kuleuven.ac.be bbe81838

b)
AREA:BE.POLITICS
MSGID: chaos.kulnet.kuleuven.ac.be 40bc0b4c
REPLY: chaos.kulnet.kuleuven.ac.be 3cf7a8a3
AREA:POLITIC.B
MSGID: chaos.kulnet.kuleuven.ac.be c7a3bbd7
REPLY: chaos.kulnet.kuleuven.ac.be bbe81838

As you cba see a MSGID/REPLY becomes the same for a given area.
Also the REPLY changing allow to point to the true originial message, in
the same AREA, whith the actual scheme a MSGID whith 587da913 would have
been created in a) but not in b), so the REPLYs in b) point to nowhere.

diff -u A/ifmail.c B/ifmail.c
--- A/ifmail.c Mon Feb 10 15:59:40 1997
+++ B/ifmail.c Mon Feb 10 16:07:55 1997
@@ -71,7 +71,11 @@
faddr *taddr;
char cflavor='\0',flavor;
fa_list *sbl = NULL;
+#ifndef NEW_MSGID
unsigned long svmsgid;
+#else
+ unsigned long svmsgid,svreply;
+#endif
char *outmode=NULL;

#if defined(HAS_SYSLOG) && defined(MAILLOG)
@@ -322,8 +326,14 @@
{
fmsg->area=area->name;
svmsgid=fmsg->msgid_n;
+#ifdef NEW_MSGID
+ svreply=fmsg->reply_n;
+ fmsg->msgid_n ^= crc(area->name);
+ fmsg->reply_n ^= crc(area->name);
+#else
if (area_count > 1)
fmsg->msgid_n ^= crc(area->name);
+#endif
if (putmessage(msg,fmsg,fp,route,flavor,&sbl))
{
logerr("Unable to put echo message into the packet, aborting");
@@ -332,6 +342,9 @@
if (usetmp) rewind(fp);
fmsg->area=NULL;
fmsg->msgid_n=svmsgid;
+#ifdef NEW_MSGID
+ fmsg->reply_n=svreply;
+#endif
msg_out++;
}
msg_in++;
diff -u A/mkftnhdr.c B/mkftnhdr.c
--- A/mkftnhdr.c Mon Feb 10 15:59:48 1997
+++ B/mkftnhdr.c Mon Feb 10 16:06:40 1997
@@ -29,10 +29,18 @@
extern unsigned long crc(char *);
extern int flagset(char *);

+#ifndef NEW_MSGID
int ftnmsgid(msgid,s,n)
char *msgid;
char **s;
unsigned long *n;
+#else
+int ftnmsgid(msgid,s,n,areaname)
+char *msgid;
+char **s;
+unsigned long *n;
+char *areaname;
+#endif
{
char *buf,*l,*r;
unsigned long nid;
@@ -87,6 +95,10 @@
*n=nid;
}
}
+#ifdef NEW_MSGID
+ if (areaname)
+ *n ^= crc(areaname);
+#endif

free(buf);
return ftnorigin;
@@ -308,7 +320,11 @@
else if ((p=hdr("Message-ID",msg)))
{
tmsg->ftnorigin &=
+#ifndef NEW_MSGID
ftnmsgid(p,&(tmsg->msgid_a),&(tmsg->msgid_n));
+#else
+ ftnmsgid(p,&(tmsg->msgid_a),&(tmsg->msgid_n),tmsg->area);
+#endif
}
else
{
@@ -332,7 +348,11 @@
}
if (p)
{
+#ifndef NEW_MSGID
(void)ftnmsgid(p,&(tmsg->reply_a),&(tmsg->reply_n));
+#else
+ (void)ftnmsgid(p,&(tmsg->reply_a),&(tmsg->reply_n),tmsg->area);
+#endif
}
else
{

-- 

A bientôt, Pablo Saratxaga

~ ~ :wq ;-) PGP Key available, key ID: 0x8F0E4975