Files
mailcow-logs-viewer/env.example
2026-01-14 23:02:39 +02:00

183 lines
5.4 KiB
Plaintext

# Mailcow Logs Viewer Configuration
# Copy this file to .env and fill in your values
# ============================================================================
# REQUIRED SETTINGS
# ============================================================================
# Your Mailcow instance URL (without trailing slash)
MAILCOW_URL=https://mail.example.com
# Mailcow API key (generate from System → API in Mailcow admin)
# Required permissions: Read access to logs
MAILCOW_API_KEY=your-api-key-here
# =============================================================================
# DATABASE CONFIGURATION
# =============================================================================
# PostgreSQL credentials
POSTGRES_USER=mailcowlogs
POSTGRES_PASSWORD=changeme
POSTGRES_DB=mailcowlogs
# Database host (use 'db' for docker-compose setup)
POSTGRES_HOST=db
POSTGRES_PORT=5432
# =============================================================================
# MAXMIND (Optional)
# =============================================================================
MAXMIND_ACCOUNT_ID=
MAXMIND_LICENSE_KEY=
# =============================================================================
# FETCH CONFIGURATION
# =============================================================================
# Seconds between log fetches from Mailcow
# Lower = more frequent updates, higher load on Mailcow
# Default: 60 seconds
FETCH_INTERVAL=60
# Number of records to fetch per request
# Recommended: 500 for most servers, increase if you have high email volume
# Default: 500
FETCH_COUNT_POSTFIX=500
FETCH_COUNT_RSPAMD=200
FETCH_COUNT_NETFILTER=500
# Number of days to keep logs in database
# Logs older than this will be automatically deleted
# Recommended: 7 for most cases, 30 for compliance/audit requirements
# Default: 7 days
RETENTION_DAYS=7
CORRELATION_INTERVAL=300
# Correlation expiration (minutes)
MAX_CORRELATION_AGE_MINUTES=10
# Correlation check interval (seconds)
CORRELATION_CHECK_INTERVAL=120
# =============================================================================
# Global SMTP CONFIGURATION (Optional)
# =============================================================================
SMTP_ENABLED=false
SMTP_HOST=
SMTP_PORT=
SMTP_USE_TLS=true
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM=noreply@yourdomain.com
# =============================================================================
# Admin Email
# =============================================================================
ADMIN_EMAIL=admin@yourdomain.com
# =============================================================================
# DMARC CONFIGURATION (Optional)
# =============================================================================
# DMARC reports retention in days
# Default: 60 days
DMARC_RETENTION_DAYS=60
# DMARC Manual Upload
DMARC_MANUAL_UPLOAD_ENABLED=true
# DMARC IMAP Auto-Import Configuration
DMARC_IMAP_ENABLED=false
DMARC_IMAP_HOST=
DMARC_IMAP_PORT=993
DMARC_IMAP_USE_SSL=true
DMARC_IMAP_USER=
DMARC_IMAP_PASSWORD=
DMARC_IMAP_FOLDER=INBOX
DMARC_IMAP_DELETE_AFTER=true
DMARC_IMAP_INTERVAL=3600
DMARC_IMAP_RUN_ON_STARTUP=true
# DMARC Error Email Override (optional - uses ADMIN_EMAIL if not set)
DMARC_ERROR_EMAIL=
# =============================================================================
# BLACKLIST CONFIGURATION (Optional)
# =============================================================================
# Email addresses to exclude from logs (comma-separated, no spaces)
# These emails will NOT be stored in the database
# Use cases:
# - BCC addresses that receive all outbound mail
# - Monitoring/health check addresses
# - Internal system addresses
BLACKLIST_EMAILS=
# Examples:
# BLACKLIST_EMAILS=bcc-archive@example.com,monitor@example.com
# BLACKLIST_EMAILS=notifications@example.com
# =============================================================================
# WEB CONFIGURATION
# =============================================================================
# Application port (internal container port)
APP_PORT=8080
# Timezone for log display (e.g., Europe/London, America/New_York)
TZ=UTC
# Application title (shown in browser tab)
APP_TITLE=Mailcow Logs Viewer
# Logo URL (optional, leave empty for no logo)
APP_LOGO_URL=
# =============================================================================
# ADVANCED CONFIGURATION (Optional)
# =============================================================================
# Log level (DEBUG, INFO, WARNING)
# Default: INFO
LOG_LEVEL=WARNING
# Enable debug mode (shows detailed errors, use only for development)
# WARNING: Never enable in production!
# Default: false
DEBUG=false
# Maximum records to return in search results
MAX_SEARCH_RESULTS=1000
# CSV export row limit
CSV_EXPORT_LIMIT=10000
# Background job workers (number of concurrent fetch jobs)
# Higher = more parallel processing but more CPU usage
SCHEDULER_WORKERS=4
# API request timeout (seconds)
MAILCOW_API_TIMEOUT=30
# =============================================================================
# AUTHENTICATION CONFIGURATION (Optional)
# =============================================================================
# Enable basic HTTP authentication
# When enabled, ALL pages and API endpoints require authentication
# Default: false (no authentication required)
AUTH_ENABLED=false
# Basic auth username
# Default: admin
AUTH_USERNAME=admin
# Basic auth password (REQUIRED if AUTH_ENABLED=true)
# Leave empty to disable authentication
# WARNING: Use a strong password in production!
AUTH_PASSWORD=