Code sync with mbfido

This commit is contained in:
Michiel Broek 2005-08-16 21:16:07 +00:00
parent cfb6619e54
commit a11174b362

View File

@ -232,8 +232,6 @@ int rfc2ftn(FILE *fp)
} }
} }
chkftnmsgid(hdr((char *)"Message-ID",msg)); // ?? chkftnmsgid(hdr((char *)"Message-ID",msg)); // ??
removemime = FALSE; removemime = FALSE;
removemsgid = FALSE; removemsgid = FALSE;
@ -263,21 +261,23 @@ int rfc2ftn(FILE *fp)
q = strtok(p, " \n\0"); q = strtok(p, " \n\0");
q = strtok(NULL, "; \n\0"); q = strtok(NULL, "; \n\0");
while (*q && isspace(*q)) if (q) {
q++; while (*q && isspace(*q))
Syslog('m', "charset part: %s", printable(q, 0)); q++;
if (q && (strncasecmp(q, "charset=", 8) == 0)) { Syslog('m', "charset part: %s", printable(q, 0));
/* if (q && (strncasecmp(q, "charset=", 8) == 0)) {
* google.com quotes the charset name /*
*/ * google.com quotes the charset name
if (strchr(q, '"')) { */
charset = xstrcpy(q + 9); if (strchr(q, '"')) {
charset[strlen(charset)-1] = '\0'; charset = xstrcpy(q + 9);
Syslog('m', "Unquoted charset name"); charset[strlen(charset)-1] = '\0';
} else { Syslog('m', "Unquoted charset name");
charset = xstrcpy(q + 8); } else {
charset = xstrcpy(q + 8);
}
Syslog('m', "Charset \"%s\"", printable(charset, 0));
} }
Syslog('m', "Charset \"%s\"", printable(charset, 0));
} }
} }
@ -816,16 +816,11 @@ int needputrfc(rfcmsg *msg, int newsmode)
{ {
faddr *ta; faddr *ta;
// Syslog('M', "needputrfc(%s)", printable(msg->key,0));
if ((msg->key == NULL) || (strlen(msg->key) == 0)) return 0; if ((msg->key == NULL) || (strlen(msg->key) == 0)) return 0;
if (!strcasecmp(msg->key,"X-UUCP-From")) return -1; if (!strcasecmp(msg->key,"X-UUCP-From")) return -1;
if (!strcasecmp(msg->key,"X-Body-Start")) return -1; if (!strcasecmp(msg->key,"X-Body-Start")) return -1;
if (!strncasecmp(msg->key,".",1)) return 0; if (!strncasecmp(msg->key,".",1)) return 0;
if (!strncasecmp(msg->key,"X-FTN-",6)) return 0;
if (!strncasecmp(msg->key,"X-Fsc-",6)) return 0;
if (!strncasecmp(msg->key,"X-ZC-",5)) return 0;
if (!strcasecmp(msg->key,"X-Gateway")) return 0;
if (!strcasecmp(msg->key,"Path")) return 0; if (!strcasecmp(msg->key,"Path")) return 0;
if (!strcasecmp(msg->key,"Newsgroups")) { if (!strcasecmp(msg->key,"Newsgroups")) {
if ((hdr((char *)"X-Origin-Newsgroups",msg))) if ((hdr((char *)"X-Origin-Newsgroups",msg)))
@ -855,7 +850,6 @@ int needputrfc(rfcmsg *msg, int newsmode)
if (!strcasecmp(msg->key,"Return-Path")) return 1; if (!strcasecmp(msg->key,"Return-Path")) return 1;
if (!strcasecmp(msg->key,"Xref")) return 0; if (!strcasecmp(msg->key,"Xref")) return 0;
if (!strcasecmp(msg->key,"Approved")) return 1; if (!strcasecmp(msg->key,"Approved")) return 1;
if (!strcasecmp(msg->key,"X-URL")) return 0;
if (!strcasecmp(msg->key,"Return-Receipt-To")) return removereturnto? 0:1; if (!strcasecmp(msg->key,"Return-Receipt-To")) return removereturnto? 0:1;
if (!strcasecmp(msg->key,"Notice-Requested-Upon-Delivery-To")) return 0; if (!strcasecmp(msg->key,"Notice-Requested-Upon-Delivery-To")) return 0;
if (!strcasecmp(msg->key,"Received")) return newsmode?0:2; if (!strcasecmp(msg->key,"Received")) return newsmode?0:2;
@ -894,15 +888,7 @@ int needputrfc(rfcmsg *msg, int newsmode)
if (!strcasecmp(msg->key,"Organization")) return 1; if (!strcasecmp(msg->key,"Organization")) return 1;
if (!strcasecmp(msg->key,"Organisation")) return 1; if (!strcasecmp(msg->key,"Organisation")) return 1;
if (!strcasecmp(msg->key,"Comment-To")) return 0; if (!strcasecmp(msg->key,"Comment-To")) return 0;
if (!strcasecmp(msg->key,"X-Comment-To")) return 0;
if (!strcasecmp(msg->key,"X-Apparently-To")) return 0;
if (!strcasecmp(msg->key,"X-Originating-IP")) return 0;
if (!strcasecmp(msg->key,"X-Virus-Scanned")) return 0;
if (!strcasecmp(msg->key,"X-AntiVirus")) return 0;
if (!strcasecmp(msg->key,"X-Delivery-Agent")) return 0;
if (!strcasecmp(msg->key,"X-Virtual-Domain")) return 0;
if (!strcasecmp(msg->key,"Apparently-To")) return 0; if (!strcasecmp(msg->key,"Apparently-To")) return 0;
if (!strcasecmp(msg->key,"X-Fidonet-Comment-To")) return 0;
if (!strcasecmp(msg->key,"Keywords")) return 2; if (!strcasecmp(msg->key,"Keywords")) return 2;
if (!strcasecmp(msg->key,"Summary")) return 2; if (!strcasecmp(msg->key,"Summary")) return 2;
if (!strcasecmp(msg->key,"MIME-Version")) return removemime ?0:1; if (!strcasecmp(msg->key,"MIME-Version")) return removemime ?0:1;
@ -915,26 +901,16 @@ int needputrfc(rfcmsg *msg, int newsmode)
if (!strcasecmp(msg->key,"References")) return removeref ?0:1; if (!strcasecmp(msg->key,"References")) return removeref ?0:1;
if (!strcasecmp(msg->key,"Supersedes")) return 1; if (!strcasecmp(msg->key,"Supersedes")) return 1;
if (!strcasecmp(msg->key,"Distribution")) return ftnorigin ?0:0; if (!strcasecmp(msg->key,"Distribution")) return ftnorigin ?0:0;
if (!strcasecmp(msg->key,"X-Newsreader")) return 0;
if (!strcasecmp(msg->key,"X-Mailer")) return 0;
if (!strcasecmp(msg->key,"User-Agent")) return 0; if (!strcasecmp(msg->key,"User-Agent")) return 0;
if (!strncasecmp(msg->key,"NNTP-",5)) return 0; if (!strncasecmp(msg->key,"NNTP-",5)) return 0;
if (!strncasecmp(msg->key,"X-Trace",7)) return 0;
if (!strncasecmp(msg->key,"X-Complaints",12)) return 0;
if (!strncasecmp(msg->key,"X-MSMail",9)) return 0;
if (!strncasecmp(msg->key,"X-MimeOLE",9)) return 0;
if (!strncasecmp(msg->key,"X-MIME-Autoconverted",20)) return 0;
if (!strcasecmp(msg->key,"X-Origin-Date")) return 0;
if (!strncasecmp(msg->key,"X-PGP-",6)) return 0;
if (!strncasecmp(msg->key,"Resent-",7)) return 0; if (!strncasecmp(msg->key,"Resent-",7)) return 0;
if (!strncasecmp(msg->key,"X-MS-",5)) return -1; if (!strncasecmp(msg->key,"X-MS-",5)) return -1;
if (!strcasecmp(msg->key,"X-Mailing-List")) return 0;
if (!strcasecmp(msg->key,"X-Loop")) return 0;
if (!strcasecmp(msg->key,"Precedence")) return 0; if (!strcasecmp(msg->key,"Precedence")) return 0;
if (!strcasecmp(msg->key,"X-Face")) return 0; if (!strcasecmp(msg->key,"Cache-Post-Path")) return 0;
if (!strcasecmp(msg->key,"X-Accept-Language")) return 0; if (!strcasecmp(msg->key,"Injection-Info")) return 0;
if (!strncasecmp(msg->key,"X-Spam-", 7)) return 0; if (!strcasecmp(msg->key,"Complaints-To")) return 0;
/*if (!strcasecmp(msg->key,"")) return ;*/ /* Default X- headers */
if (!strncasecmp(msg->key,"X-",2)) return 0;
return 1; return 1;
} }