On 17Apr2020 18:06, Fred Smith <fre...@fcshome.stoneham.ma.us> wrote:
Odd thing with an attachment, can someone advise?

My wife send me mail from aol.com with an attachment. when I received the
mail the attachment's filename was gibberish, NOT what she viewed
when she sent it:

Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="=?utf-8?B?Q09WSUQxOV9OZXdzbGV0dGVyX1Nlbmlvcl9DZW50ZXJfT3BlcmF0aW9uLnBkZg==?="

Ok, so that is an RFC2047 encoding of the name "COVID19_Newsletter_Senior_Center_Operation.pdf".

However, this is not a supported syntax for the filename parameter. In fact, this use is actually prohibited by RFC2047 in section 5:

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

So AOL should not be doing that to your filename.

However, it _would_ be nice if mutt could be told to look for this stuff in places beyond the standard, even as a a special "save filename (or this other filename decoded from a guess)".

When viewed in mutt (with "v") it was that same name (though truncated). when saved to disk it retained that weird name.

I had her resend it to my gmail account where it showed the correct
human-readable name.

Do you have the corresponding headers from the gmail account? That would be illuminating.

Is there something I can do in mutt to deal with attachments with
garbled names? (I'm gussing it's mime--or other--encoded and Mutt didn't
decode it for me.)

You could edit the message with the "e" key and hand modify the header. Of course, you need to know what to call it.

Or you could write a small shell script to modify the filename after saving. In fact, _I_ should write that script and post it for reuse.

Here are some references:

RFC2047 (defining the =?...?= syntax) is here:

   https://tools.ietf.org/html/rfc2047

and the filenamestring looks like a "encoded-word" surrounded by double quotes; the "encoded word" syntax is here:

   https://tools.ietf.org/html/rfc2047#section-2

Section 5 of RFC2047 actually prohibits using the "encoded-word" syntax in a quoted string. In section 5:

   https://tools.ietf.org/html/rfc2047#section-5

it says, after enumerating where you _can_ use it, it then says:

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

The Content-Disposition field is defined in RFC2183, here:

   https://tools.ietf.org/html/rfc2183

and the filename field is described here:

   https://tools.ietf.org/html/rfc2183#section-2.3

Cheers,
Cameron Simpson <c...@cskk.id.au>

Reply via email to