• On CBS MoneyWatch: Report: DON'T Buy the iPhone 4
advertisement
August 2, 2005 8:00 AM PDT

Mini-Tutorial: Backing up Mail.app mail

by CNET staff

Old e-mail messages are usually among the neglected components of a healthy backup routine. Despite their general tendency to contain sensitive, important information, and the utility they can serve when searching for old contacts or other data, many users fail to properly preserve previously viewed or sent messages.

In addition, having too many messages in your Mail.app database can cause significant performance issues, both when refreshing the entire list of messages, as well as when performing routine searches of recent items, or even launching and operating within Mail.app.

Here are a few simple solutions for quickly backing up your Mail.app messages.

Copy the ~/Library/Mail folder If you are using a POP account, the simplest method of backing up your Mail.app data is to simply copy the ~/Library/Mail folder (the tilde [~] represents your home user directory) to a separate backup location -- your .Mac iDisk, a CD-R(W), DVD-R(W), an external hard drive, etc.

Your best bet is to perform this process manually by dragging the folder to its new location, as many back tools have been shown to improperly copy Mail.app's data files and folder structure.

If you ever want to restore mail backed up via this method, simply replace the ~/Library/Mail folder on your new Mac OS X installation with the "Mail" folder you've backed up to a separate volume.

If you are using an IMAP account, you can use this method as well, though not all mail will be preserved since items are only cached, not fully stored locally.

One huge advantage of this straightforward method is that all proper tags (date, sender, subject, etc.) will be preserved, and messages will be stored in the standard .mbox format, which is readable by a number of other e-mail clients if you choose to switch away from Mail.app in the future.

Forward messages to a Webmail account If you use a Webmail service with lots of extra capacity (Google's Gmail currently offers 2 GB), you may want to consider forwarding your old messages to this account, and setting up a rule in Mail.app to forward all new messages as they are received.

To set up a new rule, open Mail.apps preferences, and click the "Rules" button. Select "Add Rules." Select "Every Message" from the "If [...] of the following conditions are met:" field, and "Forward Message" from the "Perform the following actions" field.

Once this rule is created, you can either select all the old messages in your Account Inbox and select "Apply Rules" from the "Messages" menu item. Alternatively, you can simply use the "Forward" option.

There are some significant drawbacks to this method, however.

First, the appropriate tags will be lost. All old mail you forward to the Webmail account will have a time stamp of the day it was forwarded, not the accurate time of reception or sending. In addition, all messages will be "from" your own personal e-mail address, so it will be impossible to accurately organize according to sender.

Second, there are some privacy and security issues to consider. Google uses technology that targets ads to users based on the content of e-mail messages. Google does not provide any guarantee for long term existence of Gmail accounts, and in fact discourages automatic forwarding of e-mail.

Still, Google's comprehensive, and fast built-in search functionality pacifies the above complaints to some extent.

Saving/stripping attachments There is an easy method for stripping your inbox of all attachment files, saving them in a separate location rather than allowing them to eat large amounts of disk space on your startup volume.

Simply select all the messages in your inbox and use the "Save Attachments" option in Mail.app's "File Menu." Once you've saved pertinent attachments to an appropriate location, you can again select all messages and select "Remove Attachments," emptying your Trash once the process is completed.

Use a third party utility The application ZOE is an elegant solution for locally backing up messages directly from your server (IMAP included). It has an excellent search function, and its freeware to boot.

ZOE runs as a Java applet in the background, and can be accessed through a browser interface.

Feedback? Late-breakers@macfixit.com.

Like what you've found in this tutorial? Get more troubleshooting guidance (updated daily) by subscribing to MacFixIt Pro.

Resources

  • ZOE
  • Late-breakers@macfixit.com
  • subscribing to MacFixIt Pr...
  • More from Tutorials
  • Recent posts from MacFixIt
    iTunes 10 user interface sees some minor changes
    Apple seeds iOS 4.1 Gold Master to developers
    Possible fix for Harman Kardon iSub problems with PowerPC Macs
    Precautions to take before installing iTunes 10
    A reminder on how to reset your Mac's system password
    Mail messages appearing blank
    Adobe Lightroom update brings direct Facebook publishing; Camera Raw 6.2 released
    Weekly troubleshooting utilities update
    Add a Comment (Log in or register) (12 Comments)
    • prev
    • next
    by rpphoto555 August 2, 2005 9:41 AM PDT
    I use iData to archive my mail into an easily searchable archive which can be
    stored and shared from any drive. It's incredibly simple mail import function
    makes the process easy. I use iData to archive mail and collect bookmarks from
    websites in an automatic fashion.

    ---
    abandon cliches
    Reply to this comment
    by RichL August 2, 2005 9:41 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by rpphoto555</i></div></class><br />
    Who makes "iData"??

    Thanks
    Reply to this comment
    by iGreg August 2, 2005 9:41 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by rpphoto555</i></div></class><br />
    If you use .Mac mail in the Apple Mail program, is it POP, IMAP, or what? In Mail
    Preferences it is simply called .Mac Mail.

    ---
    iMac G5, 17&quot;, 1.8 GHz, 1GB RAM
    PowerBook G4, 12&quot;, 1.5 GHz, 768 MB RAM
    Both OS 10.4.2
    Reply to this comment
    by dispekta August 2, 2005 10:26 AM PDT
    Instead of "Forwarding" mail to a Gmail account, how about "Redirecting"
    instead? This way (I think) the actual From: and Date: are preserved.
    Reply to this comment
    by udo1 August 2, 2005 10:56 AM PDT
    I use this method:
    1. I created two new folders (mail boxes) in Mail named "recently In" and
    "recently Sent".
    2. I wrote an AppleScript that moves all messages in the In box, except those
    that are flagged or not yet read to the "recently In" mail box, and all
    messages in the Sent mail box to the "recently Sent" mail box. I run that
    script daily. (Could even be run automatically.)
    3. One a year I burn the "recently In" and "recently Sent" mail folders on a CD
    and give the CD a name, such as "2004 e-mail". Then I delete all messages in
    the "recently In" and "recently Sent" folders in Mail.

    If anybody is interested in the AppleScript I can post it.
    Reply to this comment
    by jkmscott August 2, 2005 10:56 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by udo1</i></div></class><br />
    I would be interested in seeing your AppleScript that moves mail to the
    Recently In and Recently Sent mail boxes.
    Reply to this comment
    by udo1 August 2, 2005 10:56 AM PDT
    <class="merchant"><span>&#62;&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by jkmscott</i></div></class><br />
    --
    -- Author: James Udo Ludtke
    --
    -- This script archives Inbox and Sent Mail messages to designated files.
    -- Flagged and unread messages are not moved, they remain in the Inbox.
    -- The repeat while loop is required in Tiger. It may no longer be required
    -- after a future system update.
    --
    -- If you like, you can comment out the dialogs that say "archiving Inbox",
    -- "archiving Sent Mail", and "all done"
    --

    set runNumber to 1

    tell application "Mail"

    activate

    if not (mailbox named "recently In" exists) then

    display dialog "mailbox 'recently In' does not exist" buttons {"OK"}
    -- script could be changed here to create the missing mailbox

    else

    delay 2
    -- this delay reduces the probability of having to move items
    -- with a second try

    -- move all messages, except flagged messages, from in "In" to
    -- "Recently In"

    repeat while runNumber &lt;= 3

    try

    set target_mbox to mailbox named "recently In"
    set message_count to (count of messages in inbox)
    if message_count is greater than 0 then
    display dialog "archiving Inbox" buttons {"OK"}
    giving up after 2
    repeat while (message_count is greater than 0)
    set message_to_move to message
    message_count in inbox
    if flagged status of message_to_move is false
    and read status of message_to_move is true then
    move message_to_move to target_mbox
    end if
    set message_count to message_count - 1
    end repeat
    end if
    set runNumber to 10

    on error -- do it once more

    set runNumber to runNumber + 1

    end try

    end repeat
    end if

    -- move all messages, except flagged messages, from in "Sent" to
    -- "Recently Sent"

    set runNumber to 1

    repeat while runNumber &lt;= 3

    try

    if not (mailbox named "recently Sent" exists) then
    display dialog "mailbox 'recently Sent' does not exist"
    buttons {"OK"}
    -- script could be changed here to create the missing mailbox
    else

    delay 2
    -- this delay reduces the probability of having to
    -- move items with a second try

    set target_mbox to mailbox named "recently Sent"
    set message_count to (count of messages in sent
    mailbox)
    if message_count is greater than 0 then
    display dialog "archiving Sent Mail" buttons {"OK"}
    giving up after 2
    repeat while (message_count is greater than 0)
    set message_to_move to message
    message_count in sent mailbox
    if flagged status of message_to_move is false
    then
    move message_to_move to target_mbox
    end if
    set message_count to message_count - 1
    end repeat
    end if
    end if
    set runNumber to 10

    on error
    -- do it once more

    set runNumber to runNumber + 1
    -- display dialog "doing Sent Mail run " &amp; runNumber buttons
    -- {"OK"} giving up after 2
    -- use this dialog to test if second run is required

    end try

    end repeat

    display dialog "all done" buttons {"OK"} giving up after 2
    beep

    end tell


    -- Note: Some command lines in this post spilled over into a second line
    -- in the narrow edit column. You will have to remove the line
    -- breaks, otherwise you will get compile errors.
    Reply to this comment
    by michaelj2 August 2, 2005 12:19 PM PDT
    "One huge advantage of this straightforward message is that all proper
    tags..."

    Perhaps you mean method rather than message in the above quote?
    Reply to this comment
    by WhiteDog August 3, 2005 3:37 AM PDT
    Unless I'm missing something, the biggest disadvantage to the save and
    restore method described here is that when you replace your current mail file
    with the archived one, you loose everything you've received since the backup
    was made.

    ---
    Don't anthropomorphize computers.
    They hate that.
    Reply to this comment
    by 123 August 4, 2005 10:20 AM PDT
    If I'm not horribly mistaken, you *will* save IMAP mail if you simply select
    account options -&gt; advanced -&gt; keep copies of messages for offline viewing
    -&gt; all messages and attachments.

    Furthermore, the point of IMAP is to keep mail on the server, so if you lose
    your iBook, all your mail doesn't disappear.
    Reply to this comment
    by BobLo August 5, 2005 12:54 PM PDT
    My mail backup needs are not so critical as to require a physical copy of all the messages I have ever received on hand, so this is what I do.

    For my dotMac, IMAP and POP email I use Apple's Backup.app to backup all the account information from Mail.app to my iDisk. For my POP email accounts, I turn on the setting "leave messages on server" and select a reasonable amount of time (months) before they get automatically deleted.

    Since all my email is now always cached on all the different servers, I can rebuild/replace the machine and get the Mail.app config back in place. Once that is done, all of the recent (relavent to me) email will come pouring back in.

    This approach is very simple to implement and could potentially work well for dotMac home users that don't have business email retention requirements and there is no additional charge if you already have a dotMac account.
    Reply to this comment
    by gordon227 November 11, 2008 11:04 AM PST
    I think zoe is fantastic. You have created a great walk through. it is really helpful to have the details on how to correctly back up email at your finger tips. You included some really good tools and some really great explanations for a process that if you do not understand you could do completely wrong.

    <a href="http://uptobat.com/">Baseball Bats For Sale</a>
    <a href="http://uptobat.com/">Cheap Baseball Bats</a>
    <a href="http://uptobat.com/cheap-baseball-bats-for-sale">Cheap Baseball Bats</a>
    Reply to this comment
    (12 Comments)
    • prev
    • next