IMAP, Sent mail, Apple Mail and Mavericks

This is one of those posts that’s chiefly intended for those Googling for a particular problem. It might still make gripping reading, though, for those of you interested in the internals of email protocols…

Most email programs nowadays allow you to specify the folder in which you want to save your outgoing messages, and choose whether that should be stored locally or on your email server. (Assuming you’re using IMAP to fetch your mail, that is. If you’re still using POP, you should get another mail provider. And if you’re using Exchange… well, you have my sympathy…)

But different apps have traditionally had different names for this folder: some call it ‘Sent’, others ‘Sent Items’ or ‘Sent Messages’ and some will use a folder with one name and display it as something else to the user. (The same is sometimes true of ‘Drafts’, ‘Trash’, and ‘Junk Mail/Spam’). So, over the years, I’ve tended to standardise on ‘Sent’, and when I set up a new mail app or a new machine, I configure it to use that folder.

But recently, that setting didn’t always seem to be stick, and I found some of my mail would end up in different folders when sent from some devices. Still, I persevered, until I installed Mavericks on my Mac, and found that the setting wasn’t even available on Apple Mail, at least, not for my main account – it was greyed out! What could be going on?

Screen Shot 2013-11-16 at 08.37.45

So I started to investigate. I dug into the file that Mail uses to store information about its accounts (currently ~/Library/Mail/V2/MailData/Accounts.plist) and I came across a setting which gave me a clue: it was called HasServerDefinedSentMailbox, and for this account it was set to YES. Mmm…

In the past, IMAP basically just provided you with a smart filing system for your mail, and it’s proved a remarkably resilient one, when compared to other formats. As an aside, I felt very old recently when I told a colleague in the lab that I had used the same method for storing my mail for ages, and had emails from 1991/92 in there that were just as accessible now as they had been then. He laughed, and said, “That’s the year I was born!”. Sigh… Still, compare that to data stored n tapes and floppies.

Anyway, a few extra features have been added since then, and one of these came just a couple of years ago. RFC 6154 describes ‘new optional mailbox attributes that a server may include in IMAP LIST command responses, to identify special-use mailboxes to the client, easing configuration’. In other words, the server can tell your app which folders to use for these key functions. This makes a lot of sense, particularly when your email provider also has a webmail interface, for example. I use Fastmail, which has a really good one, and, of course, it needs to know what you want to use for sent mail, drafts, etc when you’re using it via the web. Fastmail reflect these folder choices in the IMAP protocol, to keep everything consistent. Which is fine by me: I now simply stick to using the ‘Sent Items’ folder that the server recommends, and all is well on all my devices.

Anyway, all of that is a long way of explaining why you may find the ‘Use this mailbox for’ menu items are greyed out, and why on iOS devices you may try changing the ‘Sent Mailbox’, only to find that your new setting doesn’t stick. If your server is specific about which folders should be used, Apple will take that setting seriously, which I think makes sense, but they aren’t yet very clear in the UI about why you can’t then change it yourself.

Hope that’s useful to somebody!

8 Comments

I must commend and thank you Quentin for this fascinating and informative article. I am continually trying to unravel the mechanics of email and the clients which handle it, often with little success. You’ve clearly described several issues and the reasons why they work or misbehave.

Thank you for taking the time to write and post it. I shall follow your blog with increasing interest.

I’m still unclear. Are you suggesting I need to change a setting in yahoo or with my email service provider account? Is there some setting I change in Mac mail preferences?

Glad you have old emails from before 2000.

Andrea –

I think this means that, if your email server defines the special-use mailboxes, you won’t be able to change them at the Mac end.

But if your mail service has a web interface which lets you change them directly at the server, the Mac should pick them up automatically. You’ll probably need to restart Mail, at least, to get the new settings.

All the best,
Quentin

Thanks, Quentin.This explains the greyed out setting options in Mac Mail. After more than 3 years, it is still a very useful and nicely written article that did not cause my eyes to glaze over at all.

Goody! Thanks Soren – I’m glad it was useful!

Q

Thanks Quentin for your enlightening article. However, I am still stuck with the question: why can’t I define a local mailbox-folder in Mail for a certain type of mail. To be more to the point: since my IMAP is running full, I want to store my old sent mail locally on my mac. But when doing so, the mailbox that I created and filled with sent mail, displays all mails with the sender (=me) in the header, not the receiver. I hoped to overcome this problem by defining this mailbox as a ‘sent mail’ mailbox. But Mail won’t let me…

Mmm. I can define a local mailbox as the ‘Sent’ mailbox for at least one of my accounts, but yes, the header in the inbox still shows the sender not the recipient.

I’ve been using Mailmate for a few years now, so am a bit more rusty on Apple Mail – there may be a way to get it to do this…

Actually, I noticed that, on the bottom of my sidebar, I have some extra mailboxes that are related to my emailprovider (called Sent Messages, SentMail, Spam and Trash, grouped under a header which is the name of my provider). Curiously, I can change their settings, but I cannot make them undone… Mailboxes that I have under the header “On my Mac” I cannot change. I also opened the account.plist but did not see anything like “HasServerDefinedSentMailbox”. It is a bit beyond me.

Got Something To Say:

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

*

© Copyright Quentin Stafford-Fraser