[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HTML mail + PDF attachments



On Thu, Mar 26, 2020 at 10:44:14AM +0100, tomas@tuxteam.de wrote:
   =?utf-8?B?QkhfODU0MDk2MjMwLnBkZg==?=

This is not a PDF (it would be a very short one, mind you :)

I misspoke; I should have said "string" rather than "PDF".  But I did
not discover how to get mutt to point me to the PDF file associated
with the string.


This is a string in MIME's "Encoded-Word" encoding [1], which is used
to wrap non-ASCII stuff in an MIME metadata (i.e. header) snippet.

Following the reference, that's what you can read off it:

 =?utf-8 -- means that the actual content is an UTF-8 encoded string
  ?B     -- means that what comes now is a base-64 encoding of the
            above

 After the next "?" comes the data:

 QkhfODU0MDk2MjMwLnBkZg==

(the two trailing equals signs are padding, part of the base64 thingy;
the last ?= are MIME delimiters according to [1]).

Base-64 decoding it [2] yields:

 BH_854096230.pdf

This looks like a file name to me.

Indeed, it is. But I do not know where the file resides.
Note that, in hindsight, all this encoding nonsense wouldn't have
been necessary, because the original above *is* already plain
ASCII. This is a case of stupid software obscuring things to make
users even more stupid and dependent [3].

Agreed; but I cannot force the other guy to use an intelligent mail client.

The PDF itself is somewhere else (perhaps in a MIME part somewhere
in that mail, perhaps sitting in some file system, whatever).

Cheers

[1] https://en.wikipedia.org/wiki/Multipurpose_Internet_Mail_Extensions#Encoded-Word
[2] In Emacs, just mark that string and M-x base64-decode-region.
  Your editor sure has a way to do this, hasn't it?

I run Emacs, but I did not know about "M-x base64-decode-region";
thanks.

[3] I don't think it's really intentional. It's an unfortunate and
  contagious antipattern, a bit like prions transmit Creutzfeld-Jacob.
  But nowadays I suspect that some actors help its expansion because
  it helps their business interests. Or something.

I think it is just the general incompetence and arrogance of the
micro$oft culture.

RLH


Reply to: