Applicable to:
- Plesk for Linux
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@example.com
-
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 serverCreate the folder using the doveadm utility:
# doveadm mailbox create -u email@example.com -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@example.com:
# ./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
-
Comments
2 comments
If you are using Dovecot, you can do the same thing with a single command:
# doveadm mailbox create -u username@example.com -s INBOX.newfolder
@Larry Nedry
Thank you for the suggestion! The solution was added to the article
Please sign in to leave a comment.