This one is just weird.
Every month, my local newspaper emails me a PDF invoice for an ad I run. They
generate it on a Windows system. About half the time, the enclosure is
unreadable:
> The file “EMLINV2T (300)[20150309-09555986].pdf” could not be opened. It may
> be damaged or use a file format that Preview doesn’t recognize.
Using “open with Adobe Reader” gets:
> There was an error opening this document. The file is damaged and could not
> be repaired.
Dragging and dropping to the file system, then trying to open, gives identical
results.
Ah, but wait. If I read the very same (IMAP) email message on my iPhone, I
never have any problem viewing the enclosure. And if I forward it back to
myself, then try to read that email on my Mac, it shows up just fine.
The raw message source contains (near the top):
> MIME-Version: 1.0
> Content-type: multipart/mixed;
> boundary="ssi=-=-=-=-=-=boundary=-=-=-=-=-=-ssi"
>
> --ssi=-=-=-=-=-=boundary=-=-=-=-=-=-ssi
> Content-Disposition: attachment;
> Content-type: application/pdf;name="EMLINV2T (300)[20150309-09555986].pdf"
> Content-Transfer-Encoding: base64
>
> JVBERi0xLjUKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9G
> bGF0ZURlY29kZT4+CnN0cmVhbQp4nO1cWXMdt45+16/oqqmp0nHNaTd3ct4sy4tu
> FNnR4lwndR8Sb3Gut0TOpPLj5r8NyG4SX58D6RxJjpOaslW2YS4gAAIfQHa3f+mG
> XuluyD+VePZ25/Zx6F6d76gu//z6ascMQ+86p1X+S6tgOjUo0/36YuflrZ0yOY/6
… and down at the bottom:
> b3QgMSAwIFIgL0luZm8gMiAwIFIKL0lEIFs8NURBMzQ3QTU4NDhGMzk5NDA5MjU4
> NzA5NUI3QUU3MEM+PDVEQTM0N0E1ODQ4RjM5OTQwOTI1ODcwOTVCN0FFNzBDPl0K
> Pj4Kc3RhcnR4cmVmCjE3NTAzCiUlRU9GCg==========================
> --ssi=-=-=-=-=-=boundary=-=-=-=-=-=-ssi--
>
This all looks well-formed.
Here’s the fun part. The working “decoded” file from the re-forwarded mail as
dragged and dropped from Mail to the file system contains (near the end):
> 0000014751 00000 n
> 0000014880 00000 n
> trailer
> << /Size 16 /Root 1 0 R /Info 2 0 R
> /ID [<5DA347A5848F3994092587095B7AE70C><5DA347A5848F3994092587095B7AE70C>]
> >>
> startxref
> 17503
> %%EOF
…while the broken “decoded” file from the original message as dragged and
dropped contains:
> 0000014751 00000 n
> 0000014880 00000 n
> trailer
> << /Size 16 /Root 1 0 R /Info 2 0 R
> /ID [<5DA347A5848F3994092587095B7AE70C><5DA347A5848F3994092587095B7AE70C>]
> Pj4Kc3RhcnR4cmVmCjE3NTAzCiUlRU9GCg==========================
In other words, for some reason, Mail is not decoding the last line of the
Base64 data block! The resulting files are otherwise entirely identical.
The Base64 encoding in both messages appears identical, except that the
forwarded message renders it in a block that is 12-characters wider than the
original, and only pads the tail end of the block with two “=“ signs. Also,
the bounding flag is "--Apple-Mail-1271A73F-17ED-4C29-9CBF-285DCDAB8E5C”
instead of "--ssi=-=-=-=-=-=boundary=-=-=-=-=-=-ssi—“. None of this should make
a difference.
Do I report this as a Mail bug, or is it possible that something else strange
is going on in my OS?
--
Macs R We -- Personal Macintosh Service and Support
in the Wickenburg and far Northwest Valley Areas.
http://macsrwe.com
_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk