Problem with MIME parameter values (RFC2231)

A. Brandt
2010-08-16
2013-04-25
  • A. Brandt
    A. Brandt
    2010-08-16

    RFC2231 defines an attribute char:
       attribute-char := <any (US-ASCII) CHAR except SPACE, CTLs,
                         "*", "'", "%", or tspecials>

    and RFC2045 defines tspecial chars:
    tspecials :=  "(" / ")" / "<" / ">" / "@" /
                       "," / ";" / ":" / "\" / <">
                       "/" / "" / "?" / "="

    So I assume that a character like "(" has to be encoded in function parameter::generate() (line 402) in file parameter.cpp.
    I added this to the switch in line 402:
                            case '(':
                            case ')':
                            case '<':
                            case '>':
                            case '@':
                            case ':':
                            case '/':
                            case '[':
                            case ']':
                            case '?':
                            case '=':

     
  • Hello,

    This has already been fixed in SVN version.

    Regards,

    Vincent

     
  • A. Brandt
    A. Brandt
    2010-08-16

    I added an attachment called "my_file_name_öäü_(1).txt" to a message builder (SVN version) and generated the message:

    -=_JQkqslsi5I1f4lu4sdJU5QzE3d1lSe9LW6pxnFA81nFfE7rS
    Content-Type: text/plain
    Content-Description: =?utf-8?Q?my=5Ffile=5Fname=5F=C3=B6=C3=A4=C3=BC=5F=281=29?=
    =?utf-8?Q?.txt?=
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename*=utf-8''my_file_name_%C3%B6%C3%A4%C3%BC_(1).txt

    c29tZSBkYXRhIGRmc2RmbW5zZGZzZGZrc2Rma3NkZmpoIGZzZGZqc2RoZiBzamRzZmhqc2Rm
    aHNqZGhmc2Qgc2RqZmhkamZoc2Rqa2Zo
    -=_JQkqslsi5I1f4lu4sdJU5QzE3d1lSe9LW6pxnFA81nFfE7rS-

    I think it should be:
    Content-Disposition: attachment; filename*=utf-8''my_file_name_%C3%B6%C3%A4%C3%BC_%281%29.txt