SSH into your zimbra server.
Change to zimbra server:
su - zimbra
/opt/zimbra/bin/zmmailbox -z -m firstname.lastname@example.org getRestURL "//?fmt=tgz" > /tmp/temp.tgz && /opt/zimbra/bin/zmmailbox -z -m email@example.com postRestURL "//?fmt=tgz&resolve=modify" /tmp/temp.tgz
Make sure you replace
firstname.lastname@example.org with proper addresses.
If the old mailbox is big you may encounter the following error:
ERROR: zclient.IO_ERROR (Read timed out) (cause: java.net.SocketTimeoutException Read timed out)
This is because the programmers of zmmailbox command have set a default timeout to avoid endless execution. Luckily for us, they have also supplied zmmailbox with the t option which let us specify the amount of time before the timeout error occurs. An infinite timeout is set with -t 0. So you may now want to rewrite the command like this:
/opt/zimbra/bin/zmmailbox -z -t 0 -m email@example.com getRestURL "//?fmt=tgz" > /tmp/temp.tgz && /opt/zimbra/bin/zmmailbox -z -t 0 -m firstname.lastname@example.org postRestURL "//?fmt=tgz&resolve=modify" /tmp/temp.tgz
Initially we have found the the idea in zimbra forums (https://forums.zimbra.org/viewtopic.php?t=62378) and we have also tried it many times in our own servers, especially with some multi giga byte accounts we manage and host.