SecZim Knowledge Base

Everything you need to know about SecZim 3.4

Still need help?

Contact our support team at support@seczim.com

← Back to Knowledge Base

Installation Guide

Prerequisites

One-Command Installation

Install SecZim with your license key:

curl -fsSL https://get.seczim.com/install.sh | sudo bash -s -- YOUR-LICENSE-KEY
⚠️ Important: Replace YOUR_LICENSE_KEY with your actual license key from the purchase confirmation email.

What the Installer Does

Installation Output

After successful installation, you'll see:

✅ SecZim installed successfully!

📊 Web Interface:    https://your-server-ip:8880
   (self-signed certificate: your browser will warn once)
📧 Policy Server:    127.0.0.1:10035

Next steps:
1. Access the web interface at port 8880
2. Configure your mail server integration
3. Set up your security policies

Verifying Installation

Check that all services are running:

sudo systemctl status seczim
sudo systemctl status seczim-api

Next Steps

  1. Access the web interface at https://your-server:8880
  2. Configure Zimbra or Postfix integration
  3. Set up your first policies
  4. Configure Security Intelligence features

Troubleshooting

Installation Fails

License Validation Error

Services Won't Start

← Back to Knowledge Base

Upgrading SecZim

Keep your SecZim installation up to date with the latest features and security patches.

Quick Upgrade Command

To upgrade an existing SecZim installation to the latest version, use the --upgrade flag:

curl -fsSL https://get.seczim.com/install.sh | sudo bash -s -- --upgrade
Note: The --upgrade flag does not require a license key - it automatically reads your existing installation's license.

What the Upgrade Does

Mail servers attached with --agent have nothing to upgrade: they only hold a pointer to the central. Upgrade the central and they follow.

Database Migrations

The upgrade process applies database migrations that are:

Verbose Mode

For troubleshooting upgrade issues, use verbose mode:

curl -fsSL https://get.seczim.com/install.sh | sudo bash -s -- --verbose --upgrade

Full Reinstall

For major version updates or if you need to completely refresh your installation:

curl -fsSL https://get.seczim.com/install.sh | sudo bash -s -- YOUR-LICENSE-KEY

This will update all components while preserving your database and configuration.

Troubleshooting

Upgrade Fails

Services Don't Restart

← Back to Knowledge Base

Quick Start Tutorial

Get SecZim up and running in 5 minutes.

Step 1: Install SecZim

curl -fsSL https://get.seczim.com/install.sh | sudo bash -s -- YOUR-LICENSE-KEY

Step 2: Access Web Interface

Open your browser and navigate to https://your-server-ip:8880

You'll see the SecZim dashboard with real-time statistics and policy management.

Step 3: Verify Mail Integration

The installer automatically configures your mail server. Test the integration:

# Test policy server
echo -e "request=smtpd_access_policy\nprotocol_state=RCPT\nclient_address=1.2.3.4\nsender=test@example.com\nrecipient=user@yourdomain.com\n\n" | nc localhost 10035

Step 4: Configure Basic Policies

In the web interface:

  1. Go to Policies section
  2. Enable/disable features as needed (Greylisting, RBL, Geo-blocking)
  3. Configure quotas for your domains

Step 5: Monitor Traffic

The dashboard shows real-time statistics:

Common First Tasks

Whitelist Important Senders

Go to Access Control → Whitelist and add trusted domains or email addresses.

Configure Quota for Domain

Go to Quotas section and set daily sending limits per domain or user.

View Logs

sudo journalctl -u seczim -f
← Back to Knowledge Base

System Requirements

Minimum Requirements

Recommended by Plan

Starter Plan (500 accounts)

Professional Plan (2,000 accounts)

Business Plan (10,000 accounts)

Supported Operating Systems

Network Requirements

Mail Server Compatibility

← Back to Knowledge Base

License Activation

Automatic Activation

When you run the installer with your license key, activation is automatic:

curl -fsSL https://get.seczim.com/install.sh | sudo bash -s -- YOUR-LICENSE-KEY

Verifying License Status

Check your license status via API:

curl https://localhost:8880/api/v1/license/status

Or view it in the web interface under Settings → License.

License Types

Trial License

Paid License

License Renewal

Your license renews automatically. If renewal fails:

  1. Check your payment method at seczim.com
  2. Verify internet connectivity
  3. Contact support@seczim.com with your license key

Troubleshooting

License Validation Failed

License Expired

← Back to Knowledge Base

Configuring Zimbra with SecZim

SecZim integrates seamlessly with Zimbra 8.8.x, 9.x, and 10.x.

Automatic Configuration

The installer automatically configures Zimbra integration. To verify:

su - zimbra -c "postconf | grep check_policy_service"

You should see: check_policy_service inet:127.0.0.1:10035

Manual Configuration

If needed, configure manually:

Step 1: Configure Policy Service

Zimbra regenerates main.cf every minute from a template, so the change must go into the template. SecZim's line goes right before permit_sasl_authenticated. Run as root:

sed -i '/^permit_sasl_authenticated$/i check_policy_service inet:127.0.0.1:10035' \
  /opt/zimbra/conf/zmconfigd/smtpd_recipient_restrictions.cf

Step 1b: Fail Open

If SecZim is ever unreachable, accept mail unfiltered instead of deferring it. zmconfigd leaves this key alone, so it persists:

su - zimbra -c "postconf -e 'smtpd_policy_service_default_action = DUNNO'"

Step 2: Reload Postfix

su - zimbra -c "zmmtactl reload"

Step 3: Verify Configuration

su - zimbra -c "postconf | grep smtpd_recipient_restrictions"

Should include: check_policy_service inet:127.0.0.1:10035

Testing the Integration

Check the SecZim logs while sending a test email:

sudo journalctl -u seczim -f

After a Zimbra Upgrade

A Zimbra upgrade can replace the template file. Afterwards, verify SecZim's line is still there:

su - zimbra -c "postconf -h smtpd_recipient_restrictions"

If check_policy_service inet:127.0.0.1:10035 is gone, repeat Step 1 or re-run the installer with --upgrade.

Troubleshooting

Emails Not Being Filtered

Connection Refused Errors

If Zimbra can't connect to SecZim (port 10035):

← Back to Knowledge Base

Configuring Postfix with SecZim

SecZim integrates with Postfix 3.5.x through 3.8.x using the policy delegation protocol.

Automatic Configuration

The installer automatically configures Postfix. To verify:

postconf | grep check_policy_service

Manual Configuration

Step 1: Backup Current Config

sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.backup

Step 2: Add Policy Service

SecZim goes first in smtpd_recipient_restrictions, keeping your existing entries:

sudo postconf -e "smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10035, $(postconf -h smtpd_recipient_restrictions)"
⚠️ Never replace the whole list. Without reject_unauth_destination your server becomes an open relay. If you had no restrictions at all, use: check_policy_service inet:127.0.0.1:10035, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

Step 2b: Fail Open

If SecZim is ever unreachable, accept mail unfiltered instead of deferring it (Postfix's default is a 451 for every recipient):

sudo postconf -e "smtpd_policy_service_default_action = DUNNO"

Step 3: Reload Postfix

sudo postfix reload

Step 4: Verify Configuration

postconf | grep smtpd_recipient_restrictions

Where SecZim Sits in the Chain

Restrictions are evaluated in order and stop at the first permit or reject. SecZim must come before permit_mynetworks and permit_sasl_authenticated, otherwise it never sees local or authenticated mail, and before reject_unauth_destination, otherwise it never sees relay attempts:

smtpd_recipient_restrictions =
    check_policy_service inet:127.0.0.1:10035,
    permit_mynetworks,
    permit_sasl_authenticated,
    reject_unauth_destination

For an MTA that consults a central SecZim, replace 127.0.0.1:10035 with the central's address (see Multiple Mail Servers).

Testing

# Test policy server directly
telnet localhost 10035

# Monitor logs while sending test email
sudo journalctl -u seczim -f

Performance Tuning

Connection Caching

These are the values the installer sets; they keep the connection to SecZim open between queries:

sudo postconf -e "smtpd_policy_service_max_idle=300s"
sudo postconf -e "smtpd_policy_service_max_ttl=1000s"

Troubleshooting

Policy Service Not Responding

Emails Being Rejected

← Back to Knowledge Base

Security Intelligence System

SecZim includes a comprehensive Security Intelligence System that provides real-time threat detection, automated response, and security analytics.

Key Features

Accessing the Intelligence Dashboard

Navigate to https://your-server:8880 and click on Intelligence in the navigation menu.

Dashboard Overview

The Intelligence Dashboard shows:

API Endpoints

# Dashboard summary
GET https://localhost:8880/api/v1/intelligence/dashboard

# Alerts
GET https://localhost:8880/api/v1/alerts
GET https://localhost:8880/api/v1/alerts/rules

# IP Reputation
GET https://localhost:8880/api/v1/ip-reputation
GET https://localhost:8880/api/v1/ip-reputation/config

# Anomalies
GET https://localhost:8880/api/v1/anomalies
GET https://localhost:8880/api/v1/anomalies/config

# Auto-Blacklist
GET https://localhost:8880/api/v1/auto-blacklist
GET https://localhost:8880/api/v1/auto-blacklist/rules
← Back to Knowledge Base

Alert System

The Alert System monitors your email infrastructure and generates alerts based on configurable rules.

Default Alert Rules

RuleDescriptionSeverity
Quota Warning 80%Alert when user reaches 80% of quotaWarning
Quota ExceededAlert when quota is exceededHigh
IP Rejection SpikeUnusual rejection patterns from an IPHigh
Compromised AccountPotential account compromise detectedCritical
High Rejection RateSender with high rejection rateWarning

Alert States

Managing Alerts

In the web interface, go to Intelligence → Alerts to:

API Examples

# Get recent alerts
curl https://localhost:8880/api/v1/alerts?limit=10

# Get alert rules
curl https://localhost:8880/api/v1/alerts/rules

# Update alert status
curl -X PUT https://localhost:8880/api/v1/alerts/123/status \
  -H "Content-Type: application/json" \
  -d '{"status": "acknowledged"}'
← Back to Knowledge Base

IP Reputation Tracking

SecZim tracks the reputation of every IP that interacts with your mail server using a dynamic scoring system.

Scoring System

ActionScore Change
Initial Score50 (neutral)
Email Accepted+1 point
Email Rejected-5 points
Email Deferred-2 points

Automatic Actions

Manual Controls

In the web interface under Intelligence → IP Reputation:

API Examples

# Get all IP reputations
curl https://localhost:8880/api/v1/ip-reputation

# Get specific IP
curl https://localhost:8880/api/v1/ip-reputation/192.168.1.100

# Whitelist an IP
curl -X PUT https://localhost:8880/api/v1/ip-reputation/192.168.1.100/whitelist

# Blacklist an IP
curl -X PUT https://localhost:8880/api/v1/ip-reputation/192.168.1.100/blacklist
← Back to Knowledge Base

Anomaly Detection

SecZim uses machine learning-based detection to identify unusual sender behavior that may indicate compromised accounts or spam attacks.

Detection Types

TypeDescriptionTrigger
Volume SpikeSender volume exceeds baseline3x normal volume
New Recipients SpikeSending to many new recipients50+ new recipients
Out of HoursSending outside typical hoursBased on sender pattern

Baseline Learning

Severity Levels

Auto-Block (Optional)

Enable automatic blocking for critical anomalies:

API Examples

# Get recent anomalies
curl https://localhost:8880/api/v1/anomalies

# Get anomaly detection config
curl https://localhost:8880/api/v1/anomalies/config

# Update config
curl -X PUT https://localhost:8880/api/v1/anomalies/config \
  -H "Content-Type: application/json" \
  -d '{"auto_block_enabled": true}'
← Back to Knowledge Base

Auto-Blacklist Rules

Automated IP blocking based on malicious behavior patterns.

Default Rules

RuleTriggerBlock Duration
High Rejection Rate100+ rejections in 1 hour24 hours
RBL Hits10+ RBL hits per day7 days
SPF Failures50+ SPF failures in 1 hour12 hours
Geo Block Attempts20+ geo-blocked attempts in 1 hour24 hours

Features

Managing Blacklisted IPs

In the web interface under Intelligence → Auto-Blacklist:

API Examples

# Get blacklisted IPs
curl https://localhost:8880/api/v1/auto-blacklist

# Get auto-blacklist rules
curl https://localhost:8880/api/v1/auto-blacklist/rules

# Release an IP
curl -X DELETE https://localhost:8880/api/v1/auto-blacklist/192.168.1.100

# Make permanent
curl -X PUT https://localhost:8880/api/v1/auto-blacklist/192.168.1.100/permanent
← Back to Knowledge Base

Notification System

Multi-channel alerting when threats are detected.

Notification Channels

Email Notifications

Webhook Notifications

Slack Notifications

Configuration

Go to Intelligence → Settings in the web interface to configure notification channels.

Testing Notifications

# Test email notification
curl -X POST https://localhost:8880/api/v1/notifications/test/email

# Test webhook
curl -X POST https://localhost:8880/api/v1/notifications/test/webhook

# Test Slack
curl -X POST https://localhost:8880/api/v1/notifications/test/slack

Webhook Payload Format

{
  "alert_id": 123,
  "type": "ip_spike",
  "severity": "high",
  "title": "IP Rejection Spike Detected",
  "message": "IP 192.168.1.100 has 150 rejections in the last hour",
  "details": {...},
  "timestamp": "2025-11-30T23:00:00Z"
}
← Back to Knowledge Base

Greylisting

Greylisting temporarily defers emails from unknown senders, exploiting the fact that spammers rarely retry delivery.

How It Works

  1. New sender/recipient combination arrives
  2. SecZim returns DEFER (temporary rejection)
  3. Legitimate servers retry after delay
  4. On retry, email is accepted and sender is whitelisted

Configuration

In the web interface under Policies → Greylisting:

Automatic Whitelisting

IPs with high reputation scores (≥80) automatically skip greylisting.

Manual Whitelisting

Whitelist specific domains or IPs that should never be greylisted:

# Via API
curl -X POST https://localhost:8880/api/v1/greylisting/whitelist \
  -H "Content-Type: application/json" \
  -d '{"type": "domain", "value": "trusted-company.com"}'

Statistics

curl https://localhost:8880/api/v1/greylisting/stats
← Back to Knowledge Base

Quota Management

Control email sending limits per user, domain, or globally.

Quota Types

Configuration

In the web interface under Policies → Quotas:

  1. Click Add Quota Rule
  2. Select type (user/domain/global)
  3. Enter the sender pattern
  4. Set daily limit
  5. Save

Checking Usage

# Check all quota usage
curl https://localhost:8880/api/v1/quotas/usage

# Check specific sender
curl "https://localhost:8880/api/v1/quotas/usage?sender=user@domain.com"

Quota Alerts

The Alert System monitors quotas and generates alerts at:

← Back to Knowledge Base

Access Control Lists

Manage whitelists and blacklists for senders and domains.

Whitelist

Emails from whitelisted senders/domains bypass all checks:

# Add to whitelist
curl -X POST https://localhost:8880/api/v1/acl/whitelist \
  -H "Content-Type: application/json" \
  -d '{"type": "email", "value": "ceo@partner-company.com"}'

# Add domain to whitelist
curl -X POST https://localhost:8880/api/v1/acl/whitelist \
  -H "Content-Type: application/json" \
  -d '{"type": "domain", "value": "trusted-company.com"}'

Blacklist

Emails from blacklisted senders/domains are always rejected:

# Add to blacklist
curl -X POST https://localhost:8880/api/v1/acl/blacklist \
  -H "Content-Type: application/json" \
  -d '{"type": "domain", "value": "spam-domain.com"}'

View Lists

curl https://localhost:8880/api/v1/acl/whitelist
curl https://localhost:8880/api/v1/acl/blacklist

Wildcard Support

Use wildcards for flexible matching:

← Back to Knowledge Base

RBL (Realtime Blackhole Lists)

SecZim includes comprehensive RBL checking to block emails from known spam sources. RBLs are DNS-based blacklists that maintain databases of IP addresses known to send spam or malicious content.

How RBL Checking Works

When an email arrives, SecZim:

  1. Extracts the sender's IP address
  2. Reverses the IP octets (e.g., 1.2.3.4 becomes 4.3.2.1)
  3. Queries each enabled RBL by appending the reversed IP to the RBL hostname
  4. If a DNS response is received (typically 127.0.0.x), the IP is blacklisted
  5. Results are cached for 1 hour to reduce DNS lookups

Example DNS Query

For IP 192.168.1.100 checking against zen.spamhaus.org:

Query: 100.1.168.192.zen.spamhaus.org
Response: 127.0.0.2 (listed) or NXDOMAIN (not listed)

Available RBL Sources (12 Total)

Enabled by Default

NameHostDescription
Spamhaus ZEN zen.spamhaus.org The most comprehensive Spamhaus list. Combines SBL (known spam sources), XBL (exploited systems/proxies), and PBL (policy block list for dynamic IPs). Recommended as primary RBL.
Barracuda b.barracudacentral.org Maintained by Barracuda Networks. Covers spam sources, known bad actors, and compromised systems. High accuracy with low false positives.

Disabled by Default

NameHostDescription
Spamhaus SBL sbl.spamhaus.org Spamhaus Block List - contains IP addresses of verified spam sources and spam operations. Very accurate but covered by ZEN.
Spamhaus XBL xbl.spamhaus.org Exploits Block List - lists IP addresses of hijacked computers, open proxies, and other compromised systems. Also covered by ZEN.
SpamCop bl.spamcop.net Community-driven RBL based on user spam reports. Good for catching recent spam campaigns.
SORBS dnsbl.sorbs.net Spam and Open Relay Blocking System - comprehensive list covering spam, relays, and exploited systems.
UCEPROTECT Level 1 dnsbl-1.uceprotect.net Lists individual IP addresses that have sent spam. Most precise UCEPROTECT level.
UCEPROTECT Level 2 dnsbl-2.uceprotect.net Lists entire /24 IP ranges when multiple IPs from the range are spamming. More aggressive than L1.
UCEPROTECT Level 3 dnsbl-3.uceprotect.net Lists entire ASNs (Autonomous System Numbers) with poor reputation. Most aggressive - use with caution.
Invaluement dnsbl.invaluement.com Anti-spam DNSBL focused on detecting snowshoe spam and botnet operations.
PSBL psbl.surriel.com Passive Spam Block List - automatically lists IPs that send spam to honeypots.
Mailspike bl.mailspike.net Reputation-based RBL maintained by Mailspike with IP reputation scoring.

Recommendations

Small/Medium Organizations

Keep Spamhaus ZEN and Barracuda enabled (default). These provide excellent protection with minimal false positives.

High-Security Environments

Consider enabling additional RBLs:

Aggressive Filtering

For maximum spam blocking (may have more false positives):

Warning: UCEPROTECT Level 3 blocks entire ISPs/networks. Only enable if you're prepared for potential legitimate email blocking.

Configuration via Dashboard

In the web interface under RBL:

  1. Toggle RBL sources on/off as needed
  2. View statistics for each RBL source
  3. Monitor which RBLs are blocking the most spam

Manual RBL Check

To manually check if an IP is listed:

# For IP 181.111.252.219 against Spamhaus ZEN
dig 219.252.111.181.zen.spamhaus.org +short

# Response 127.0.0.2 = Listed
# No response = Not listed

Troubleshooting

RBL Not Blocking Listed IPs

  1. Check if RBL is enabled in the dashboard
  2. Verify DNS resolution works from your server
  3. Check daemon logs: grep "RBL" /var/log/seczim-daemon.log

High False Positive Rate

  1. Check which RBL is causing blocks in the dashboard
  2. Consider disabling aggressive RBLs (UCEPROTECT L2/L3, SORBS)
  3. Add trusted senders to the Access Control whitelist
← Back to Knowledge Base

Geographic Blocking

Block or allow emails based on the geographic location of the sending IP.

Configuration

In the web interface under Policies → Geo-Blocking:

Use Cases

GeoIP Database

SecZim uses the MaxMind GeoLite2 database for IP geolocation. The database is updated automatically.

← Back to Knowledge Base

Dashboard

The SecZim dashboard provides real-time visibility into your email security.

Accessing the Dashboard

Open your browser and navigate to https://your-server:8880

Dashboard Widgets

Navigation

← Back to Knowledge Base

API Reference

SecZim provides a REST API for programmatic access. The API runs on port 8880.

Base URL

https://localhost:8880/api/v1

Core Endpoints

EndpointMethodDescription
/statsGETGet server statistics
/mtasGETMail servers that queried SecZim in the last 7 days, with last query time and volume (3.4+)
/license/statusGETCheck license status
/policiesGETList all policies

Greylisting Endpoints

EndpointMethodDescription
/greylisting/configGETGet greylisting config
/greylisting/statsGETGet greylisting statistics
/greylisting/whitelistGET/POSTManage whitelist

Intelligence Endpoints

EndpointMethodDescription
/intelligence/dashboardGETDashboard summary
/alertsGETList alerts
/alerts/rulesGETList alert rules
/ip-reputationGETList IP reputations
/anomaliesGETList anomalies
/auto-blacklistGETList blacklisted IPs

ACL Endpoints

EndpointMethodDescription
/acl/whitelistGET/POSTManage whitelist
/acl/blacklistGET/POSTManage blacklist

Quota Endpoints

EndpointMethodDescription
/quotasGET/POSTManage quotas
/quotas/usageGETCheck usage
← Back to Knowledge Base

Common Issues

Service Won't Start

Check the logs:

sudo journalctl -u seczim -n 50
sudo journalctl -u seczim-api -n 50

Common causes:

Can't Access Web Interface

Mail Server Can't Connect

High Memory Usage

Installation Interrupted or Failed

If the installation was interrupted, truncated, or failed midway, you may need to manually clean up before reinstalling. Run these commands:

# Stop services
sudo systemctl stop seczim seczim-api 2>/dev/null
sudo systemctl disable seczim seczim-api 2>/dev/null

# Stop and remove Docker containers
cd /opt/seczim && sudo docker compose down -v 2>/dev/null

# Remove systemd services
sudo rm -f /etc/systemd/system/seczim.service
sudo rm -f /etc/systemd/system/seczim-api.service
sudo systemctl daemon-reload

# Remove all SecZim directories
sudo rm -rf /opt/seczim
sudo rm -rf /etc/seczim
sudo rm -rf /var/log/seczim
sudo rm -rf /var/lib/seczim

# Remove uninstall script
sudo rm -f /usr/local/bin/seczim-uninstall
sudo rm -f /sbin/seczim-uninstall

After running these commands, you can reinstall SecZim with a fresh installation.

Port 10035 Already in Use

If the installer reports port 10035 is in use:

← Back to Knowledge Base

Service Status

Check All Services

sudo systemctl status seczim
sudo systemctl status seczim-api

Check Ports

sudo ss -tlnp | grep -E '8880|10035'

Expected output:

Check API Health

curl https://localhost:8880/api/v1/stats

View Logs

# Daemon logs
sudo journalctl -u seczim -f

# API logs
sudo journalctl -u seczim-api -f

Restart Services

sudo systemctl restart seczim seczim-api
← Back to Knowledge Base

Getting Support

Email Support

Contact us at support@seczim.com

Information to Include

When contacting support, please include:

Gathering Logs

# Export recent logs
sudo journalctl -u seczim --since "1 hour ago" > seczim-daemon.log
sudo journalctl -u seczim-api --since "1 hour ago" > seczim-api.log

Documentation

← Back to Knowledge Base

Policy Configuration

SecZim uses a priority-based policy system to evaluate incoming emails.

Policy Priority

Policies are evaluated in order of priority (highest first):

  1. Auto-Blacklist Check (98) - Block known bad IPs
  2. IP Reputation (95) - Check IP score
  3. Anomaly Detection (92) - Check for unusual behavior
  4. Whitelist/Blacklist (90) - Manual ACLs
  5. RBL Check (80) - Check spam blacklists
  6. Geo-Blocking (70) - Geographic filtering
  7. Greylisting (60) - Temporary deferral
  8. Quota Check (50) - Sending limits

Enable/Disable Policies

In the web interface under Policies:

API Configuration

# Get all policies
curl https://localhost:8880/api/v1/policies

# Update policy
curl -X PUT https://localhost:8880/api/v1/policies/greylisting \
  -H "Content-Type: application/json" \
  -d '{"enabled": true, "defer_time": 300}'
← Back to Knowledge Base

General Settings

Accessing Settings

Go to the web interface at https://your-server:8880 and click Settings.

Available Settings

License

Notifications

System

Configuration File

Main configuration is stored in:

/etc/seczim/seczim.yaml

Restart After Changes

Most settings take effect immediately. For config file changes:

sudo systemctl restart seczim seczim-api
← Back to Knowledge Base

SecZim Logs

SecZim generates detailed logs for monitoring, troubleshooting, and auditing email security decisions. This guide covers all log file locations and how to use them effectively.

Log File Locations

Main SecZim Logs

Log FileDescriptionLocation
Daemon Log Policy daemon processing, module decisions /var/log/seczim-daemon.log
API Log REST API requests, dashboard activity /var/log/seczim-api.log

Related System Logs

Log FileDescriptionLocation
Postfix Mail Log General mail delivery and SMTP activity /var/log/mail.log or /var/log/maillog
Zimbra Mail Log Zimbra-specific mail activity /var/log/zimbra.log
System Journal Systemd service logs journalctl -u seczim

SecZim Daemon Log

Location: /var/log/seczim-daemon.log

This is the most important log for understanding email security decisions.

What It Contains

Log Format

TIMESTAMP LEVEL MODULE: MESSAGE

Example Entries

2024-12-04 10:23:45 INFO  SPF: PASS for sender@example.com from 192.168.1.100
2024-12-04 10:23:46 INFO  RBL: IP 10.20.30.40 is listed in Spamhaus ZEN: 127.0.0.2
2024-12-04 10:23:46 WARN  Greylisting: first attempt from unknown@spam.com -> user@domain.com (delay: 300s)
2024-12-04 10:23:47 DEBUG GeoIP: IP 203.0.113.50 -> Country: CN (blocked)

Log Levels

LevelDescription
DEBUGDetailed information for troubleshooting
INFONormal operational messages
WARNPotential issues or blocked items
ERRORErrors that need attention

SecZim API Log

Location: /var/log/seczim-api.log

Contains logs from the web dashboard and REST API.

What It Contains

Example Entries

2024-12-04 10:30:00 INFO  API: GET /api/v1/health -> 200
2024-12-04 10:30:15 INFO  API: POST /api/v1/settings -> 200
2024-12-04 10:30:20 INFO  Auth: Login successful for admin
2024-12-04 10:31:00 INFO  Worker: IP reputation decay completed

Viewing Logs

Real-time Log Monitoring

# Watch daemon log in real-time
sudo tail -f /var/log/seczim-daemon.log

# Watch API log in real-time
sudo tail -f /var/log/seczim-api.log

# Watch both logs simultaneously
sudo tail -f /var/log/seczim-daemon.log /var/log/seczim-api.log

View Recent Logs

# Last 100 lines of daemon log
sudo tail -100 /var/log/seczim-daemon.log

# Last 50 lines of API log
sudo tail -50 /var/log/seczim-api.log

Search Logs

# Find all RBL blocks
sudo grep "RBL:" /var/log/seczim-daemon.log | grep "listed"

# Find all rejected emails
sudo grep "REJECT" /var/log/seczim-daemon.log

# Find specific IP address
sudo grep "192.168.1.100" /var/log/seczim-daemon.log

# Find SPF failures
sudo grep "SPF: FAIL" /var/log/seczim-daemon.log

# Find greylisting events
sudo grep "Greylisting:" /var/log/seczim-daemon.log

Using journalctl (if using systemd)

# View daemon service logs
sudo journalctl -u seczim -f

# View API service logs
sudo journalctl -u seczim-api -f

# View logs since last hour
sudo journalctl -u seczim --since "1 hour ago"

# View logs with errors only
sudo journalctl -u seczim -p err

Troubleshooting with Logs

Email Not Being Delivered

Check what module blocked it:

sudo grep "REJECT\|DEFER" /var/log/seczim-daemon.log | tail -50

RBL Not Working

Check RBL activity:

sudo grep "RBL:" /var/log/seczim-daemon.log | tail -20

Greylisting Issues

Monitor greylisting decisions:

sudo grep "Greylisting:" /var/log/seczim-daemon.log

SPF Verification Problems

Check SPF results:

sudo grep "SPF:" /var/log/seczim-daemon.log | tail -30

Dashboard Not Working

Check API errors:

sudo grep "ERROR" /var/log/seczim-api.log

Service Not Starting

Check systemd logs:

sudo journalctl -u seczim -n 50 --no-pager
sudo journalctl -u seczim-api -n 50 --no-pager

Log Files Summary

FilePurposeCheck When
/var/log/seczim-daemon.log Policy decisions Email blocked/allowed questions
/var/log/seczim-api.log Dashboard/API activity Dashboard issues, API errors
/var/log/mail.log General mail flow Delivery issues
journalctl -u seczim-* Service status Service won't start
← Back to Knowledge Base

Statistics

Real-time Stats

curl https://localhost:8880/api/v1/stats

Returns:

{
  "total_requests": 1234,
  "accepted": 1100,
  "rejected": 134,
  "acceptance_rate": 89.14,
  "active_connections": 5,
  "uptime": 86400
}

Policy Statistics

curl https://localhost:8880/api/v1/policies/stats

Intelligence Statistics

curl https://localhost:8880/api/v1/intelligence/dashboard

Greylisting Statistics

curl https://localhost:8880/api/v1/greylisting/stats

Prometheus Metrics

Metrics are available at:

http://localhost:9090/metrics
← Back to Knowledge Base

Prometheus Metrics Exporter

SecZim includes a built-in Prometheus metrics exporter that exposes key metrics for monitoring your mail security infrastructure. This allows integration with Prometheus, Grafana, and other monitoring tools.

Endpoint

Metrics are exposed on port 8181 without authentication:

http://your-server:8181/metrics
Note: The metrics endpoint requires no authentication, making it easy to integrate with your existing monitoring infrastructure.

Prometheus Configuration

Add SecZim to your Prometheus configuration:

scrape_configs:
  - job_name: 'seczim'
    static_configs:
      - targets: ['your-server:8181']
    scrape_interval: 30s

Available Metrics

Mail Traffic Metrics

These metrics track email flow through your server. Each metric includes a period label with values: 1h, 24h, 7d.

Security Metrics (24h)

Alert Metrics

Active alerts by severity level:

IP Reputation Metrics

Other Metrics

Example Queries

Useful PromQL queries for Grafana dashboards:

Mail Rate (per minute)

rate(seczim_mail_total{period="1h"}[5m]) * 60

Rejection Rate Percentage

seczim_mail_rejected{period="24h"} / seczim_mail_total{period="24h"} * 100

Security Events Total

seczim_geo_blocked_total + seczim_rbl_blocked_total + seczim_spf_failed_total

Alert for High Rejection Rate

seczim_mail_rejected{period="1h"} / seczim_mail_total{period="1h"} > 0.1

Grafana Dashboard

You can create a Grafana dashboard to visualize these metrics. Key panels to include:

Security Note: The metrics endpoint is unauthenticated. If your server is exposed to the internet, consider using a firewall to restrict access to port 8181 to your monitoring infrastructure only.
← Back to Knowledge Base

Emails Being Rejected

If legitimate emails are being rejected, follow these steps:

Step 1: Check the Logs

sudo journalctl -u seczim | grep "sender@domain.com"

Look for the rejection reason.

Step 2: Common Rejection Reasons

Greylisting

New senders are temporarily deferred. This is normal - the email will be delivered on retry.

To bypass: Add sender to whitelist.

RBL Listed

Sender IP is on a spam blacklist.

To bypass: Add IP to whitelist or disable RBL for that IP.

Low IP Reputation

Sender IP has low reputation score.

To fix: Whitelist the IP in Intelligence → IP Reputation.

Quota Exceeded

Sender has exceeded their daily limit.

To fix: Increase quota or wait for reset.

Geo-Blocked

Sender's country is blocked.

To fix: Add country to allowed list or whitelist sender.

Step 3: Whitelist the Sender

If the sender is legitimate:

curl -X POST https://localhost:8880/api/v1/acl/whitelist \
  -H "Content-Type: application/json" \
  -d '{"type": "email", "value": "sender@domain.com"}'
← Back to Knowledge Base

Multiple Mail Servers

One SecZim can protect several mail servers (since 3.4). Install it fully on one host, the central, and point every other MTA at it. Policies, greylisting, quotas, reputation and the dashboard are shared by all of them.

1. On the Central Server

Bind the policy service to an internal address and list the MTAs allowed to query it in /etc/seczim/seczim.yaml:

server:
  host: "10.0.0.5"        # internal IP of this server, not 127.0.0.1
  port: 10035
  allowed_mtas:
    - 10.0.0.11
    - 10.0.0.0/24         # IPs or CIDRs; loopback is always allowed
sudo systemctl restart seczim

Connections from any address not in allowed_mtas are closed before a byte is read and logged with the peer's IP.

2. On Each Additional MTA

One command. Nothing is installed locally: it configures Postfix or Zimbra to consult the central, after verifying the central answers. No license key is needed; licensing lives on the central.

curl -fsSL https://get.seczim.com/install.sh | sudo bash -s -- --agent 10.0.0.5:10035

If the central rejects this host, the command stops before touching the MTA and prints the exact lines to add to the central's allowed_mtas.

Good to Know

⚠️ Security: the policy protocol between Postfix and SecZim has no encryption or authentication of its own. The allowed_mtas list and your private network are the access control. Never expose port 10035 to the internet; between datacenters use a VPN such as WireGuard.
← Back to Knowledge Base

HTTPS & Certificates

Since 3.3 the dashboard and API are served over HTTPS on port 8880. Plain http:// requests to the same port are redirected, so old bookmarks keep working.

The Self-Signed Certificate

On first start SecZim generates a self-signed certificate covering the server's hostname and IP addresses, valid for ten years, at:

/etc/seczim/tls/server.crt
/etc/seczim/tls/server.key

Your browser will warn once because no public authority signed it. Accept the warning and it is remembered. The connection is encrypted either way.

Using Your Own Certificate

Point SecZim at any certificate and key (for example the one your mail server already uses for SMTP), then restart the API:

# /etc/seczim/seczim.yaml
api:
  tls_enabled: true
  tls_cert_file: "/etc/letsencrypt/live/mail.example.com/fullchain.pem"
  tls_key_file: "/etc/letsencrypt/live/mail.example.com/privkey.pem"
sudo systemctl restart seczim-api
If only one of the two files exists SecZim refuses to start rather than silently generating a new pair next to a half-installed certificate. Provide both, or remove the one present.

Checking

curl -k https://localhost:8880/api/v1/health
# {"success":true,"data":{"status":"ok","version":"3.4.0"},...}

curl -I http://localhost:8880/
# HTTP/1.1 301 Moved Permanently  Location: https://localhost:8880/