This script Exim4 Log Analytics - Logs Viewer - Stats Report
, is a PHP script designed to be a self-hosted web-based analyzer for Exim mail server logs (specifically Exim4 logs). It processes the log files (mainlog
and rejectlog
, including gzipped versions og mainlog.1.gz
.. etc) to generate a summarized report of mail flow, including deliveries, deferrals, rejections, and top senders/recipients, all within a user-defined date range.
Stop Guessing! Visualize Your E-Mail Logs with this EXIM-Stats
If you manage an Exim mail server, you know the pain: Your logs are a giant, cryptic wall of text. Trying to manually answer critical questions like, “Why are my emails failing?” or “Which spammer is attacking me right now?” feels impossible.
You don’t need expensive monitoring tools or complex SIEM platforms just to manage your mail flow. You just need a simple, self-hosted solution that turns that chaotic log data into clear, actionable insights.
Introducing a powerful, self-hosted Exim Log Analyzer built in PHP. This tool cuts through the noise, delivering a beautiful, cached report that answers all your server’s mail flow questions instantly.
🛠️ Reuirements:
- SSH terminal access to copy Exim Logs into working folder via CLI command
- Any dedicated / shared web hosting with php7+ (or) php8+
- Zlib php extension (basically it will be there on most of the web hosting servers)
🛠️ How it works..?
- Upload this php file.
- Open that file via browser.
- It will create the necessary logs folder in the same working directory
- It will ask you to copy & run the CLI command (pre populated for you to easy copy & run)
- Run that copy command into you terminal-ssh-console.
- Thats it. Now the browser will show you the report with filter options to analyse.
🚀 Feature Spotlight: Why This Analyzer is a Must-Have
This analyzer uses clever two-pass parsing and robust filtering to give you a complete picture of your mail server’s health.
Feature Category | Analyzer Capability | Technical Detail / SEO Focus |
Server Health | Instant Mail Flow Summary | Calculates Overall Delivery Success Rate. Tracks total Delivered, Deferred, and Rejected messages. |
Security & Abuse | Identify Top Spammers | Captures Instant Rejections and logs the IP address for detailed spam attempt analysis. Drill down to view the Top 5 IP addresses associated with specific rejection reasons. |
Log Processing | Robust, Two-Pass Parsing | Pass 1: Maps the Message ID to the Sender using $submissionPattern . Pass 2: Records the final outcome (Delivered, Deferred, Rejected). |
Performance | Fast & Efficient Caching | Implements a simple file-based caching system. Reports are loaded from cache for 1 hour, or until log files are updated. |
Log Ingestion | Zero-Fuss Log Prep | Provides a prominent, copy-paste CLI command to correctly copy Exim logs (including .gz files and rejectlog ) and set permissions. |
📊 Top Reports for Actionable Insights
The report organizes your critical mail statistics into clear, easy-to-read tables:
Report Type | Purpose | Key Data |
Top 10 Failure/Rejection Reasons | Aggregated reasons for messages that were Deferred (D= or == ) or Rejected (R= , ** , or Instant). |
Reason, Count, and Toggle to view Top IPs. |
Top 10 Senders | Quickly identify the users or systems generating the most overall traffic (for tracking legitimate use or abuse). | Sender Address, Total Count, and Percentage of total hits. |
Top 10 Rejected Recipients | Pinpoint the specific email addresses that are the target of the most permanent rejection events. | Recipient Address and Rejected Count. |
Date Filter | Allows analysis based on specific timeframes. | Input fields for start_date and end_date . |
🛠️ Get Started in 3 Simple Steps
This Exim log analysis tool only requires that you have the zlib PHP extension enabled to handle gzipped log files (the script explicitly checks for this).
- Deployment: Upload the
exim-stats.php
file to a web-accessible directory on your server. - Log Ingestion (Crucial): Visit the script in your browser. Copy the Step 1 CLI command displayed prominently at the top of the page. Run this command on your server to copy all necessary log files (mainlog, rejectlog, etc.) into the analyzer’s directory and set the correct permissions.
- Analyze & Filter: Once the logs are copied, the script will automatically parse them. Use the Date Filter box to narrow your analysis down to a specific day, week, or month.
Stop living in the log files. Implement this simple Exim Logs Analyzer today to gain unprecedented visibility into your mail flow, instantly improve your Exim server management, and get back to work!iency for Exim server management.
- Terms:
Exim server management
,Exim log viewer / log analyzer tool
.