diff --git a/ChangeLog b/ChangeLog index 5cbc73db..20082807 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,20 @@ $Id$ v0.91.7 07-Mar-2007 + mbselib: + If find_rfc_charset doesn't find a valid characterset we log a + warning instead of an error. + + mbfido: + In rfc2ftn if we cannot find the incoming charset from the + standard table we will fall back to the charset in the + Content-type: header and try to initialize iconv with that + value. + For debug help to me, the headers Content-Type and + Content-Transfer-Encoding are temporary stored in the fido + message as kludges. + + v0.91.6 05-Mar-2007 - 07-Mar-2007 upgrade: diff --git a/lib/charset.c b/lib/charset.c index 18073970..b575c8aa 100644 --- a/lib/charset.c +++ b/lib/charset.c @@ -172,7 +172,7 @@ int find_rfc_charset(char *rfcname) } if (charmap[i].rfcname == NULL) { - WriteError("find_rfc_charset(%s) not found", rfcname); + Syslog('!', "find_rfc_charset(%s) not found", rfcname); return FTNC_ERROR; } diff --git a/mbfido/rfc2ftn.c b/mbfido/rfc2ftn.c index d63c0288..d3d13166 100644 --- a/mbfido/rfc2ftn.c +++ b/mbfido/rfc2ftn.c @@ -248,7 +248,6 @@ int rfc2ftn(FILE *fp, faddr *recipient) charset = xstrcpy((char *)"ISO-8859-1"); Syslog('m', "No charset, setting default to ISO-8859-1"); } - chars_in = find_rfc_charset(charset); if ((p = hdr((char *)"Message-ID",msg))) { if (!removemsgid) @@ -332,14 +331,21 @@ int rfc2ftn(FILE *fp, faddr *recipient) if (fmsg->to) hdrsize += (fmsg->to->name)?strlen(fmsg->to->name):0; + chars_in = find_rfc_charset(charset); chars_out = msgs.Charset; - Syslog('m', "rfc2ftn: chars_in=%d chars_out=%d", chars_in, chars_out); - Syslog('m', "rfc2ftn: charset in: %s charset out: %s", get_ic_rfc(chars_in), get_ic_ftn(chars_out)); - - /* - * Setup charset conversion - */ - chartran_init(get_ic_rfc(chars_in), get_ic_ftn(chars_out), 'm'); + if (chars_in == FTNC_ERROR) { + /* + * Not in standard tables, go ahead with the uppercase name + * and see if iconv will take it. It doesn't really matter if + * we support the incoming rfc charset, + */ + tu(charset); + Syslog('m', "rfc2ftn: charset in: %s charset out: %s", charset, get_ic_ftn(chars_out)); + chartran_init(charset, get_ic_ftn(chars_out), 'm'); + } else { + Syslog('m', "rfc2ftn: charset in: %s charset out: %s", get_ic_rfc(chars_in), get_ic_ftn(chars_out)); + chartran_init(get_ic_rfc(chars_in), get_ic_ftn(chars_out), 'm'); + } do { Syslog('m', "rfc2ftn: split loop, splitpart = %d", splitpart); @@ -843,9 +849,9 @@ int needputrfc(rfcmsg *msg, int newsmode) if (!strcasecmp(msg->key,"Keywords")) return 2; if (!strcasecmp(msg->key,"Summary")) return 2; if (!strcasecmp(msg->key,"MIME-Version")) return removemime ?0:1; - if (!strcasecmp(msg->key,"Content-Type")) return removemime ?0:1; + if (!strcasecmp(msg->key,"Content-Type")) return removemime ?1:1; // was 0:1 temp 08-03-2007 mb if (!strcasecmp(msg->key,"Content-Length")) return removemime ?0:1; - if (!strcasecmp(msg->key,"Content-Transfer-Encoding")) return removemime ?0:1; + if (!strcasecmp(msg->key,"Content-Transfer-Encoding")) return removemime ?1:1; // dito if (!strcasecmp(msg->key,"Content-Name")) return 2; if (!strcasecmp(msg->key,"Content-Description")) return 2; if (!strcasecmp(msg->key,"Message-ID")) return removemsgid ?0:1;