macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

Using IMAP on Mac OS X
Pages: 1, 2, 3

Creating an IMAP-enabled Mail Account

First, create a new account. Call up Mail.app's Preferences dialog through Mail-->Preferences..., and then click the Create Account button, as seen in Figure 1. As shown in Figure 2, select IMAP Account from the Account Type menu on the resulting sheet, and fill in the textfields with information appropriate to this account.


Figure 1. Creating a new account.

 


Figure 2. Setting up an IMAP account.

Specifying Account Options

Click the same sheet's Account Options tab to see Mail.app's IMAP-specific options, shown in Figure 3. (The controls that appear under this tab depend upon the type of account you've selected under the Account Information tab.) Mail.app will fill the Connect to server using port: textfield with 143, the usual TCP port of a mailhost's IMAP service. Change this value only if you know that your host runs its IMAP service on a different port. Activate the Use SSL checkbox if your host supports secure IMAP (a.k.a. IMAPS) and you wish to take advantage of it; see the section called "Using IMAP Securely".


Figure 3.

Activate the Compact mailboxes when closing checkbox if you want Mail.app to purge your mailboxes of deleted messages when you quit the application; if left unchecked, deleted emails will remain within mailboxes, invisible to Mail.app but still accessible by other means. See the section called "Deleting Messages" for more details on how Mail.app handles IMAP mail deletion.

Account Directory

The sheet's Account Directory textfield lets you specify the location of this account's cache folder on your local file system. Unless you have good reason to do otherwise, leave this field blank; Mail.app will use its default location of Library/Mail/IMAP/account-name, which should work just fine. See the section called "Message Caching" for more details.

Once you've started to use the account, this field becomes grayed-out and uneditable.

Account Path Prefix

The Account Path Prefix textfield specifies the path that Mail.app will prepend to all mailbox names, when it's trying to locate them on the mail server. If you keep all your mailboxes in a directory called my_mail within your home directory, then you should put ~/my_mail here. (Where the ~ character is, of course, the Unix shorthand for "my home directory".)

On the other hand, if you never log into your mailhost machine directly, or are otherwise not sure what to put here, then you're probably safe putting nothing here at all, and letting the server figure it out for you.

Message Caching

To help keep things efficient, Mail.app keeps local caches of your IMAP accounts' content, even though the "real" messages reside on the server. By default, an account's cache lives in Library/Mail/IMAP within your Home folder, unless you specified a different folder when you created the account (see the section called "Account Directory"). Every account gets its own folder there, named IMAP/account name. Note the similarity between the structure of this folder on my Mac, and that of my actual, server-side IMAP mailboxes seen in Figure 4.


Figure 4. My mailbox drawer.

Note:The mailbox files with imapmbox extensions are actually packaged directories. If you're curious, you can explore their contents by control-clicking the mailbox icons and selecting Show Package Contents from the resulting pull-down menu, or just cd into them using the Terminal. You'll find some index and preference files, as well as a CachedMessages folder that contains one file for every cached message's MIME section.

Through the Message caching: pull-down menu, you can specify how much of your incoming email Mail.app should cache, and when it should cache it:

Cache all messages and attachments locally

This will direct Mail.app to download the entirety of every new message upon connection. This will allow you to read these messages and their attachments when offline, much as you can do through a POP account.

This is the default selection for a new Mail.app IMAP account.

Cache messages bodies locally

When selected, Mail.app will cache all new messages' text bodies, as well as a list of any attachments for each, but not the attachments themselves (unless they're relatively small). If you specifically request to see a message's attachment (by clicking on the attachment's icon in the message view window), Mail.app will fetch a fresh copy from the server for you.

This is a good choice if you like the convenience that having all your textual email stored locally (which allows nice features like indexing and searching), but would like to avoid downloading large attachments you might not always want.

Cache messages when read

This directs Mail.app to hold off on any message caching when fetching new mail. It will display new mail in the message list as usual, but doesn't actually fetch a message's content until you select one for reading. Once it loads a message, Mail.app places its body into the cache. Subsequent visits to this message will read from the cached copy (unless the server's version of the message changes).

Like the previous menu choice, this does not cache large attachments.

Don't cache any messages

Finally, this selection tells Mail.app to forget about caching entirely. Every time you access a message, Mail.app will fetch its contents from the server anew, regardless of whether you've read it before.

Mac.com Accounts

As testimony to IMAP's usefulness, the Mac.com accounts that Apple provides to its customers as part of its iTools package use IMAP as their protocol. This lets you consistently access and organize your Mac.com mail from any machine with an IMAP client —, Macintosh or otherwise.

Setting up a Mac.com-flavored IMAP account is easy; just select Mac.com Account from the Account Type pull-down menu, instead of IMAP Account. It's really just a shortcut that cues Mail.app to fill in the account configuration textfields to point to Apple's mail servers.

Pages: 1, 2, 3

Next Pagearrow