On a CentOS 7 machine running Postfix and Dovecot how could I create subfolder named 'Bulk' on a inbox trough command line?
I thought to use the maildirmake
command but this returns "maildirmake command not found".
On a CentOS 7 machine running Postfix and Dovecot how could I create subfolder named 'Bulk' on a inbox trough command line?
I thought to use the maildirmake
command but this returns "maildirmake command not found".
A Maildir is simply a directory that has the cur
, tmp
and new
subdirectories.
IMAP Folders are usually simply subdirectories inside the main Maildir whose names start with a period, and which in turn are themselves Maildirs. They must also contain a zero-length file named maildirfolder. See http://www.courier-mta.org/maildir.html
That makes it trivial to create new folders with the mkdir
command.
mkdir /path/to/Maildir/.Bulk
mkdir /path/to/Maildir/.Bulk/new
mkdir /path/to/Maildir/.Bulk/tmp
mkdir /path/to/Maildir/.Bulk/cur
touch /path/to/Maildir/.Bulk/maildirfolder
By making use of shell expansion you can reduce that to a single mkdir command:
mkdir -p /path/to/Maildir/.Bulk/{cur,tmp,new}
touch /path/to/Maildir/.Bulk/maildirfolder
An IMAP subfolder is not nested in the parents Maildir folder, but represented as a directory on the some levels as the parent, with a name that starts with a leading dot .
, the name of the parent folder, a second dot .
and then the name of the sub folder, i.e. a subfolder "Serverfault" in you "Bulk" folder may look like:
mkdir -p /path/to/Maildir/.Bulk.Serverfault/{cur,tmp,new}
touch /path/to/Maildir/.Bulk.Serverfault/maildirfolder
I've ended up using the doveadm mailbox create
command to create additional folders in mailboxes. It creates the necessary cur
, tmp
and new
subdirectories.