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

Mail.app- 'Remove Attachments' corrupting mails

I have a weird issue that I've not seen mentioned anywhere. Wondering if anyone can give me any debugging tips.


I'm using Mail 5.0 in Lion 10.6.1 (issue was occurring in 10.6.0 as well).


I have Mail connected to Exchange Server 2010.


I have a fairly tight restriction on mailbox sizes so I have to remove attachments from emails before I file them.


My problem is this; about 1 in 3 times I remove an attachment the 'replacement' e-mail is full of gibberish characters.


Typically if I look at the raw source of the e-mail then the text version of the mail is retained correctly- it seems to be the Base64 encoded version that is corrupted.


Any idea what I can do to debug this? I have tried removing the envelope files and removing/adding the account back in and re-syncing it but the issue has reappeared.


I've reported this to Apple on http://bugreports.apple.com but have not had a response.


Thanks in advance.

Unibody MacBook Pro 15" 2.8GHz, Mac OS X (10.6.1)

Posted on Aug 22, 2011 7:48 AM

Reply
116 replies

Jan 20, 2015 12:44 AM in response to 750 H2C

The gibberish problem is accelerating for me. I've found that I have to restart Mail a few times each day to improve my odds of avoiding the problem, since Mail seems to be behaving better after a restart. Once the problem starts, though, the misbehaviour frequency goes up.


I've also found that if I move the message to a local mailbox before removing the attachment, I'm often left with a blank message. No gibberish, but also no text at all. Not much better.


Note that I'm working with a fresh installation of Yosemite with Mail set up from scratch (since I really wanted to get rid of this problem). No settings imported, just messages. The problem is still there. So it's not due to some crap settings in my computer.


What I do right now is to create a reply to a message before attempting to remove its attachment. If I'm left with gibberish, the reply still contains the original message, albeit in a cited form. Better than nothing.


I can also report that I tried an alternative email client today, Postbox 3, but its mailbox import function seemed to be less than reliable. Give me a few weeks to get more desperate, and I'll give it a serious try.

Jan 20, 2015 3:38 AM in response to 750 H2C

I have OS X 10.9.5 and Mail 7.3 hooked up to my Gmail account via IMAP.

I don't usually remove that many attachments, but when I do, the message vanishes completely from the Inbox. When I do a search for the message it seems to have ended up in the "Archive" folder - with two .txt files in place of the original attachment.

Jan 29, 2015 3:27 PM in response to dme26

I, too, have seen a marked jump in Mail message corruption after removing attachments with Mail version 8.2 (2070.6) in 10.10.2. The corruption is random; I can't detect a pattern based on sender, action performed (prior reply, forwarding, etc.), or anything else obvious. The corruption appears as what looks like Chinese characters, interspersed with "?" encapsulated with solid black 4-cornered diamonds.


I think this is a formatting or encryption problem: the text of the message can still be viewed through View>Message>Raw Source. However, the message, once corrupted, no longer appears in searches on message content.


Mail 8.2 fixed a Yosemite fail with the junk mail filter, so 8.2 is sort of good news/bad news for me. But, as the time span of this thread shows, this corruption problem has existed much longer. From the results of the latest quarter, looks like the iPhones are attracting most of the talent and attention at Apple. Shame.

Jan 29, 2015 9:49 PM in response to dme26

I've just had the corruption occur again today from viewing the raw source in Mail.app, the result of the bug is obvious in this case. The raw message contains:

--_002_C997BA54A3409B438E2B598544A3BFEE38DAA4AEITSEXMP07regist_ Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=utf-8

Which is followed by text content that is obviously not base64 encoded. So it seems that Mail.app is incorrectly changing the Content-Transfer-Encoding of parts of the multi-part message encoding that should not have changed. Oops. Oh well. I guess if I want to try to edit Mail.app's internal representation of the messages that it has broken...

Feb 2, 2015 7:08 AM in response to dme26

Haha, I tried the same thing with Text Edit. It worked.

Move the corrupt message to a local mailbox (on your computer). Locate the message in Finder: ~Library/Mail/V2/Mailboxes… (might take some time if you have millions of messages and mailboxes, but some kind of clever Spotlight search might help.) Open the message in Text Edit, change "Content-Transfer-Encoding: base64" to "Content-Transfer-Encoding: 8bit". Open up Mail again and look at your message in awe.

But, of course, this can't be done every time the corruption appears.

Feb 2, 2015 11:55 PM in response to 750 H2C

One interesting observation I've made is that whenever I perform this Text Edit remedy (works every time), I find that I have to replace the string twice for each corrupt message. Maybe the corruption appears only when there's an earlier message included (as a reply thread) that is also coded the wrong way? This is a bit beyond me, but it might be interesting for you guys who know more about this.

Feb 3, 2015 2:47 AM in response to 750 H2C

I have the same issue where by removing the attachments all the mail content is replaced with gibberish type symbols. All was well with mail and has been for many years unti I updated to Yosemite and then the problem did not become apparant for a few weeks. I have noted that it only occurs in a string of mails where there is more than 1 reply


I have logged a bug report with apple but may have to seek an alternative mail app. Does any one have a good suggestion for this?

Feb 3, 2015 3:10 AM in response to Bruce 55

I had the same idea about using another email app until this has been solved. I scanned the market and settled with Postbox, which seemed to be competent enough for my needs. (Which might not be the same as yours, of course.)


But as it turned out, Postbox seemed to suffer from a quick-fix update to meet Yosemite standards. At least to my eye. Mostly GUI issues, but since my impression of any app is closely related to its GUI appearance, I decided not to proceed with it. In addition, its function for importing mailboxes from Apple Mail was a bit shaky.


So I'll personally stick with Apple Mail for a while longer, although the issue discussed in this thread (which is now manageable) is not my only problem with the app.

Feb 3, 2015 3:35 AM in response to 750 H2C

I'd also like to add that the Finder preview of the message file in Finder might be OK even with the erratic coding. I've had both kinds of files: ones where the Finder displays the gibberish characters and ones where the message looks OK. But they can all be fixed by this quick string replacement via Text Edit or similar.


Of course, the fastest way to find the message in Finder is to search for any files containing the message's subject line. So, this is my entire procedure:

  1. Copy the subject line of the corrupt message.
  2. Move the corrupt message to a local mailbox (on your computer).
  3. Quit Mail.
  4. Locate the message in Finder by pasting the copied subject line into Spotlight. It should be somewhere under ~Library/Mail/V2/Mailboxes/(the local mailbox to which you moved the message)… Note that the message preview in Finder might be OK.
  5. Open the message in Text Edit.
  6. Change "Content-Transfer-Encoding: base64" to "Content-Transfer-Encoding: 8bit" anytime it appears. For me it's always twice (at least), which corresponds to Bruce 55's experience that it's always a message with a thread of replies included.
  7. Save.
  8. Open up Mail again. Your message should now be de-corrupt.


This seems to work for me every time.

Feb 3, 2015 9:23 AM in response to 750 H2C

Delighted that the "base64" to "8bit" change works for some. But not for me, after two different sessions. And for the more recent session, after the revision, most of the text of the message disappeared. Accordingly, those of you wanting to experiment may want to make copies of that .emlx file you're editing, so you can go back to "regular" corruption if need be.


My problems seem to center around messages from folks using Exchange Server. I've done some text analyses of messages before and after corruption, and it appears that the removal of attachments results in a new, replacement message (which is what happens when attachments are removed in Mail) that changes the "Content-Type:" command from text/html to text/plain, and that the "Content-Transfer-Encoding:" command is not changed. There's too much going on in the text changes between an uncorrupt and a corrupt message for me to sort it all out. The odd thing to me is that, after an attachment is removed, the only text readable in the corrupted message is the text at the bottom of the message that says the attachment was removed. Somebody real smart please jump in and fix this for all of us. What a PITA!

Mail.app- 'Remove Attachments' corrupting mails

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