Maildir to Gmail with PHP

Deze post gaat verder in het Engels.

A few months ago our school migrated from a Postfix mail server to Google Apps for Education (Gmail). Because most of our teachers only used webmail (Horde) we had to migrate all messages from the old mail server to Google.

Download script

You may download the script maildir2gmail.php. It is provided "as is" and use is at own risk. I advise you to run the script outside business hours and while monitoring it. You may alter the script and share it only if you keep the copyright notices.

Features and requirements

You need a server with PHP 5.3. Message should be stored in maildir format. A lot of mail servers use this format. See Wikipedia article on Maildir for supported servers.

  • Keeps all files on the old mail server.
  • Marks read/unread information.

Possible issues

  • Some messages can't be migrated but normally this gives a clear error in the log file (too big, malformed, wrong date notation).
  • Issues with multithreaded PHP script.

Gepost: 4 april 2012 12u08 | 30 reacties