Note: These instructions still work under Mac OS X Leopard (10.5)

It has been brought to my attention that a surprisingly large number of people don’t know all the steps involved in properly configuring an IMAP account in Apple’s Mail.app. Though this has been covered elsewhere I’m sure, I thought I’d share the steps in a quick-start way to help reduce the frustration that results from assuming some things are done by default (know the basics already? skip to the last step »).

The Basics

Most of the IMAP setup process is identical to creating a POP account. Within Mail.app:

  1. Go to Preferences (Mail → Preferences)
  2. On the Accounts tab, click the [+] at the bottom left to start the account setup process
  3. Change the Account Type to IMAP and fill in your details
  4. Set the Incoming Mail Server and Outgoing Mail Server details

Many people stop at this point and assume they are finished. This is where problems arise, and why I’m writing this little tidbit.

IMAP Folders

IMAP allows all mail (including your Sent, Drafts, Spam and Trash folders, as well as custom folders) to live on the server. This is one of the main benefits of IMAP, since your account is identical whether accessing your mail from any workstation or webmail. The problem is that hosts create different sets of default folders when you create a new account, and that Mail.app doesn’t automatically connect the folders on the server to its local functions (most importantly, Sent mail and Drafts).

For example, MediaTemple only creates your Inbox and Spam folders; Dreamhost creates your Inbox, Sent, Drafts and Trash folders, but since Mail.app doesn’t automatically assign those functions to the folders on the server, it doesn’t actually matter in this case. This means if you don’t follow these next steps, you won’t have any sent mail or drafts saved anywhere; this can be an annoyance or a major problem, depending on your specific needs.

Creating IMAP Folders

Creating new folders is simple:

  1. Control-click (or right-click if you have a multi-button mouse) on the Inbox for your account (if you have multiple accounts within Mail.app, you’ll see sub-Inboxes in the left sidebar that have the names you’ve assigned each account), and select “New Mailbox…”
  2. In the resulting dialog, make sure that the correct account is selected in the drop-down menu, and enter a name for the mailbox (e.g. “Sent” if you’re on MediaTemple).

The mailbox is created on the server, and Mail.app updates its folder list for that account. Do this as many times as you want, whenever you need a new folder to help organize your messages (for our purposes, make sure your create whatever function-related folders are missing).

Setting Mail.app Straight

Now that you’ve made sure the folders exist, in order for Mail.app to save your drafts or copies of your sent messages it needs to know where to put them, so this final step is the most important:

  1. Click the folder name that matches the function you want to assign (e.g. “Sent”) so it is highlighted in the list
  2. Go to Mailbox → Use This Mailbox For → [function name] (e.g. “Sent” again)

That’s all there is to it—your folder will disappear from the list, and reappear as a sub-folder beneath the function you specified, with the same name as the account it’s connected to. So, if your account name is “My IMAP Account”, the “Sent” folder will now be located under “Sent → My IMAP Account” in the Mail.app sidebar.

Hopefully this will ease some of the frustration of setting up an IMAP account for the first time. After you’ve gone through the steps once, you’ll remember them for the future and never be without your drafts and sent messages again.

Update: Check out the comments below for some extra tips and tricks.