Skip to content

Dovecot

Auto-Detection
Health Check
Exporter Metrics

Bleemeo monitors the Dovecot IMAP/POP3 mail server through automatic service detection, IMAP health checks, and optional detailed metrics collection via a Prometheus exporter.

Glouton automatically detects Dovecot instances running on the host. If the auto-detected parameters are incorrect, you can override them manually by adding the following to /etc/glouton/conf.d/99-dovecot.conf:

service:
# For a Dovecot running outside a container
- type: "dovecot"
address: "127.0.0.1"
port: 143 # IMAP listener; IMAPS is not supported here
# For an additional Dovecot running outside a container
- type: "dovecot"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
address: "127.0.0.1"
port: 144 # IMAP listener; IMAPS is not supported here
# For a Dovecot running in a Docker container
- type: "dovecot"
instance: "CONTAINER_NAME"
address: "172.17.0.2"
port: 143 # IMAP listener; IMAPS is not supported here

Glouton performs an IMAP health check when the service listens on port 143.

Metric Description
service_status Status of Dovecot

Detailed Dovecot metrics are collected using the third-party dovecot_exporter.

  • Dovecot IMAP/POP3 server installed and running
  • Glouton agent installed on the same host
  • Dovecot stats socket accessible (usually at /var/run/dovecot/stats)

Ensure the Dovecot stats socket is available. On most installations it is enabled by default at /var/run/dovecot/stats. Verify with:

Terminal window
ls -la /var/run/dovecot/stats

If the socket does not exist, enable the stats service in your Dovecot configuration (/etc/dovecot/conf.d/10-master.conf).

Download the latest release from the dovecot_exporter releases page, or install with Go:

Terminal window
go install github.com/kumina/dovecot_exporter@latest

Start the exporter:

Terminal window
dovecot_exporter --dovecot.socket-path=/var/run/dovecot/stats

The exporter listens on port 9166 by default. Verify it is working:

Terminal window
curl http://localhost:9166/metrics

For production use, create a systemd service unit to manage the exporter process.

Terminal window
sudo tee /etc/glouton/conf.d/99-dovecot.conf > /dev/null << 'EOF'
metric:
prometheus:
targets:
- url: "http://localhost:9166/metrics"
name: "dovecot"
allow_metrics:
- "dovecot_up"
- "dovecot_auth_successes"
- "dovecot_auth_failures"
- "dovecot_mail_read_bytes"
- "dovecot_imap_connections"
EOF
Metric Description
dovecot_up Whether the Dovecot stats socket is reachable (1 = up)
dovecot_auth_successes Total number of successful authentication attempts
dovecot_auth_failures Total number of failed authentication attempts
dovecot_mail_read_bytes Total number of bytes read from mailboxes
dovecot_imap_connections Current number of active IMAP connections