Re: [exim] How to catch attachments with non-ascii names?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Kjetil Torgrim Homme
日付:  
To: Tom Kistner
CC: exim-users, Alexander Shikoff
題目: Re: [exim] How to catch attachments with non-ascii names?
On Wed, 2007-01-03 at 14:10 +0100, Tom Kistner wrote:
> Exim does support decoding RFC 2047 encoded MIME words via the ${rfc2047
> expansion operator, however.
>
> I just went to read RFC 2231 and it says:
>
>    IMPORTANT NOTE:  These mechanisms end up being somewhat gibbous when
>    they actually are used. As such, these mechanisms should not be used
>    lightly; they should be reserved for situations where a real need for
>    them exists.

>
> However I don't see the need for this mechanism when RFC 2047 exists ...


there is a very good reason: RFC 2047 MUST NOT be used in MIME
headers... the only correct method is RFC 2231.

if you look at RFC 2183 where Content-Disposition is defined, you'll see
the grammar:

     disposition := "Content-Disposition" ":"
                    disposition-type
                    *(";" disposition-parm)


     disposition-parm := filename-parm / [...]


     filename-parm := "filename" "=" value


<value> is defined in RFC 2045:

     value := token / quoted-string


     token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
                 or tspecials>


okay. now let's look at RFC 2047:

        5. Use of encoded-words in message headers


           An 'encoded-word' may appear in a message header or body part header
           according to the following rules:


        (1) An 'encoded-word' may replace a 'text' token (as defined by RFC 822)
            in any Subject or Comments header field, any extension message
            header field, or any MIME body part field for which the field body
            is defined as '*text'.  An 'encoded-word' may also appear in any
            user-defined ("X-") message or body part header field.


        (2) An 'encoded-word' may appear within a 'comment' delimited by "(" and
            ")", i.e., wherever a 'ctext' is allowed. [...]


        (3) As a replacement for a 'word' entity within a 'phrase', for example,
            one that precedes an address in a From, To, or Cc header. [...]


           These are the ONLY locations where an 'encoded-word' may appear.  In
           particular:


           + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'.


           + An 'encoded-word' MUST NOT appear within a 'quoted-string'.


           + An 'encoded-word' MUST NOT be used in a Received header field.


           + An 'encoded-word' MUST NOT be used in parameter of a MIME
             Content-Type or Content-Disposition field, or in any structured
             field body except within a 'comment' or 'phrase'.


I don't think RFC's get much clearer than this :-)

> Is it just mutt producing such headers?


obviously not, all standards conforming e-mail clients will use RFC
2231.

--
Kjetil T.