How to create subfolder on mailbox trough Dovecot
On a CentOS 7 machine running Postfix and Dovecot how would one create subfolder named 'Bulk' in a inbox? Like 'INBOX.Bulk'.
I thought to use the maildirmake command but this returns "maildirmake command not found". After some digging it seems maildirmake is not available on RHEL systems. So how do I create a subfolder for an already existing mailbox?
As Dovecot is an IMAP server, one would normally use an IMAP client to create folders. This would work regardless of what storage backend Dovecot uses.
Dovecot also comes with the doveadm
tool which can manage folders i.e. "mailboxes":
doveadm mailbox create INBOX.Bulk
But if you need to do it manually, to create a Maildir folder use mkdir
to create both the base directory and the three subdirectories cur
, new
, tmp
that a Maildir folder needs.
For example, if your mail root is at ~/Mail
, you can create a folder using:
mkdir -m 0700 ~/Mail/.INBOX.Bulk
mkdir -m 0700 ~/Mail/.INBOX.Bulk/{cur,new,tmp}
Though creating subfolders under INBOX is mainly Courier imapd's thing – with Dovecot there's no need to do that; you can just as well create a folder named Bulk
directly.
mkdir -m 0700 ~/Mail/.Bulk
mkdir -m 0700 ~/Mail/.Bulk/{cur,new,tmp}