- Plesk for Linux
How to move all emails between folders of a mailbox without logging in to the mailbox?
Use the Docecot utility 'doveadm' in a command-line interface:
Connect to a server via SSH.
Use these commands to manage emails:
To move all emails from 'Folder1' to 'Folder2' on one email account:
# doveadm move -u email@example.com 'INBOX.Folder2' mailbox 'INBOX.Folder1' ALL
To move all emails from 'Folder1' to 'Folder2' on all email accounts registered in Plesk:
# for i in $(plesk bin mail -l | tr '\t' ' ' | cut -d' ' -f 3-); do doveadm move -u "$i" 'INBOX.Folder2' mailbox 'INBOX.Folder1' ALL; done