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 6, 2011 11:55 AM in response to Ernie Stamper

Neither.

I also didn't use to have any problems. It all started when I changed the setting for keep copies for offline viewing. For one account I set it to: All messages, but omit attachments.
Some attachments came in corrupted, so I wanted to undo everything. Since that time I went to all possible repairs, till deleting Mail completely and starting from scratch.

I almost seems 'too much' for Mail to handle at once. But All Mail folder contains only: 125 messages and according to gmail its: 383MB

Apr 6, 2011 1:10 PM in response to etresoft

Sure: the investigation continues...

I'm not that good in looking 'under the hood' of my Mac because it usually just works 😉. (I used to be able to dig into the registry of windows)

So just what I found using just "get info".
- There is a difference is file size of about 1.4% where the wrong Mail file is smaller
- The correct files it gives under "More info:" a pdf summary e.g number of pages creator etc.
- The same in-correct pdf file give under "More info:" Where from: information. with the header of the email
- One very phenomenon is that after saving one of the files, it became correct. So in Mail, quick view just gives the PDF icon and when opening from Mail it gives the error. But after downloading I could open it. However till now this only happened once.
- It seems that the files where the problem is are the 'bigger" files + 5MB but also smaller files 1.1MB are corrupted.

Hope this helps! If I need to dig deeper please give me some pointers.

P.S. the PDFs we are talking about are mainly scans

Apr 6, 2011 2:40 PM in response to WilfredR

I'm sorry, but you are going to have to clarify some things. Is that 1.4% smaller or 1.4% of the of the other size?

What is the size of the file when downloaded via webmail? What is the size of the file when downloaded via Apple Mail? Ignore all the Quicklook inside Mail for now. Just download the attachment and drag it to the desktop. Once you get both PDFs to the desktop, report what their sizes are.

Is there any problem with the files once they are on your desktop?

Can you reproduce the problem by e-mailing a good version of a problem file back to yourself?

Apr 6, 2011 3:37 PM in response to etresoft

No worries, thanks for the help anyways:

file1:
size webmail & outlook: 1.068.101 bytes
size Mail: 1.053.669 bytes

file2:
size webmail & outlook: 2.437.462 bytes
size Mail: 2.404.527 bytes

yes, the smaller files when on the desktop will not open.

Reproduction:
New mails:
Sending a good file, no matter from which program, stays a good version, also in Mail. Sending a wrong version stays wrong on all programs.

Forwarding to myself:
Forwarding the message from Mail, will make is unreadable everywhere
Forwarding the message (that is a problem in Mail) from the webmail to myself now becomes in Mail a correct attachment.

So reproduction of the problem does work, but like I said is has only happened in about 10% of the messages. I was thinking that is has to do with the first / 2nd big sync?

Apr 6, 2011 11:05 PM in response to etresoft

Apple mail is connected via IMAP too gmail.

Thanks very much for your help. (Looks like we are a bit in different time-zones)

Some extra info:
When rebuilding the mailbox there are differences in which mails get corrupted and which not, I for sure have now a few files correct in Apple Mail that two days ago were corrupted.

I have a modem/router and TimeCapsule in my network and everything goes wireless. Everything works (from peer-to-peer to streaming) and nothing get's lost, the only thing that does not work is Screen-sharing via iChat. For that I have to connect directly with cable to my provider (setting up VPN with my provider...don't ask).
I'll wait for your findings, but I thought it might be a good idea to delete all accounts and cash and start via cable connection.

Apr 7, 2011 7:36 AM in response to WilfredR

WilfredR wrote:
Apple mail is connected via IMAP too gmail.


That's good news. If it was Exchange, I couldn't do anything.

I'll wait for your findings, but I thought it might be a good idea to delete all accounts and cash and start via cable connection.


Don't clean up just yet. I would really like to have one of the original messages. I suspect that the messages that these HP devices generate are not in standard MIME format. Both Apple Mail and the gmail servers try to add the appropriate tags so that you can separate the attachment for offline viewing. Gmail seems to have better success. I've replied to your e-mail. Hopefully we can track down one of the originals so that I can reproduce it and file a good bug report.

Apr 7, 2011 8:54 AM in response to etresoft

etresoft wrote:
Don't clean up just yet.


Ok I won't just yet, I'll work via webmail for the time being.

etresoft wrote:
Hopefully we can track down one of the originals so that I can reproduce it and file a good bug report.


I did what I could but maybe there are some tricks I don't know of to track back the original message. Any gmail advices are welcome.

Apr 7, 2011 2:42 PM in response to WilfredR

I don't know what is going on. 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.

The Apple Mail setting for "All messages, omit attachments" seems a bit strange. I really couldn't get it to work. In fact, it seemed to work the opposite. I setup a new e-mail account to test this problem. My first test messages to that account had the attachments as residing on the server. I had to manually download them to see them. Then, when I changed from the default setting of "All messages and attachments" to "All messages, omit attachments", it seemed to download the entire message, including attachments - exactly the opposite of what I would have expected.

I say leave it at the default setting of "All messages and attachments" and rebuild your mailbox. 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.

Apr 7, 2011 7:01 PM in response to etresoft

The IMAP setting to Keep copies of messages and their attachments has little impact unless not connected to the internet and wanting to work Offline. If connected to the internet, and you click on a message, it will be downloaded, even if not already so by virtue of this setting. If not selected to Keep copies . . . and attachments, then you will be subject to the goodness of the internet connection at that moment. I am only partially keeping abreast of your investigations, but it may be that transmission is muddled at certain times?

But I may be missing a step in the sequence of things you have found out. Do you have any reason to think that in the message cache created by selecting Keep copies . . . something could be altering files?

Ernie

Message was edited by: Ernie Stamper

Apr 7, 2011 7:17 PM in response to Ernie Stamper

Ernie Stamper wrote:
The IMAP setting to Keep copies of messages and their attachments has little impact unless not connected to the internet and wanting to work Offline. If connected to the internet, and you click on a message, it will be downloaded, even if not already so by virtue of this setting. If not selected to Keep copies . . . and attachments, then you will be subject to the goodness of the internet connection at that moment. I am only partially keeping abreast of your investigations, but it may be that transmission is muddled at certain times?


I didn't actually try reading the messages without an internet connection. When I had the account in the default "message+attachment" option, the attachments tended to stay on the server. When I switched to "message, no attachment", the attachments were always downloaded. That sure sounds like the opposite of what I would have expected. I've never used the "message, no attachment" setting so that is new to me.

But I may be missing a step in the sequence of things you have found out. Do you have any reason to think that in the message cache created by selecting Keep copies . . . something could be altering files?


I know that if the Mailbox index gets corrupted, it can cause attachments to be lost - at least temporarily. When I do testing with a local mail server, sometimes the timing is off (too fast maybe) and the message is almost always corrupted. Rebuilding the mailbox fixes it.

My initial theory was that the HP devices were spitting out bad MIME messages and that gmail was fixing them. Now I think that gmail IMAP just flakes out every so often with these big files. There could be other explanations too. The PDF was just truncated. I don't think a bug in Apple Mail is a likely possibility.

Apr 7, 2011 7:26 PM in response to etresoft

If set to no attachment copy kept, then it is logical that when you click to open the message, the attachment will then be downloaded. Nothing inconsistent about that. The command is for when connecting and checking for mail, and not for when reading the mail.

Also keep in mind that with an IMAP account (or Exchange) that if anyone were to force reindexing via the removal of the Envelope Index WITHOUT also removing the IMAP account folder, then chaos can result. This is because if you reindex the cached copies, then syncing goes awry when you next connect to the internet and the IMAP account.

An attachment can be truncated if the MTU (maximum transmission unit) of the connection is not properly getting set -- normally an automatic thing, and not so much said about that with new, modern broadband connections everywhere.

Ernie

Apr 7, 2011 8:32 PM in response to Ernie Stamper

Ernie Stamper wrote:
If set to no attachment copy kept, then it is logical that when you click to open the message, the attachment will then be downloaded. Nothing inconsistent about that.


The inconsistent part is that it doesn't work that way. When I used "no attachment copy kept", I always downloaded the entire message. When I used the default "message and attachment" I had to click to download the attachment. It was the opposite of what is logical.

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.