Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail 4.5 corrupts PDF attachments from gmail (while outlook 2011 doesnt)

I have a gmail account with scanned documents.

I add this account to in Mail and then some of the PDFs are damaged and can not be corrected. The interesting matter is that via web-access and Outlook 2011 there is not a problem.

I have tried many different solutions I could find on the web incl. here. From deleting the mailboxes to deleting the cache-files. Ultimately I deleted the whole mail app (incl. lib files with CleanMyMac), reinstalling and reinstalling the combo.

After adding the account the last time, I minimized the window, till all activity was finished and everything cashed etc.

I opened mail and again the same problem.

Additional remarks: There are many attachments with the same name, because they were send by a HP Office machine. Some have a problem most don't I would estimate the problem is in 10% of the mails.

Again via Web-access and Outlook 2011 all attachments are correct.

I could use Outlook, their calendar doesn't sync with gmail and I also don't like how outlook is handling (and messing-up) my v.cards .

Any help would be highly appreciated.

MacBookPro3,1, Mac OS X (10.6.7)

Posted on Apr 6, 2011 10:57 AM

Reply
43 replies

Apr 7, 2011 11:46 PM in response to etresoft

etresoft wrote:
One of your e-mail messages had a good and apparently original e-mail from the HP device. I was able to send that back and forth to myself with no problems.


I'm glad you have to basics to do your analyses.

The Apple Mail setting for "All messages, omit attachments" seems a bit strange. I really couldn't get it to work.


I do not really care about this setting anymore. I just wanted to save some GBs, call it spring cleaning.

I say leave it at the default setting of "All messages and attachments" and rebuild your mailbox.


Maybe my remark about the different setting set you of in the wrong direction. I meant the before I started fiddling with that setting I also did not have a problem with apple Mail.

The reason for posting here is that since then I can not get to back to my original state (All message + attachments in Mail without damaged files).

I already did rebuild the mailbox, deleted cashed folders etc. When that all did not work, I decided to go for a complete clean start: I deleted the whole Application including hidden folders by using CleanMyMac.

I then re-installed it, run the combo update. Started the newly installed Mail and created a new account (with default setting). Left the computer alone, to prevent any glitches/interruptions till ALL Activity was finished. However still 10% attachments are damaged (looks like that the older the messages the higher the change that they get corrupted.

I tested with my own server, not gmail. I may by the only person left who doesn't use gmail. Perhaps their servers are getting overloaded.


It might be that it is due to server overload, little glitches etc. when re-downloading the whole mail box. However Outlook 2011, does not have any problem, I just create my account, it gets the messages and the are ALL ok.

The conclusion I can get to is that Mail somehow chokes when having to download a whole account even though this one is only 383MB

Any thoughts how to fix it?

Apr 8, 2011 6:26 AM in response to WilfredR

WilfredR wrote:
I already did rebuild the mailbox, deleted cashed folders etc. When that all did not work, I decided to go for a complete clean start: I deleted the whole Application including hidden folders by using CleanMyMac.

I then re-installed it, run the combo update. Started the newly installed Mail and created a new account (with default setting). Left the computer alone, to prevent any glitches/interruptions till ALL Activity was finished. However still 10% attachments are damaged (looks like that the older the messages the higher the change that they get corrupted.


Deleting the application won't help anything. If you deleted (or better, moved) the old mail folder from ~/Library/Mail, you should be able to re-download all of the messages with attachments.

Still, that may be what you have done. Those messages could be corrupt on the server itself.

It might be that it is due to server overload, little glitches etc. when re-downloading the whole mail box. However Outlook 2011, does not have any problem, I just create my account, it gets the messages and the are ALL ok.


I think I'm out of options. If I can reproduce the problem independently, I could file a bug report. If a problem is specific to your entire account, there is no way to debug that.

My only suggestion would be to delete or move your old mailbox folder in ~/Library/Mail for this account. Delete your Apple Mail preferences in ~/Library/Preferences. Run Disk Utility and Repair Permissions. Then run Apple Mail again, import your old accounts. Recreate this account and download all of the messages. I'm not entirely sure how easy it would be to import one set of accounts and create another set from fresh. You might have to recreate all of your e-mail accounts. You could always import the old accounts into old mailbox folders. It is good to do that anyway from time to time.

Apr 10, 2011 10:44 AM in response to etresoft

All you said I've done unfortunately without success.

I have narrowed the problem down, just a little bit more. I recreated the account as a POP account and it downloaded all mail + attachment without a problem. All attachments that came in corrupted on the IMAP account, came in perfect via POP!?

Unfortunately it is not possible to first download it as POP and then change the settings of the account to IMAP.

Does this help in anyway in solving the problem?

Apr 10, 2011 5:24 PM in response to WilfredR

I would expect POP to be much more robust with attachments like this. One of the things IMAP is supposed to do is allow you to download attachments separately. In order for this to work, your messages have to be well-formed and your client and server have to be in good agreement. Neither may be true in your case. It could just be a simple network failure 10% of the time. Your connection to gmail times out while downloading a big image so the connection closes and your attachment is truncated. POP just grabs the whole message and parses it on the client side.

Apr 20, 2011 9:06 AM in response to etresoft

I am experiencing exactly the same problems as described here. I am using GMAIL and apple mail 4.5 (1084) on MAC OS X 10.6.7. My GMAIL mailbox has the size of 1.7 GBytes. I have tried to rebuild the mailbox folders many times but without success. Corrupt attachments appear mainly for old messages with large attachments.

I have installed Thunderbird on a Windows PC in order to see if the folders are downloaded propperly. With Thunderbird there are no corrupt attachments !

I am now thinking of migrating also on my Mac to Thunderbird in case there is no other solution for this problem.

Therefore I would appreciate very much if someone would find a solution for this problem.


Best regards

Jun 15, 2011 9:13 PM in response to WilfredR

+1 from me (or in actual fact a customer of mine).


Scenario is Gmail -> Apple Mail via IMAP and is not particular to my customer's laptop because I have replicated the problem on my own laptop accessing his Gmail account.


In fact it's not particular to the current version of Mail - my test laptop is running OS X 10.5.8 and Mail 3.6 whereas my customer is running 10.6.7 and 4.5.


The broken attachments are seemingly smaller (truncated?) than the originals and are unable to be opened by either Preview or Adobe Reader.


The attachments (all PDFs in this case) seem to be OK when accessed via the Gmail web interface (either viewed via Google Docs or downloaded to the laptop) and they're also OK if forwarded from Gmail to another email account.


Rebuilding the mailbox (in effect re-downloading all the messages from the IMAP server) doesn't seem to make any difference.


So this makes me think that there is some misunderstanding between Google IMAP server and Apple Mail IMAP client for some files.

Jul 14, 2011 6:53 AM in response to etresoft

Hi,


I have the same problem with an old email attachment that can't be opened any more on both, my MBP (10.5.8), and my Mini (10.6.8). Fortunately, I still have the original file around, and diffing the hexdumps showed that the broken file simply got truncated not too far from its original end (see below).


Unfortunately, I cannot reproduce the error, but you can find the original file to play around with here:


Introduction to Random Matrix Theory from An Invitation to Modern ...


Kind regards,


Alex


[MiniMac:~/Desktop/BrokenPDF] prog% diff IntroRMT_Math54.pdf.hexdump IntroRMT_Math54_broken.pdf.hexdump

31261,31321c31261,31262

< 0007a7a0 30 20 6e 20 0a 30 30 30 30 34 39 30 33 31 32 20 |0 n .0000490312 |

< 0007a7b0 30 30 30 30 30 20 6e 20 0a 30 30 30 30 33 38 31 |00000 n .0000381|

< 0007a7c0 36 38 35 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |685 00000 n .000|

< 0007a7d0 30 34 37 38 30 34 31 20 30 30 30 30 30 20 6e 20 |0478041 00000 n |

< 0007a7e0 0a 30 30 30 30 34 37 37 38 35 33 20 30 30 30 30 |.0000477853 0000|

< 0007a7f0 30 20 6e 20 0a 30 30 30 30 33 37 38 38 32 31 20 |0 n .0000378821 |

< 0007a800 30 30 30 30 30 20 6e 20 0a 30 30 30 30 33 37 39 |00000 n .0000379|

< 0007a810 38 30 38 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |808 00000 n .000|

< 0007a820 30 33 38 31 36 31 36 20 30 30 30 30 30 20 6e 20 |0381616 00000 n |

< 0007a830 0a 30 30 30 30 34 39 30 34 32 30 20 30 30 30 30 |.0000490420 0000|

< 0007a840 30 20 6e 20 0a 30 30 30 30 33 38 32 34 37 30 20 |0 n .0000382470 |

< 0007a850 30 30 30 30 30 20 6e 20 0a 30 30 30 30 33 38 31 |00000 n .0000381|

< 0007a860 37 34 39 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |749 00000 n .000|

< 0007a870 30 33 38 32 34 32 37 20 30 30 30 30 30 20 6e 20 |0382427 00000 n |

< 0007a880 0a 30 30 30 30 34 38 32 35 31 36 20 30 30 30 30 |.0000482516 0000|

< 0007a890 30 20 6e 20 0a 30 30 30 30 34 38 30 34 37 30 20 |0 n .0000480470 |

< 0007a8a0 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 38 31 |00000 n .0000481|

< 0007a8b0 31 37 30 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |170 00000 n .000|

< 0007a8c0 30 34 38 31 30 38 39 20 30 30 30 30 30 20 6e 20 |0481089 00000 n |

< 0007a8d0 0a 30 30 30 30 34 38 31 36 39 36 20 30 30 30 30 |.0000481696 0000|

< 0007a8e0 30 20 6e 20 0a 30 30 30 30 34 38 32 34 31 37 20 |0 n .0000482417 |

< 0007a8f0 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 38 32 |00000 n .0000482|

< 0007a900 33 33 34 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |334 00000 n .000|

< 0007a910 30 34 38 35 33 31 31 20 30 30 30 30 30 20 6e 20 |0485311 00000 n |

< 0007a920 0a 30 30 30 30 34 38 33 30 34 36 20 30 30 30 30 |.0000483046 0000|

< 0007a930 30 20 6e 20 0a 30 30 30 30 34 38 33 37 36 38 20 |0 n .0000483768 |

< 0007a940 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 38 33 |00000 n .0000483|

< 0007a950 36 38 35 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |685 00000 n .000|

< 0007a960 30 34 38 34 34 39 30 20 30 30 30 30 30 20 6e 20 |0484490 00000 n |

< 0007a970 0a 30 30 30 30 34 38 34 34 30 37 20 30 30 30 30 |.0000484407 0000|

< 0007a980 30 20 6e 20 0a 30 30 30 30 34 38 35 32 31 32 20 |0 n .0000485212 |

< 0007a990 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 38 35 |00000 n .0000485|

< 0007a9a0 31 32 39 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |129 00000 n .000|

< 0007a9b0 30 34 38 37 39 31 35 20 30 30 30 30 30 20 6e 20 |0487915 00000 n |

< 0007a9c0 0a 30 30 30 30 34 38 35 38 34 31 20 30 30 30 30 |.0000485841 0000|

< 0007a9d0 30 20 6e 20 0a 30 30 30 30 34 38 36 35 36 33 20 |0 n .0000486563 |

< 0007a9e0 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 38 36 |00000 n .0000486|

< 0007a9f0 34 38 30 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |480 00000 n .000|

< 0007aa00 30 34 38 37 30 39 34 20 30 30 30 30 30 20 6e 20 |0487094 00000 n |

< 0007aa10 0a 30 30 30 30 34 38 37 38 31 36 20 30 30 30 30 |.0000487816 0000|

< 0007aa20 30 20 6e 20 0a 30 30 30 30 34 38 37 37 33 33 20 |0 n .0000487733 |

< 0007aa30 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 39 30 |00000 n .0000490|

< 0007aa40 37 31 30 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |710 00000 n .000|

< 0007aa50 30 34 38 38 34 34 35 20 30 30 30 30 30 20 6e 20 |0488445 00000 n |

< 0007aa60 0a 30 30 30 30 34 38 39 31 36 37 20 30 30 30 30 |.0000489167 0000|

< 0007aa70 30 20 6e 20 0a 30 30 30 30 34 38 39 30 38 34 20 |0 n .0000489084 |

< 0007aa80 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 38 39 |00000 n .0000489|

< 0007aa90 38 38 39 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |889 00000 n .000|

< 0007aaa0 30 34 38 39 38 30 36 20 30 30 30 30 30 20 6e 20 |0489806 00000 n |

< 0007aab0 0a 30 30 30 30 34 39 30 36 31 31 20 30 30 30 30 |.0000490611 0000|

< 0007aac0 30 20 6e 20 0a 30 30 30 30 34 39 30 35 32 38 20 |0 n .0000490528 |

< 0007aad0 30 30 30 30 30 20 6e 20 0a 30 30 30 30 34 39 31 |00000 n .0000491|

< 0007aae0 30 39 32 20 30 30 30 30 30 20 6e 20 0a 30 30 30 |092 00000 n .000|

< 0007aaf0 30 34 39 31 31 31 35 20 30 30 30 30 30 20 6e 20 |0491115 00000 n |

< 0007ab00 0a 30 30 30 30 34 39 31 31 33 37 20 30 30 30 30 |.0000491137 0000|

< 0007ab10 30 20 6e 20 0a 74 72 61 69 6c 65 72 0a 3c 3c 0a |0 n .trailer.<<.|

< 0007ab20 2f 53 69 7a 65 20 35 36 34 0a 2f 52 6f 6f 74 20 |/Size 564./Root |

< 0007ab30 32 20 30 20 52 0a 2f 49 6e 66 6f 20 31 20 30 20 |2 0 R./Info 1 0 |

< 0007ab40 52 0a 3e 3e 0a 73 74 61 72 74 78 72 65 66 0a 34 |R.>>.startxref.4|

< 0007ab50 39 31 32 35 38 0a 25 25 45 4f 46 0a |91258.%%EOF.|

< 0007ab5c

---

> 0007a7a0 30 |0|

> 0007a7a1

[MiniMac:~/Desktop/BrokenPDF] prog%

Jul 14, 2011 7:21 AM in response to Alexander Klein

P.s.: Just to be sure, I viewed the message source in Mail.app, and it seems that the attachment is stored properly on the HD, but gets broken at some point during decoding:


--Apple-Mail-10--168891392

Content-Disposition: inline;

filename=IntroRMT_Math54.pdf

Content-Type: application/pdf;

name=IntroRMT_Math54.pdf;

x-unix-mode=0755

Content-Transfer-Encoding: base64


JVBERi0xLjIKNyAwIG9iago8PAovVHlwZS9FbmNvZGluZwovRGlmZmVyZW5jZXNbMS9kb3RhY2Nl


[...Some megs cut here...]


DAwMDAwIG4gCjAwMDA0OTAyMDQg

MDAwMDAgbiAKMDAwMDM3ODc1NyAwMDAwMCBuIAowMDAwMzc3MTkzIDAwMDAwIG4gCjAwMDAzNzg2

NjggMDAwMDA


--Apple-Mail-10--168891392--

Dec 17, 2011 2:54 AM in response to etresoft

The problem can be reproduced only with Apple`s mail application. Thunderbird, Outlook and other email clients do NOT have these problems.

I am using in parallel to Apple Mail also Thunderbird: In Thunderbird there are NO corrupted PDF attachments. So at least there is a kind of incompatibility between GMAIL and Apple Mail !

Very sad that Apple is apparently still ignoring this problem - I am very disappointed about lack Apple`s support... 😟

Mail 4.5 corrupts PDF attachments from gmail (while outlook 2011 doesnt)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.