When migrating email services one does not want to lose the old messages. This tool copies messages from one IMAP system to the other. We've used this to migrate from Exchange to Gmail/Google Apps, Gmail to Exchange, Exchange to Exchange, in or out of dovecot too.
Here is a sample script to get started
#!/bin/bash -x curl edoceo.com/pub/imap-move.php > imap-move.php php ./imap-move.php \ --source imap-ssl://userA@domain:secretA@imap.example.com:993/ \ --target imap-ssl://userB@domain:secretB@imap.example.com:993/sub-folder
This script is also available on github.
This IMAP copy script supports a few options.
Here are a bunch of examples showing how to use imap-move.php
This copies from an Gmail style account to a Google Apps hosted domain duplicating folder structure
php ./imap-move.php \ -s imap-ssl://userA@gmail.com:secretA@imap.gmail.com:993/ \ -t imap-ssl://userB@domain.tld:secretB@imap.gmail.com:993/
We can copy mail from for example old.com to our new email system, storing these old messages in a folder calld Archive This will also work with Google Mail systems as a target.
php ./imap-move.php \ -s imap-ssl://userA@old.com:secretA@imap.gmail.com:993/ \ -t imap-ssl://userB@new.com:secretB@imap.gmail.com:993/Archive
php ./imap-move.php \ --wipe \ -s imap-ssl://userA@old.com:secretA@imap.gmail.com:993/ \ -t imap-ssl://userB@new.com:secretB@imap.gmail.com:993/Archive
php ./imap-move.php \ --fake \ -s imap-ssl://userA@old.com:secretA@imap.gmail.com:993/ \
Loading Comments from Disqus...