But in the Pike code of MIME.pmod we have:
if (headers["content-transfer-encoding"]) { array(string) arr=tokenize(headers["content-transfer-encoding"]);
[...]
And MIME.tokenize for a valid value such as Content-Transfer-Encoding: 8bit returns:
Result: ({ /* 3 elements */ "Content-Transfer-Encoding", 58, "8bit" })
It looks like you've a bit confused; the header
Content-Transfer-Encoding: Content-Transfer-Encoding: 8bit
is not a valid content-transfer-encoding header.
Can I change it this way ?
No, not unless you provide an example where the current code actually is broken.
PS: It seems to break especially with some Lotus Notes servers.
Please provide an example.
/ Henrik Grubbström (Lysator)
Previous text:
2003-11-10 17:17: Subject: Problem with MIME module
Hello,
I am using the MIME module of Pike 7.2 and I think it is broken when the mail contains the Content-Transfer-Encoding header.
Indeed the RFC says the header is of type:
encoding := "Content-Transfer-Encoding" ":" mechanism mechanism := "7bit" / "8bit" / "binary" / "quoted-printable" / "base64" / ietf-token / x-token
But in the Pike code of MIME.pmod we have:
if (headers["content-transfer-encoding"]) { array(string) arr=tokenize(headers["content-transfer-encoding"]); if (sizeof(arr)!=1 || !stringp(arr[0])) throw (({ "invalid Content-Transfer-Encoding in message\n", backtrace() })); transfer_encoding = lower_case(arr[0]); }
And MIME.tokenize for a valid value such as Content-Transfer-Encoding: 8bit returns:
Result: ({ /* 3 elements */ "Content-Transfer-Encoding", 58, "8bit" })
So in the Pike code the size of arr is neither 1 unless no encoding is specified (sizeof(arr)!=1 in the code). I think the offending code must be replaced by:
if(!stringp(arr[2])) throw... string transfer_encoding = lower_case(arr[2] || ""); multiset possible_values = (< "7bit", "8bit", "binary", "quoted-printable", "base64" >); if(!possible_values[transfer_encoding]) throw...
Can I change it this way ?
PS: It seems to break especially with some Lotus Notes servers.
/ David Gourdelier
/ Brevbäraren