Sub-folders in Dovecot?

How can I enable my Dovecot IMAP server to support sub-folders?

When I am trying to do an imapsync from my Gmail account to my Dovecot IMAP server I keep getting the following error:

NO [CANNOT] Mailbox doesn't allow inferior mailboxes

Solution 1:

Finally found the answer for this:

I had to change a small configuration in /etc/dovecot/dovecot.conf (on Ubuntu Server 14.04)

mail_location = maildir:~/Maildir:LAYOUT=fs

Source: http://wiki2.dovecot.org/MailLocation/Maildir