Moving mail between some Plesk servers
If you’re migrating a domain, sometimes their mail will go to the old server for a while after you’ve changed the DNS. You can move their mail to the new server by following these steps:
- Go to the user’s Maildir directory
cd /var/qmail/mailnames/<domain>/<user>/Maildir
- Tar their mail directories
tar cvzf <user>.tar.gz cur new tmp
- Move to a web accessible location
mv <user>.tar.gz /home/httpd/vhosts/<web-accessible-domain>/httpdocs/
- Log onto the second server and go to the user’s Maildir directory
cd /var/qmail/mailnames/<domain>/<user>/Maildir
- Retrieve the user’s mail tar file that you created
wget http://<web-accessible-domain>/<user>.tar.gz
- Un-tar the files to their correct locations
tar xvzf <user>.tar.gz
- Remove the tar file
rm <user>.tar.gz
- Go to the original server and remove the tar file
rm /home/httpd/vhosts/<web-accessible-domain>/httpdocs/<user>.tar.gz