Topic: [FreeBSD] Export cPanel domains/mailboxes/aliases to iRedMail-0.6.0
I recently converted a cPanel machine used only for email to an iRedMail-0.6.0-beta3 setup. To save myself time I knocked up a small command line PHP script to run on the cPanel server to export cPanel domains, mailboxes and aliases/forwarders to the iRedMail MySQL layout.
The code is not perfect (typing this up I've just noticed that I've worked around a bug in my own code ) and I intend to modify it to allow a switch between exporting for primary MX and backup MX data generation (which I will post here), but it works and certainly on FreeBSD > FreeBSD migrations mailboxes don't need new passwords setting!
To filter out cPanel's weird aliases and strip all catch-all mail aliases I use email validation code by:
Michael Rushton which you can get at http://squiloople.com/ as well as the attached file.
Edit: changed from 7zip to normal zip