Message-ID code for ifmail

Pablo Saratxaga (srtxg@linux.chanae.stben.be)
Wed, 14 May 1997 14:12:39 +0200 (MET DST)

Hello,

there is a little patch that adds proper handling of MSGID -> Message-ID
conversion for some supplementary cases.

--- work/ifmail-2.10/ifgate/mkrfcmsg.c Sat Apr 26 11:55:18 1997
+++ ifmail/ifgate/mkrfcmsg.c Wed May 14 14:02:33 1997
@@ -49,7 +49,13 @@
}
if (id != 0L)
{
- if (ta)
+ /* if we only check for (ta) a Message-ID like
+ * <123456.7890@internet.domain> will be recognized as
+ * a fidonet one (ta->node=123456, ta->point=7890,
+ * ta->domain="internet", but ta->net=0) which obviously
+ * isn't the case. By cheking also (ta->net) we avoid that
+ */
+ if ((ta) && (ta->net))
{
sprintf(buf,"<%lu@%s.ftn>",id,ascinode(ta,0x1f));
}
@@ -57,7 +63,26 @@
{
p=xstrcpy(msgid);
if ((q=strchr(p,' '))) *q='\0';
- sprintf(buf,"<%lu@%s>",id,p);
+/* ### Modified by P.Saratxaga on 18 Aug 1995 */
+ if (strstr(p,"@")) {
+ /* "mid__local@domain" are generated by gigo */
+ if (!strncmp(p,"mid__",5))
+ sprintf(buf,"<%s>",p+5);
+ /* in case we have "<local@domain>" */
+ else if (!strncmp(p,"<",1))
+ sprintf(buf,"%s",p);
+ /* or "local@domain" */
+ else sprintf(buf,"<%s>",p);
+ while ((q = strchr(buf, '@')) != strrchr(buf, '@'))
+ {
+ /* we (still) have more than one @ */
+ *q = '%';
+ }
+ }
+ else
+ {
+ sprintf(buf,"<%lu@%s>",id,p);
+ }
free(p);
}
}
@@ -450,6 +475,26 @@
else if ((p=hdr("Message-ID",kmsg)))
fprintf(pip,"Message-ID: %s",p);
else if ((p=hdr("RFCID",kmsg)))
+ if ((p[0]=='<')) {
+ /* "^aRFCID: <local@machine>" */
+ if ((p[strlen(p)-2]=='>'))
+ fprintf(pip,"Message-ID: %s",p);
+ /* "^aRFCID: <local@machine" */
+ /* I saw it on some IntToss gated articles
+ * it seems to be a bug on the program or something
+ * like that, because in the majority of IntToss gated
+ * articles it is "^aRFCID: local@machine"
+ */
+ else { p[strlen(p)-1]='\0';
+ fprintf(pip,"Message-ID: %s>\n",p);
+ }
+ }
+ /* "^aRFCID: local@machine" */
+ else {
+ p[strlen(p)-1]='\0';
+ fprintf(pip,"Message-ID: <%s>\n",p);
+ }
+ else if ((p=hdr("ORIGID",kmsg)))
fprintf(pip,"Message-ID: %s",p);
else if ((p=hdr("MSGID",kmsg)))
fprintf(pip,"Message-ID: %s\n",rfcmsgid(p,bestaka));
@@ -463,6 +508,10 @@
fprintf(pip,"References:%s",p);
else if ((p=hdr("RFC-References",kmsg)))
fprintf(pip,"References: %s",p);
+ else if ((p=hdr("References",kmsg)))
+ fprintf(pip,"References: %s",p);
+ else if ((p=hdr("ORIGREF",kmsg)))
+ fprintf(pip,"References: %s",p);
else if ((p=hdr("REPLY",kmsg)))
fprintf(pip,"References: %s\n",rfcmsgid(p,bestaka));
}
@@ -533,6 +582,14 @@
strcasecmp(tmsg->key,"FMPT") &&
strcasecmp(tmsg->key,"TOPT") &&
strcasecmp(tmsg->key,"FLAGS") &&
+ /* RFC: is used by fidogate to tell how completly RFC headers were
+ gated (0=no headers at all; 1=some headers; 2=all headers) */
+ strcasecmp(tmsg->key,"RFC") &&
+ strcasecmp(tmsg->key,"RFCID") &&
+ strcasecmp(tmsg->key,"ORIGID") &&
+ strcasecmp(tmsg->key,"ORIGREF") &&
+ strcasecmp(tmsg->key,"References") &&
+ strcasecmp(tmsg->key,"Message-ID") &&
strcasecmp(tmsg->key,"RFC-Lines") &&
strcasecmp(tmsg->key,"RFC-Path") &&
strcasecmp(tmsg->key,"RFC-Received") &&

-- 

A bientôt, Pablo Saratxaga

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