Imapsync
Best tool to move messages from one email account to another one
Installation
best with docker
docker pull gilleslamiral/imapsync
then move message to a subfolder
docker run gilleslamiral/imapsync imapsync \ --host1 imap.mailserver1.com --user1 user@mailserver1.com --password1 'passwordmailserver1' \ --host2 imap.mailserver2.com --user2 user@mailserver2.com --password2 'passwordmailserver2' \ --subfolder2 subfoldermailserver2