Ubuntu Mail Server (postfix+dovecot): Create default Inbox, Sent, and Trash folder per account.

January 5, 2015 6.2k views


Now I have the mail server working IMAP mode.
I'm interested in configure the mail server in order to set default mail folders (like Inbox, Trash and Sent folders) per mail account.

Is there a way or command in Ubuntu to deal with it?
Thanks in advance.

2 Answers

Open /etc/dovecot/conf.d/20-imap.conf
There you will find the protocol imap section and change the mailplugins line to
plugins = $mail_plugins autocreate
Then add the following at the end of the file.
plugin {
autocreate = Trash
autocreate2 = Junk
autocreate3 = Drafts
autocreate4 = Sent
autosubscribe = Trash
autosubscribe2 = Junk
autosubscribe3 = Drafts
autosubscribe4 = Sent

Now the new users will get the folders above by default.

Thank you very much, @sianios. It worked like a charm!!! Best regards from San Luis Potosi, Mexico.

Have another answer? Share your knowledge.