Skip to content

Enable or exclude mailbox scanning

cPFence v4+ mailbox scans check messages and attachments separately from website files. Messages larger than 10 MB are skipped and counted in the scan log. For security, hard-linked message files are skipped too; these skips are expected and cannot be turned off.

Detection settings with Email Scanning, separate Email Quarantine and Email Spam Protection switches, server scope and Save.

Mailbox scanning has its own switch. The picture shows this server's saved settings, not fresh-install defaults or a scan result. Identifying values are hidden. Select the image for full size; use browser Back to return.
  1. Open Threat & Malware Detection and choose one server.
  2. Open Settings, set Email Scanning, then Save.
  3. Review mail counts and errors in full/smart scan output.

Root administrators can use:

Action Command
Enable mailbox scanning cpfence --enable-mail-scan
Disable mailbox scanning cpfence --disable-mail-scan

Identify the mailbox’s actual absolute directory before adding an exception. As root, replace the example with that directory:

Action Command
Add exact-path exception cpfence --exclude-exact-path /var/local/enhance/email/mailboxes/CONTAINER/MAILBOX
Remove exact-path exception cpfence --del-exclude-exact-path /var/local/enhance/email/mailboxes/CONTAINER/MAILBOX

The second command reverses the exception. Excluding a mailbox skips its messages; it does not make them safe. See email quarantine and mail scheduling.

Mailbox scanning uses cPFence’s mail signatures together with the server’s own ClamAV virus database, which ClamAV’s clamav-freshclam service keeps up to date. If that service is stopped, the ClamAV database gets old. When it is more than 7 days old, cPFence warns that the server’s ClamAV virus database is out of date and names the fix. Before cPFence 4.0.16, the mail signature refresh failed instead and kept the previous signatures.

As root on the affected server, turn ClamAV’s updates back on, then refresh the mail signatures:

Terminal window
systemctl enable --now clamav-freshclam
cpfence --mail-signatures-update

A successful refresh prints Mail signatures updated. Otherwise, the next hourly mail scan run refreshes them.