On Thu, Mar 26, 2020 at 08:53:35AM +0000, Russell L. Harris wrote:
> On Thu, Mar 26, 2020 at 10:24:38AM +0200, Andrei POPESCU wrote:
> >Opening pdfs in a reader is trivial with mutt. Just press 'v' and then
> >'Return' on the pdf attachment. It should be opened in your default pdf
> >viewer. This should work also for 'html' parts to be opened in your
> >default browser.
>
> I understand. But some of the stuff I receive does not work as
> expected. What do I do with the following PDF:
>
> =?utf-8?B?QkhfODU0MDk2MjMwLnBkZg==?=
This is not a PDF (it would be a very short one, mind you :)
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. 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].
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?
[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.
-- tomás
Attachment:
signature.asc
Description: Digital signature