A user accidentally cleared their Inbox and there’s no Trash to restore from. The site is fine — only the mail is broken. A full account restore would overwrite the day’s WordPress edits; a mail-only restore is the right granularity.
What’s happening
JetBackup stores mail directories within the home tarball but in a structured way: /home/<user>/mail/<domain>/<account>/. The restore UI in WHM allows targeting the mail subdirectory specifically. The restored mail lands in the live location, with Maildir cur/new/tmp structure preserved.
The subtlety: an active mail user logged into webmail may have IMAP state that conflicts with the restored state. The cleanest restore is with the user logged out of webmail and IMAP clients momentarily disconnected.
How to verify
Confirm the snapshot has mail and verify what’s there:
jetbackup5api -F getRestorePoints -D '{"account":"<user>"}'
jetbackup5api -F snapshotContents -D '{"snapshot_id":"<id>","section":"email"}'
du -sh /home/<user>/mail/
ls /home/<user>/mail/<domain>/<account>/cur | wc -l
The cur file count in the live mailbox compared to what the snapshot indicates tells you how many messages were lost.
The fix
- Coordinate with the user to disconnect from webmail and pause IMAP clients. A 5-minute window is enough.
- WHM > JetBackup 5 > Restore > Email. Select the snapshot, navigate to the mailbox folder, restore. JetBackup preserves cur/new/tmp.
- After restore, run
chown -R <user>:mail /home/<user>/mail/<domain>/<account>to ensure the cPanel mail subsystem sees the files correctly. Maildir permissions: directories 0700, files 0600. - Tell the user to reconnect IMAP and refresh webmail. The restored messages should appear immediately.
- If a single message restore is needed (rare but happens): instead of folder-level restore, use the file restore flow against the specific Maildir filename. Maildir filenames look like
1715942400.M12345P67890.host:2,S— opaque but unique.
Stack Harbor handles mail-only restores under environment management when the email is mission-critical.