MailLinter

Email Testing Tool

HomeDocumentationQuick Start
DocumentationAdvanced Configuration

Advanced Configuration

Master MailLinter's advanced features including API integration, production deployment strategies, custom configurations, and enterprise-grade monitoring solutions.

REST API Reference

MailLinter provides a comprehensive REST API for programmatic access to emails, analytics, and system management. Perfect for automation and integration.

GET/api/emails

Retrieve all received emails with pagination

Request Example

curl http://localhost:3000/api/emails \
  -H "Accept: application/json"

Response Example

{
  "emails": [
    {
      "id": "uuid-123",
      "from": "sender@example.com",
      "to": ["recipient@example.com"],
      "subject": "Test Email",
      "timestamp": "2024-01-15T10:30:00Z",
      "spamScore": 1.2,
      "status": "clean"
    }
  ],
  "pagination": {
    "page": 1,
    "total": 42,
    "hasMore": true
  }
}

Production Deployment

Deploy MailLinter in production environments with enterprise-grade reliability, scalability, and monitoring. Choose the strategy that best fits your infrastructure.

Docker Production

Deploy using Docker with production optimizations

Beginner

Deployment Steps

  1. 1.Pull official Docker image
  2. 2.Configure environment variables
  3. 3.Set up reverse proxy (optional)
  4. 4.Configure SSL certificates
  5. 5.Start with docker-compose

Configuration Example

# Production docker-compose.yml
version: '3.8'
services:
  maillinter:
    image: maillinter/maillinter:latest
    ports:
      - "3000:3000"
      - "2525:2525"
    environment:
      - NODE_ENV=production
      - SMTP_PORT=2525
      - WEB_PORT=3000
      - MAX_EMAILS=1000
    volumes:
      - ./data:/app/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3

Environment Variables

Customize MailLinter's behavior with these environment variables. All settings can be configured via environment variables or configuration files.

SMTP Configuration

SMTP_PORTDefault: 2525

Port for SMTP server to listen on

SMTP_PORT=2525
SMTP_HOSTDefault: 0.0.0.0

Host interface for SMTP server binding

SMTP_HOST=127.0.0.1
SMTP_AUTHDefault: false

Enable SMTP authentication (for production)

SMTP_AUTH=true

Web Interface

WEB_PORTDefault: 3000

Port for web interface server

WEB_PORT=8080
WEB_HOSTDefault: 0.0.0.0

Host interface for web server binding

WEB_HOST=127.0.0.1
BASE_URLDefault: http://localhost:3000

Base URL for generating links and webhooks

BASE_URL=https://mail.example.com

Storage & Limits

MAX_EMAILSDefault: 100

Maximum number of emails to store

MAX_EMAILS=1000
DATA_DIRDefault: ./data

Directory for storing email data

DATA_DIR=/var/lib/maillinter
AUTO_CLEANUPDefault: true

Automatically clean old emails when limit reached

AUTO_CLEANUP=false

SpamAssassin

SPAMASSASSIN_ENABLEDDefault: true

Enable SpamAssassin analysis

SPAMASSASSIN_ENABLED=false
SPAMASSASSIN_HOSTDefault: localhost

SpamAssassin daemon host

SPAMASSASSIN_HOST=spamd.example.com
SPAMASSASSIN_PORTDefault: 783

SpamAssassin daemon port

SPAMASSASSIN_PORT=11783

Advanced Integrations

Integrate MailLinter with your existing infrastructure using webhooks, monitoring systems, and automation tools.

Webhook Notifications

Get real-time notifications when emails arrive

# Configure webhook endpoint
WEBHOOK_URL=https://your-app.com/webhooks/email

# Webhook payload example
{
  "event": "email.received",
  "timestamp": "2024-01-15T10:30:00Z",
  "email": {
    "id": "uuid-123",
    "from": "sender@example.com",
    "subject": "Test Email",
    "spamScore": 1.2
  }
}

Health Monitoring

Monitor MailLinter health and performance

# Health check endpoint
GET /health

Response:
{
  "status": "healthy",
  "uptime": 86400,
  "emailsReceived": 42,
  "spamAnalysisEnabled": true,
  "diskUsage": "85MB",
  "version": "1.0.0"
}

Metrics Collection

Export metrics for monitoring systems

# Prometheus metrics endpoint
GET /metrics

# Sample metrics
maillinter_emails_total 42
maillinter_spam_score_avg 2.1
maillinter_processing_time_seconds 0.023
maillinter_storage_usage_bytes 89128960

Security & Performance

Security Best Practices

  • Never expose MailLinter directly to the internet
  • Use reverse proxy (nginx, Apache) for SSL termination
  • Implement authentication for production deployments
  • Regular backup of email data and configurations

Performance Optimization

  • Configure AUTO_CLEANUP for large volumes
  • Use SSD storage for better I/O performance
  • Scale horizontally with load balancer
  • Monitor resource usage and email throughput

Expert Tips for Production

Monitoring Strategy

  • • Set up alerts for high spam scores
  • • Monitor disk usage and email volume
  • • Track API response times and errors

Scaling Considerations

  • • Use dedicated SpamAssassin instances
  • • Implement email archiving strategies
  • • Consider database backends for large volumes