Hi,
After upgrading CyberPanel from the earlier version to the latest, I am facing a serious issue with email account creation and restore during migration.
- When importing a cPanel full backup with the script:
/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/cPanelImporter.py --path /home/backup/ - Email accounts are NOT created for the imported domains.
- The actual mailbox folders under
/home/vmail/<domain>/<user>/Maildir/
are not being created automatically, even after the email account appears in CyberPanel. - This worked correctly in the past (same migration script, earlier CyberPanel versions), but fails after the upgrade.
- Manually created mailboxes (via CyberPanel > Email > Create Email) also do NOT create the corresponding directories in
/home/vmail/
for new accounts, so login and mail delivery both fail. - Only workaround is to create the required folders manually and fix permissions, which is not practical for larger migrations.
Details:
- Maildir structure in
/home/vmail
is used, with the expected path from Dovecot config:
mail_location = maildir:/home/vmail/%d/%n/Maildir - Ownership/permissions of
/home/vmail/
are correct (vmail:vmail
). - Dovecot and Postfix services are running without fatal errors, but no maildir is created for new or imported users.
- Old domains/accounts (from before upgrade) work fine, only new ones have this issue.
Troubleshooting already attempted:
- Restarting Dovecot and Postfix.
- Re-creating accounts in CyberPanel.
- Manually triggering logins via Webmail (does not trigger maildir creation).
- Manually creating
/home/vmail/<domain>/<user>/Maildir/cur new tmp
folders, which then allows the account to work. - Checked logs (
/var/log/maillog
and/var/log/dovecot.log
) — no clear fatal errors, but maildir creation simply does not happen. - Verified
mail_location
indoveconf -n
output is correct.
This was NOT a problem before the upgrade!
Expected Behavior:
- Creating an email account in CyberPanel should automatically create the appropriate maildir folder structure in
/home/vmail/
. - cPanelImporter.py should also restore email accounts with their maildir structure, as in previous versions.
Actual Behavior:
- Email accounts does not appear in CyberPanel UI, and their folders are missing in
/home/vmail/
.
New Email accounts for domains appear in CyberPanel UI, but their folders are missing in/home/vmail/
. - As a result, webmail and IMAP/SMTP login do not work until maildir is manually created.
Steps to Reproduce:
- Upgrade CyberPanel to latest version.
- Import a cPanel backup or create a new email account.
- Check
/home/vmail/<domain>/
for new user directories (they are missing).
Environment:
- OS: AlmaLinux 9
- CyberPanel version 2.4 Build 2
Request:
Please investigate and fix this regression or provide a workaround/patch so email account creation also creates the correct maildir folders after upgrade.
Let me know if you need more logs or details!
Thanks!