From 9652a71816a504de922fe461dda9816f62fe1852 Mon Sep 17 00:00:00 2001 From: "Claude (bootstrap)" Date: Sun, 31 May 2026 11:57:32 -0700 Subject: [PATCH] extract: skip cpmove-*/homedir/mail tree WHP does not import cPanel mailbox data (mail-import is a panel-side roadmap item, not a sandbox-mode step). Extracting + ClamAV-scanning the mail tree wastes time and disk: on real customer accounts the mail dir often dwarfs everything else (10+ GB of historical maildir/mbox), and clamscan has to walk every message. Appended to the existing tar --exclude-from list (where we already strip DANGEROUS-classified symlinks) so the existing plumbing covers both. tar's fnmatch globs handle nested mail subdirs. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/extract.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/extract.sh b/scripts/extract.sh index 07cd824..e42c447 100755 --- a/scripts/extract.sh +++ b/scripts/extract.sh @@ -86,6 +86,20 @@ if [[ "$DANGEROUS_COUNT" -gt 0 ]]; then done < "$EXCLUDES_FILE" fi +# Also skip the cpanel user's mail spool entirely. WHP doesn't import +# email (mail-import is a panel-side roadmap item, not a sandbox-mode +# step) so extracting + scanning the mailbox tree wastes time and disk: +# on real customer accounts the mail dir often dwarfs everything else +# (10+ GB of historical mbox/maildir). The exclude pattern uses tar's +# fnmatch globs and covers both maildir + spool layouts at any depth +# under homedir/. Logged as an info line so it shows up in the panel +# import log alongside the symlink strips. +{ + echo "cpmove-*/homedir/mail" + echo "cpmove-*/homedir/mail/*" +} >> "$EXCLUDES_FILE" +log "skipping mail tree (cpmove-*/homedir/mail) — WHP does not import cPanel mail" + # --- extract -------------------------------------------------------------- # Detect compression. cpmove can be .tar.gz / .tar.bz2 / .tar.