- Plesk for Linux
How to create a new IMAP INBOX subfolder via command line on Plesk for Linux?
The example below demonstrates how to create a folder named newfolder for mailbox firstname.lastname@example.org
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@example.com -s INBOX.newfolderIf 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 firstname.lastname@example.org:
Enter the domain name. For example, "example.com":
Enter the mail account (without the domain name), for example "email":
Enter the name of the new folder to be created:
/var/qmail/mailnames/example.com/email/Maildir/.newfolder directory created successfully