Posts

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.

Why do vacation messages not work with Roundcube webmail?

There could be several reasons why your vacation message is not working the way you might expect.

Lets review the Roundcube Filter settings.

Roundcube Vacation

  1. Vacation replies are a type of Filter. Go to Settings/Filters

  2. You may have multiple Filter Sets, but only one set may be active (designated with bold text). Use the gear at the bottom to enable/disable filter sets.

  3. Filters are individual rules. A typical user might have one filter set containing multiple filters to sort mail and a Vacation Filter which they enable/disable as needed.

  4. The Filter name is your short description and can be changed anytime.

  5. For most Vacation filters, you would choose ‘all messages’. You could be a bit more selective with a rule that applies to all messages but excludes mailing lists, mail from amazon, etc.

  6. Reply with message is the proper choice for a Vacation Message.

  7. Your email address(es) must be entered in My e-mail addresses. Enter them manually or use the Fill with all my addresses button and let Roundcube do it for you.

  8. Designates how frequently (in days) a vacation response may be sent. Imagine two mailboxes auto-replying to each other, this would create an endless loop.

  9. Enable/Disable individual filters here.

So why are vacation messages not working ?
  • Are both the Filter Set (2) and the Filter (3)(9) enabled ?
  • Did you choose All Messages (5) ?
  • Do you have your email address(es) entered correctly (7) in the Filter ?
The vacation reply only worked once then stopped.

The days field will prevent you from receiving more than one reply per day.
Try sending from an alternete email address.