I have done a number of mail server migrations and imapsync has come through with shining colours for me in the past.
I’m moving a client’s email up to Telstra’s hosted Office365 solution and needed a way to push a large amount of email up to it.
After I managed to find the link for an older version of Xcode to install on 10.6, I then downloaded imapsync from fedora hosted and went to install it’s dependancies.
sudo perl -MCPAN -e 'install Mail::IMAPClient' sudo perl -MCPAN -e 'install Digest::MD5' sudo perl -MCPAN -e 'install Term::ReadKey' sudo perl -MCPAN -e 'install IO::Socket::SSL' sudo perl -MCPAN -e 'install File::Spec' sudo perl -MCPAN -e 'install Digest::HMAC_MD5' sudo perl -MCPAN -e 'install Authen::NTLM'
This usually works a treat, however this time around it got stuck installing the Mail::IMAPClient module.
When it was running the tests, it was throwing an error along the lines of this:
Can't call method "at" on unblessed reference at...
# Looks like you planned 41 tests but ran 1.
# Looks like your test exited with 255 just after 1.
It turns out that this is a known bug, not in IMAPClient but in Parse::RecDescent
More info on it is here: https://rt.cpan.org/Public/Bug/Display.html?id=74733
You can either downgrade Parse::RecDescent to an older version, or you can recompile the grammars in Mail::IMAPClient to use the new version. I chose to recompile the grammars in Mail::IMAPCLient
I had to change to the directory where cpan had downloaded the tar ball to, under ~/.cpan and then run the following two commands:
sudo perl -MParse::RecDescent - lib/Mail/IMAPClient/Thread.grammar Mail::IMAPClient::Thread && mv Thread.pm lib/Mail/IMAPClient/
sudo perl -MParse::RecDescent - lib/Mail/IMAPClient/BodyStructure/Parse.grammar Mail::IMAPClient::BodyStructure::Parse && mv Parse.pm lib/Mail/IMAPClient/BodyStructure/
I was then able to install the IMAPClient library successfully and imapsync now works.