AutoCreate/AutoSubscribe and Special-Use IMAP folders

Requirements
  • OS X 10.9.x Mavericks with Server 3.x
  • OS X 10.10.x Yosemite with Server 4.x or 5.x
  • OS X 10.11.x El Capitan with Server 5.x

For this article, we assume you are comfortable editing config files with Terminal or a suitable text editor.

Sever 3.x was the first version of OS X Server to include Dovecot 2.1.

Dovecot 2.1 added several new features, we will cover:

  • How to define folders which are automatically created, and optionally auto subscribed for all imap users.
    This useful feature allows you to define a core set of folders all users should have.
    Obvious examples are folders like Junk and Drafts, but it can be used to create folders for any use.

  • How to define Special-Use folders
    Modern email clients will ask the imap server which folder is preferred for Sent, Trash, Junk and Drafts.
    Defining these Special-Use folders helps keep the user experience consistent and predictable.

Before editing any file, be sure to back it up.

We’ll be working with just this one file:

/Library/Server/Mail/Config/dovecot/conf.d/15-mailboxes.conf

Here is a default copy of the file

##
## Mailbox definitions
##
## Version 2.2.x (AR14759611)

# NOTE: Assumes "namespace inbox" has been defined in 10-mail.conf.
namespace inbox {

  #mailbox name {
    # auto=create will automatically create this mailbox.
    # auto=subscribe will both create and subscribe to the mailbox.
    #auto = no

    # Space separated list of IMAP SPECIAL-USE attributes as specified by
    # RFC 6154: \All \Archive \Drafts \Flagged \Junk \Sent \Trash
    #special_use =
  #}

  # These mailboxes are widely used and could perhaps be created automatically:
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Trash {
    special_use = \Trash
  }

  # For \Sent mailboxes there are two widely used names. We'll mark both of
  # them as \Sent. User typically deletes one of them if duplicates are created.
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }

  # If you have a virtual "All messages" mailbox:
  #mailbox virtual/All {
  #  special_use = \All
  #}

  # If you have a virtual "Flagged" mailbox:
  #mailbox virtual/Flagged {
  #  special_use = \Flagged
  #}
}

Not much to it – its already commented with clear instructions

Lets look at the definition for Drafts.

mailbox Drafts {
    special_use = \Drafts
  }

If we want Drafts to be auto created, we would add auto=create and to have Drafts created and automatically subscribed instead use auto=subscribe.

This simple change will ensure everyone has a Drafts.

mailbox Drafts {
    auto=create
    special_use = \Drafts
  }

You can add any new folder

mailbox Important {
    auto=create
  }

When done editing, you’ll need to stop/start dovecot to activate the change.

sudo launchctl stop org.dovecot.dovecotd

It will restart automatically.

1 reply
  1. Irvin Pietrzak
    Irvin Pietrzak says:

    Good afternoon, I was just taking a look at your site and submitted this message via your feedback form. The feedback page on your site sends you messages like this via email which is the reason you’re reading through my message right now right? This is the most important accomplishment with any type of online ad, getting people to actually READ your message and I did that just now with you! If you have an ad message you would like to promote to lots of websites via their contact forms in the U.S. or anywhere in the world send me a quick note now, I can even target your required niches and my prices are very reasonable. Shoot me an email here: Benja57mik57@gmail.com

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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