Added writing CHRS kludge

This commit is contained in:
Michiel Broek 2005-08-13 16:05:29 +00:00
parent 3e664a4f30
commit a8a07b73a2
2 changed files with 387 additions and 386 deletions

View File

@ -4,7 +4,7 @@
* Purpose ...............: Gate netmail->email or echomail->news
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -512,22 +512,24 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
bestaka = bestaka_s(f);
rewind(fp);
// p = hdr((char *)"CHRS", kmsg);
// if (p == NULL)
// p = hdr((char *)"CHARSET", kmsg);
// if (p == NULL)
// p = hdr((char *)"CODEPAGE", kmsg);
// if (p)
p = hdr((char *)"CHRS", kmsg);
if (p == NULL)
p = hdr((char *)"CHARSET", kmsg);
if (p == NULL)
p = hdr((char *)"CODEPAGE", kmsg);
if (p)
// outcode = readchrs(p);
// else {
// p=hdr((char *)"Content-Type",msg);
// if (p == NULL)
// p=hdr((char *)"RFC-Content-Type",kmsg);
// if (p == NULL)
// p=hdr((char *)"Content-Type",kmsg);
// if (p)
Syslog('m', "outcode from ftn kludge: %s", printable(p, 0));
else {
p=hdr((char *)"Content-Type",msg);
if (p == NULL)
p=hdr((char *)"RFC-Content-Type",kmsg);
if (p == NULL)
p=hdr((char *)"Content-Type",kmsg);
if (p)
// outcode=readcharset(p);
// else {
Syslog('m', "outcode from rfc header: %s", printable(p, 0));
else {
// q = rfcmsgid(hdr((char *)"MSGID",kmsg),bestaka);
// if ((hdr((char *)"Message-ID",msg)) || (hdr((char *)"RFC-Message-ID",kmsg)) ||
// (hdr((char *)"Message-ID",kmsg)) || (hdr((char *)"RFCID",kmsg)) ||
@ -538,8 +540,9 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
// if (q)
// free(q);
// q = NULL;
// }
// }
Syslog('m', "outcode will use default");
}
}
/*
* A hack for TerMail

View File

@ -44,7 +44,7 @@
#include "rfc2ftn.h"
#define MAXHDRSIZE 2048
#define MAXHDRSIZE 4096
#define MAXSEEN 70
#define MAXPATH 73
@ -164,7 +164,7 @@ int rfc2ftn(FILE *fp, faddr *recipient)
int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders;
time_t Now;
temp = calloc(4097, sizeof(char));
temp = calloc(MAXHDRSIZE +1, sizeof(char));
Syslog('m', "Entering rfc2ftn");
if (recipient)
Syslog('m', "Recipient: %s", ascfnode(recipient, 0xff));
@ -773,7 +773,6 @@ int needputrfc(rfcmsg *msg, int newsmode)
{
faddr *ta;
// Syslog('M', "needputrfc(%s)", printable(msg->key,0));
if ((msg->key == NULL) || (strlen(msg->key) == 0)) return 0;
if (!strcasecmp(msg->key,"X-UUCP-From")) return -1;
@ -869,7 +868,6 @@ int needputrfc(rfcmsg *msg, int newsmode)
if (!strcasecmp(msg->key,"Complaints-To")) return 0;
/* Default X- headers */
if (!strncasecmp(msg->key,"X-",2)) return 0;
/*if (!strcasecmp(msg->key,"")) return ;*/
return 1;
}