Dovecot/MySQL/Postfix - Setting up Folders

Hello everybody. Would somebody mind explaining how I can set up folders with a Dovecot/MySQL/Postfix setup on Ubuntu 11.04? I have my server running already, but I cannot for the life of me, get folders to work. I am trying to setup folders like Spam and Trash.

I have tried setting it up in the Dovecot configuration file (dovecot.conf). But, it still doesn't seem to operate as expected (or at all).

My current dovecot.conf:
> protocols = imap imaps pop3 pop3s

log_timestamp = "%Y-%m-%d %H:%M:%S "

mail_location = maildir:/home/vmail/%d/%n/Maildir

sslcertfile = /etc/ssl/certs/dovecot.pem

sslkeyfile = /etc/ssl/private/dovecot.pem

namespace private {

separator = .

prefix = INBOX.

inbox = yes


namespace private {

separator = .

prefix = INBOX.Trash.

inbox = no


protocol lda {

log_path = /home/vmail/dovecot-deliver.log

authsocketpath = /var/run/dovecot/auth-master

postmaster_address =

mail_plugins = sieve

globalscriptpath = /home/vmail/globalsieverc


protocol pop3 {

pop3uidlformat = %08Xu%08Xv


auth default {

user = root

passdb sql {

args = /etc/dovecot/dovecot-sql.conf


userdb static {

args = uid=5000 gid=5000 home=/home/vmail/%d/%n allowallusers=yes


socket listen {

master {

path = /var/run/dovecot/auth-master

mode = 0600

user = vmail


client {

path = /var/spool/postfix/private/auth

mode = 0660

user = postfix

group = postfix




Thank you for your help!

3 Replies


I'm with the same problem. I did follow this tutorial [1] and I can telnet to dovecot and postfix, but there isn't anything under /home/vmail - user's home where the mailboxes is supposed to be.

If somebody could give me any hints ou clues, I'll appreciate.

Thanks in advance.

1 - … 0.04-lucid">

IIRC, folders under /home/vmail are not created until mail has been received.

If you are still looking for a solution, you need to create the account and login for the first time. Then after, in order to create folders like Trash, Spam, and so-forth you need to run the following command:

sudo maildirmake.dovecot /etc/skel/Maildir
sudo maildirmake.dovecot /etc/skel/Maildir/.Drafts
sudo maildirmake.dovecot /etc/skel/Maildir/.Sent
sudo maildirmake.dovecot /etc/skel/Maildir/.Trash
sudo maildirmake.dovecot /etc/skel/Maildir/.Templates

Make sure you replace the directories as necessary.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct