Apple Mail is a pretty decent email client, but it saves all your attachments in a folder deep within your user library, sucking up disk space without ever really letting you know. Fortunately, this is an easy problem to solve if you know where to look. Sort of, anyway. Apple made removing your attachments very simple, but if you want to actually save and archive them it can be a bit more complicated — especially if you're running Lion. But not to worry, we'll walk you through the whole thing. The process can be a little tedious, but it's not too tough.
Stock image of the paperclip used in the title image by Francesco Chinazzo/Shutterstock.
Deleting Your Attachments
Deleting your attachments is very easy to do in pretty much every version of Apple Mail. Here's the fastest way to obliterate them all:
- Open up Apple Mail and create a new Smart Folder. You can do this by clicking the + sign in the bottom left corner of your Mail window, or by going to the Mailbox menu and choosing New Smart Mailbox.
- From there, make sure to specify that this Smart Mailbox's rules apply to all. (This should be the default.)
- Now all you have to do is set one simple rule: "Contains Attachments". You may also want to specify that the smart mailbox should include messages from your junk and trash folders, just so you're covering all your bases. When you're done, just click OK and Mail will create the smart mailbox.
- If Mail doesn't do it for you automatically, select the new smart mailbox you just created and watch the messages roll in. There will be a little indicator next to the mailbox in the sidebar to let you know Mail is still working. When it's done and all the messages with attachments have appeared, press Command+A to select every one of them (or go to the Edit menu and choose Select All).
- Go to the Message menu and choose the Remove Attachments option. (It should be toward the bottom.) It may take awhile for Mail to perform this task on every message if you have many, but go grab some lunch and check back in about an hour. By then, you should have attachment-free mailboxes.
One thing to note about this process, however, is what's happening behind the scenes. When you're deleting attachments from these messages, it not only kills the attachments on your hard drive but also on the server (assuming you're using IMAP — if you're using POP3 you're probably not storing anything on the server anyway). Basically, Apple Mail removes the attachments from the message, uploads an attachment-free version to the server, then delete the original from the server as well. This is especially bad if you were hoping to keep a copy remotely but not locally, but also kind of annoying because it's performing a mass update on lots of remote messages. When you do that, there's a decent chance something is going to get messed up and you'll wind up with some duplicates. While that's not the end of the world, it doesn't make this method the very best solution — just the simplest. Read on for the harder, but more thorough, method.
Archiving Your Attachments
Deleting or archiving your attachments is a pretty easy process in Snow Leopard, but Apple decided to make it more complicated in Lion (thanks Apple!). Because the instructions diverge quite a bit pretty quickly, we're going to include two sets. Follow the set of instructions that applies to your version of Mac OS X.
Instructions for Mac OS X Snow Leopard (10.6.x)
Step 1: Open up your home folder in the sidebar. (Don't know which one that is? Make a new Finder window by going to the File menu and choosing "New Finder Window", then look in the sidebar on the left for an icon of a house. It'll have your username next to it. Click on that to get to your home folder.)
Step 2: You should now see a folder called Library. Open that, then open a folder inside of Library called Mail. Once you're in the Mail folder, you should see folders prefixed with IMAP or POP followed by your email address and some other information. For example, mine would look like this: [email protected]@imap.gmail.com. You'll have as many folders like this as you have email addresses in Apple Mail, and you'll need to go into each to clean them out. Start by opening up the first one.
Step 3: Here you'll see a bunch of folders. Primarily of note is your INBOX folder (named something along the lines of INBOX.imapmbox), so let's start with that. Open it and you'll find an attachments folder. Everything inside the Attachments folder is — you guessed it! — another folder! Wait, what? So Apple Mail stores its attachments in kind of a weird folder structure, but basically every folder in the Attachments folder contains more folders with attachments. This means that if you archive these folders on another hard drive (and delete them on your main hard drive), you'll be deleting attachments and nothing else. It's not as straightforward as it could be, but at least it's not complicated.
Step 4, 5, 6, etc: The remaining steps in this process involve rinsing and repeating. You just scrubbed your INBOX folder for attachments, but if you store attachment-based messages in other mailboxes in that same account, you need to go back through all of those and remove their attachments the same way. If you have multiple email accounts you have to repeat this entire process for each account as well. Yes, it's tedious, but so long as you don't have more inboxes than fingers you should be able to pull it off on your lunch break.
Just be glad you haven't upgraded to Lion yet. Those folks are in for some pain.
Instructions for Mac OS X Lion (10.7.x)
Step 1: Show your user library! One of the annoying parts of Mac OS X Lion is that Apple hid the user library so, presumably, you don't accidentally go digging around in there if you don't know what you're doing. Since we're going to tell you what to do so you don't screw anything up, you don't need to worry about that. You do need to worry about making your user library visible, however, so let's start there.
First things first, jump into the Terminal (Hard Drive -> Applications -> Utilities -> Terminal) and paste in the following command:
chflags nohidden ~/Library
Press enter and your user library will be visible in your home folder. Don't know which one that is? Make a new Finder window by going to the File menu and choosing "New Finder Window", then look in the sidebar on the left for an icon of a house. It'll have your username next to it. Click on that to get to your home folder.
Alternatively you can just hold down the option key in the Finder, click on the "Go" menu, and you'll be able to choose Library from the list. Some people may find this method easier since it do, but we prefer to have the Library visible since we like to go in there and mess around now and again.
Step 2: Head on into your home folder, then open up Library, and then Mail. You should have a folder labelled "Mail Lost+Found" and another labelled "V2". V2 is the folder you're looking for, so open that one up. In the V2 folder, you should see at least one folder prefixed with IMAP or POP followed by your email address and some other information. For example, mine would look like this: [email protected]@imap.gmail.com. You'll have as many folders like this as you have email addresses in Apple Mail, and you'll need to go into each to clean them out. To start the purging process, open up the account folder you'd like to scrub first.
Step 3: Because Lion organizes its Mail a little differently — and by differently we mean horribly — you have to go through a lot of trouble to dig out all your attachments. To make this easier, we're just going to search for them. Press Command+F (or choose Find from the File menu). By default, the search window will search "This Mac" instead of the current folder. You need to switch that to the current folder, which should appear to the right (see the picture for an example). Once you've made that selection, search for the word Attachments. Lion's search will provide a drop-down menu offering to search for only filenames containing the word Attachments. Choose this option. When the results show up, make sure they are sorted by Kind. Next, locate all the folders (which will most likely be on top). You should see tons of folders called Attachments. Move them onto another hard drive and delete them. That'll clear out all your attachments for that account. Just note that they'll be re-downloaded if you view their associated message in Mail again.
Step 4: Repeat the previous step for your other accounts. Why not just perform the search for all accounts instead of each individually? Technically you could do that, but if you want to archive your attachments so they're separated by account you'll need to do them individually. If you don't care, or if you're just deleting everything, then ignore this step and perform Step 03's search on the V2 folder instead of the each individual account folder.
Congratulations, you survived and you're rid of your attachments!
Republished from Lifehacker