SMTP Email

Browse, analyze logs in Elasticsearch for Postfix mail relay and OpenDKIM

SMTP Email screenshot 1
SMTP Email screenshot 2

Postfix SMTP Email + OpenDKIM Dashboard

Dashboard to visualize data from Postfix and OpenDKIM

Features

  • Supports Postfix log messages
  • Supports OpenDKIM log messages
  • Mail flow diagram of counts and average timings
  • Postfix aggregate log report
  • SASL Authentication errors
  • Includes documention:
    • Email relay troubleshooting guide
    • Dashboard usage guide
    • ESMTP response code reference guide
    • Mail process flow guide

Bugs, suggestions and feedback.

Bug reports, suggestions and feedback to GitHub please!

Logstash config

Filters and grok files are provided on GitHub.

Prometheus config

Required for the graph displaying results from the port 25/587 probes. Requires Prometheus blackbox_exporter.

  - job_name: 'smtp_status_tls'
    metrics_path: /probe
    params:
      module: [smtp_starttls]
    static_configs:
      - targets: [
		'your.mail.server.com'		
	        ]
    relabel_configs:
      # Ensure port is 25, pass as URL parameter
      - source_labels: [__address__]
        regex: (.*)(:.*)?
        replacement: ${1}:587
        target_label: __param_target
      # Make instance label the target
      - source_labels: [__param_target]
        target_label: instance
      # Actually talk to the blackbox exporter though
      - target_label: __address__
        replacement: 127.0.0.1:9115
  • job_name: 'smtp_status' metrics_path: /probe params: module: [smtp_banner] static_configs:
    • targets: [ 'your.mail.server.com' ] relabel_configs:

    Ensure port is 25, pass as URL parameter

    • source_labels: [address] regex: (.)(:.)? replacement: ${1}:25 target_label: __param_target

    Make instance label the target

    • source_labels: [__param_target] target_label: instance

    Actually talk to the blackbox exporter though

    • target_label: address replacement: 127.0.0.1:9115

Blackbox_exporter blackbox.yml config

  smtp_starttls:
    prober: tcp
    timeout: 20s
    tcp:
      preferred_ip_protocol: ip4
      tls_config:
        insecure_skip_verify: true
      query_response:
        - expect: "^220 ([^ ]+) ESMTP (.+)$"
        - send: "EHLO prober\r"
        - expect: "^250-(.*)"
        - send: "STARTTLS\r"
        - expect: "^220"
        - starttls: true
        - send: "EHLO prober\r"
        - expect: "^250-"
        - send: "QUIT\r"
  smtp_banner:
    prober: tcp
    timeout: 20s
    tcp:
      preferred_ip_protocol: ip4
      query_response:
        - expect: "^220 ([^ ]+) ESMTP (.+)$"
        - send: "EHLO prober\r"
        - expect: "^250-(.*)"
        - send: "MAIL FROM:ping@your.mail.server.com\r"
        - expect: "^250-(.*)"
        - send: "RCPT TO:test.email@your.mail.domain.com\r"
        - expect: "^250-(.*)"
        - send: "QUIT\r"

Screenshots

Revisions
RevisionDescriptionCreated

Get this dashboard

Import the dashboard template

or

Download JSON

Datasource
Dependencies