habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

cPanel Export Email User Account to Zimbra

2 min read

In the dynamic realm of system administration, need for smooth transitions between email platforms is not just a possibility. It’s a necessity. If We’re a sysadmin looking cPanel Export Email User Account to Zimbra, this is the right place. In this guide, we’ll navigate through the steps with finesse, ensuring migration is as seamless as possible.

Landscape – cPanel and Zimbra

Begin by acknowledging the robustness of cPanel. As a system administrator, We’re well aware of its user-friendly interface and comprehensive features. However, the decision to migrate often stems from a desire for enhanced functionalities, and that’s where Zimbra steps in.

Embracing Zimbra’s Versatility:

Zimbra, with its collaborative tools and open-source nature, offers a more integrated and collaborative experience. Recognize the potential of Zimbra to streamline communication and boost productivity within our organization.

Navigating the Export from cPanel:

  1. Log into cPanel and locate the email accounts you wish to export.
  2. navigate to /home/(user_name)/etc/your_domain.
  1. Compress folder @pwcache on the right pane with highlight folder and right click
  2. Download file @pwcache.zip
  3. Copy file to Zimbra Server with SCP, WinSCP or other. Put on folder /opt.

Import Account and Password Email cPanel to Zimbra

Login to Zimbra server, go to folder /opt/ and unzip the file.

cd /opt/
unzip @pwcache.zip
mv @pwcache pwcache

what is in the pwcache folder?

If we are curious about what is in the pwcache folder, we can see it with "ls -al" then "vim". Example:

[root@mail pwcache]# cd /opt/pwcache/
[root@mail pwcache]# ls -al
total 416
drwxr-x---  2 root root 4096 Oct  6 09:05 .
drwxr-xr-x. 5 root root 4096 Dec  5 11:07 ..
-rw-r-----  1 root root  198 Oct  6 09:32 accounting
-rw-r-----  1 root root  202 Aug 21 14:18 accounting.cbg
[root@mail pwcache]# cat accounting

The idea is, create script for select and get passwd from available user information. So we can create user and password same as cPanel mail account.

Create Script for Import

  1. Create script for looping users, get password and create account.
vim create-acc.sh

Fill with this code.


# Clear screen

rm create-account-zimbra.zmp
touch create-account-zimbra.zmp
echo "Looping for All Users"

for ACCOUNT in /opt/pwcache/*
PASS=`cat "$ACCOUNT" | grep passwd: | cut -d ':' -f2`
ACC=`echo $ACCOUNT | cut -d "/" -f4`

echo "Retrieve password account $ACC"
echo "ca $ACC@our-domain.com PasswordTemp" >> create-account-zimbra.zmp
echo "ma $ACC@our-domain.com userPassword '{crypt}$PASS'" >> create-account-zimbra.zmp

echo "Complete"

Note : Change domain our-domain.com with your domain!

  1. Give permission execute. And then execute.
chmod +x create-acc.sh
sh create-acc.sh

After finish, script will create file with name create-account-zimbra.zmp who contain with command for create account and modify password.

Run Script create Account Zimbra

As zimbra user, run the script from results of get user and password script cPanel above.

su - zimbra
zmprov < /opt/create-account-zimbra.zmp

Post-Migration Testing and Validation

After the migration, don’t forget the crucial step of testing. Ensure that emails are flowing seamlessly, and all features are functioning as expected. make sure sers can log in with their own password. cPanel Export Email User Account to Zimbra might seem like a daunting task, but with careful planning and the right tools, it can be a smooth and rewarding experience.

Credit Source: Imanudin.

See also  cPanel Exim Commands CheatSheet
habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Zimbra Relay Amazon SES

Zimbra is a widely used collaboration platform that provides robust email services. When it comes to improving email deliverability and ensuring the security of...
1 min read

Install Zimbra 10 Ubuntu 20.04 from Scratch

Zimbra 10 may have had specific installation requirements, and there might be updates or changes beyond that point. Here is simple guide how to...
4 min read

Zimbra Cannot start TLS: handshake failure

The Zimbra log show error message “Cannot start TLS handshake” typically indicates an issue with establishing a secure TLS (Transport Layer Security) connection. This...
1 min read

Leave a Reply

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

Never miss good article from us, get weekly updates in your inbox