IMAP Migration PHP Script v2

A few things have changed since the last time I posted the IMAP migration script, and my wishlist of features is almost complete. Instead of a single file that you have to manually specify variables in, you now have fillable form that uses to send variables to another file (called process.php), which handles the actual migration. What this does is solve the memory issue, as you can specify the incremental value (number of emails it will transfer at a time) and it also makes it a little more user-friendly. I added support for unread emails (instead of just marking everything as read), and changed the imap_body command to “peek” instead of doing a full open, which marks the email as read as it’s transferring. This time around I am not going to post the code, but it will be included in the zip file.

On the todo list is directory traversing for people who organize their emails into folders, and some bug fixes.

Unzip this into a folder on your server, then run “email.php” from your browser.

Download here



2 Comments on “IMAP Migration PHP Script v2”

  1. I have been looking for mail migration tool that can retain the datetime of the original messages and the process was long and painstakingly. I’m grateful I’ve found your code here. Now I can move mailboxes to another mail server easily along with the original datetime of each message which is really important for me. Thank you, Brendan, for sharing the code, it works great.

Leave a Reply

Your email address will not be published. Required fields are marked *