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.

Can you move ~/Library/Mail to another location?

I use Mail to give me local copies/backups of several Gmail accounts and so these files are getting pretty big. I would like to move them onto a locally (USB-)connected drive to give me more space on the (faster) internal drive for my Aperture Library.

Is this possible? How? Any tips/tricks to do/avoid?

Intel Mac Mini/MacBook Pro 2.4GHz/4GB, Mac OS X (10.5.6), Aperture 2.1.2

Posted on Jan 1, 2009 11:04 AM

Reply
Question marked as Best reply

Posted on Jan 1, 2009 11:14 AM

yes it's possible.


Quit Mail and copy the folder ~/Library/Mail to your external drive. then delete
the original folder ~/Library/Mail.
next open terminal and enter the following commands:

ln -s /Volumes/"externaldrivename"/Mail ~/Library/Mail

Substitute the name of your external in the above. keep the quotes. this creates a symbolic link to the mail folder on the external drive.


Also, the above command assumes that you moved the Mail folder to the top level of the external. if not, modify the path accordingly. lastly, make sure that when you start Mail the external is always connected. mail will crash otherwise.

Message was edited by: V.K.

Message was edited by: V.K.
6 replies
Question marked as Best reply

Jan 1, 2009 11:14 AM in response to Roger Price

yes it's possible.


Quit Mail and copy the folder ~/Library/Mail to your external drive. then delete
the original folder ~/Library/Mail.
next open terminal and enter the following commands:

ln -s /Volumes/"externaldrivename"/Mail ~/Library/Mail

Substitute the name of your external in the above. keep the quotes. this creates a symbolic link to the mail folder on the external drive.


Also, the above command assumes that you moved the Mail folder to the top level of the external. if not, modify the path accordingly. lastly, make sure that when you start Mail the external is always connected. mail will crash otherwise.

Message was edited by: V.K.

Message was edited by: V.K.

Jan 1, 2009 11:14 AM in response to Roger Price

Sorry, but while it's technically possible to do it, I wouldn't even think of it. Mail relies on the directory structure being intact, so if it doesn't find it where it's supposed to be, that will create a problem. Why don't you just backup your entire hard drive, or delete the email you don't need? Surely not all of them are that important to keep both on the Gmail servers and on your Mac.

Mulder

Jan 1, 2009 11:21 AM in response to Roger Price

Yes, although it's not really a good idea. Better to archive the mail you want to save, then store them elsewhere and delete the local copies from you Mail folder. However, if moving the entire folder is what you want to do then you need to first relocate the /Home/Library/Mail/ folder, then delete the contents of the /Home/Library/Mail/. Open the Terminal application in your Utilities folder and at the prompt enter the following and press RETURN:

ln -s /Home/Library/Mail /Path to_newlocation/Mail


This will create a symbolic link between the "real" Mail folder location and the relocated Mail folder. Note that the path to the new location must include "/Volumes/volname/" as the initial part of the path. If your "volname" has spaces then enclose the whole thing in single or regular quotes.

You must use the symbolic link because OS X aliases will not be fully resolved for folders or files located in the Library folders.

Jan 1, 2009 11:29 AM in response to Kappy

Yes, although it's not really a good idea. Better to archive the mail you want to save, then store them elsewhere and delete the local copies from you Mail folder.<<</div>


Thanks for the tip re "ln -s"; I had thought of this but wondered if others had actually tried it. Are you aware of this actually causing problems or is your advice just cautious?

With your suggestion of archiving...I cannot do that since the messages would no longer be retrievable in the Gmail accounts.....or is there some way that you can ask Mail to stop syncing mail older than some number of days?

Jan 1, 2009 11:42 AM in response to Roger Price

No, it should not cause any problems. My comment was indeed caution. Apple recommends you not move, rename, or delete any files or folders associated with OS X. Partly this is because Unix, OS X, and most applications expect to find things in their "normal" locations. If you move the folder to an external drive which is then for whatever reason offline, then your Mail program may attempt to create all the required missing stuff in the default Mail folder's location. And, you will not be able to change the name of the external drive (and you may have no need or desire to) or the location of the new Mail folder because that will break the symbolic link.

Otherwise, there shouldn't be any problems. I've done this when beta testing new versions of OS X so I don't have to copy everything to the test partition, but can still use the test version with all my regular stuff, but without having to include the entire Home folder. Of course I'm usually testing on a Mac Pro so I'm always using internal drives. But external drives should not present any problems as long as you keep them turned on and connected.

Mar 29, 2009 11:43 PM in response to Roger Price

I have been trying to move a sub set of my mail folders to another volume. I have several folders that are archives of old mail but I occasionally need to look up old mail and prefer to be able to quickly select a group of mail boxes and search them. I would like to move my archive mail to another volume to reduce the time that it takes to sync my home directory (os x server portable home directory).

Unfortunately while I can symbolic link the mail folders on another volume and use them in apply mail, entire message (spotlight) searches of the sym linked folders does not work. I have rebuilt the spotlight indexes etc both for the whole volumes and used mdimport to import just the sym linked folders with not luck. Full message searches work for all other mail folders except sym linked folders. I have seen in other discussions besides this one where sym linking the whole mail folder works but no mention of only doing some folders. Anyone have any ideas' if it can or should work and if so what I should do?

Can you move ~/Library/Mail to another location?

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