Question
How to create a new IMAP INBOX subfolder via command line on Plesk for Linux?
Answer
The example below demonstrates how to create a folder named newfolder for mailbox [email protected]
-
Connect to the server over SSH
-
Check what IMAP server is used:
# command -v doveadm >/dev/null && echo ‘Dovecot’ || echo ‘Courier IMAP’
-
Create the mail folder:
If Dovecot is used on the server
Create the folder using the doveadm utility:
# doveadm mailbox create -u [email protected] -s INBOX.newfolder
If Courier IMAP is used on the server
-
Download the attached script into the server:Â
# wget https://plesk.zendesk.com/hc/article_attachments/360012292139/courier_imap && chmod +x courier_imap
-
Run the script and specify the domain, mail account, and the name of the subfolder that needs to be created. For example, for [email protected]:
# ./courier_imap
Enter the domain name. For example, “example.com”:
example.com
Enter the mail account (without the domain name), for example “email”:
email
Enter the name of the new folder to be created:
newfolder
/var/qmail/mailnames/example.com/email/Maildir/.newfolder directory created successfully
-