-
Notifications
You must be signed in to change notification settings - Fork 258
Script Email Alerts
Home · Start Here · Reference Map
- How LFD detects script-driven mail abuse.
- Required Exim logging options for script attribution.
- How to auto-disable abusive paths safely.
-
cPanel/WHM servers only (depends on Exim logging via
log_selector).
Related guide: Security-Features-Guide
| Setting | Purpose |
|---|---|
LF_SCRIPT_LIMIT |
Threshold — number of cwd= lines from the same path within one hour before an alert fires |
LF_SCRIPT_ALERT |
When enabled, LFD auto-disables the offending path (chattr +i + chmod 000) |
| File | Purpose |
|---|---|
/usr/local/csf/tpl/scriptalert.txt |
Email template for script alerts |
/etc/csf/csf.signore |
Paths to ignore (false-positive suppression) |
cPanel installations only.
LFD scans for emails being sent through Exim from scripts on the server.
When more than LF_SCRIPT_LIMIT log lines appear with the same cwd= path
within an hour, an alert is sent. This is useful for identifying spamming
scripts — especially PHP scripts running under the nobody account. The alert
includes the Exim log lines and an attempt to find scripts that send email in
the flagged path.
You must add extended email logging in WHM > Exim Configuration Manager >
Advanced Editor. Search for log_selector and ensure the following are included:
log_selector = +arguments +subject +received_recipients
Without this setting, LFD cannot attribute mail sends to script paths.
When enabled, LFD disables the offending path using:
chattr +i /path/to/offending/dir
chmod 000 /path/to/offending/dirThe alert email includes the commands needed to re-enable the path if it was a false positive.
Add false-positive paths to /etc/csf/csf.signore — LFD will skip those
listed scripts on subsequent scans.
- Confirm Exim
log_selectorincludes required options. - Set
LF_SCRIPT_LIMITto a reasonable threshold (too low = false positives on legitimate bulk senders). - Initially keep
LF_SCRIPT_ALERTdisabled — review alerts manually first. - Reload CSF:
csf -ra - Monitor
/var/log/lfd.logfor script alert events. - Once confident in threshold accuracy, optionally enable
LF_SCRIPT_ALERTfor auto-disable.
-
Missing
log_selectoroptions — the feature silently does nothing without extended Exim logging. -
LF_SCRIPT_ALERTlocks paths aggressively —chattr +iprevents the user from fixing the issue; the admin must intervene. -
Legitimate bulk-mail scripts — mailing lists or cron-driven newsletters can trip the threshold; add known paths to
csf.signoreproactively. -
WHM Exim config resets — Exim Configuration Manager changes or cPanel updates can reset
log_selector; verify after updates.
See also: Process Tracking
Last reviewed: 2026-02-27
← Previous: Login Tracking · Next: Process Tracking
- Security Features Guide
- Cloud & Container Hardening
- Automation & IaC
- IPv6 Deployment & Hardening
- IP Block Lists
- Reference Map
- Introduction
- csf Principles
- lfd Principles
- csf CLI Options
- lfd CLI Options
- Login Tracking
- Regex Custom Cookbook
- Script Email Alerts
- Process Tracking
- Directory Watching
- Advanced Filters
- Multiple Ethernet
- Generic Linux
- FTP Issues
- Messenger Service
- Block Reporting
- Port Flood
- Pre/Post Scripts
- Port Knocking
- Connection Limit
- Port/IP Redirect
- Integrated UI
- RESTRICT_SYSLOG
- Exim SMTP AUTH
- UI Skinning
- InterWorx
- CentOS Web Panel