Skip to content
BleemeoBleemeo

Postfix

Auto-Detection
Health Check
Built-in Metrics

Bleemeo monitors the Postfix mail transfer agent through automatic service detection, SMTP service checks, and mail queue metrics.

Glouton automatically detects Postfix instances listening on port 25. If the auto-detected parameters are incorrect, you can override them manually.

Terminal window
sudo tee /etc/glouton/conf.d/99-postfix.conf > /dev/null << 'EOF'
service:
# For a Postfix running outside a container
- type: "postfix"
address: "127.0.0.1"
port: 25
# For an additional Postfix running outside a container
- type: "postfix"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
address: "127.0.0.1"
port: 26
# For a Postfix running in a Docker container
- type: "postfix"
instance: "CONTAINER_NAME"
address: "172.17.0.2"
port: 25
EOF

Glouton performs an SMTP service check when the service listens on port 25.

MetricDescription
service_statusStatus of Postfix
MetricDescription
postfix_queue_sizeNumber of mails queued

See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.

The check is a real SMTP exchange, not a bare connection:

Status text Cause Fix
Unable to connect to SMTP server: connection refused Postfix listens on another port, or inet_interfaces excludes the address Glouton uses Set address and port, or widen inet_interfaces
SMTP error: ... Postfix answered, but rejected the exchange — a smtpd_client_restrictions rule, or a milter refusing the agent Allow the agent address, or point the check at a listener that accepts it
Connection timed out after 10 seconds A firewall drops the packets Open the port for the agent

The queue size is not read over SMTP: Glouton runs postqueue -p once a minute and parses its output. For a containerized Postfix it runs the command inside that container; otherwise it runs it on the host — including when the agent itself is containerized, since it enters the host filesystem to do so.

Run the same command the agent runs, as the same user:

Terminal window
sudo -u glouton postqueue -p

It must print the queue, or Mail queue is empty. The error Glouton gets is logged at the VERBOSE level only, as gather postfix queue size, so raise logging.level before looking for it in the agent logs.

What you see Cause Fix
postqueue: command not found The Postfix client tools are absent where the command runs Install them there — on the host for a package installation
a permission error postqueue refuses to run for the glouton user Check that postqueue keeps its set-gid bit on the mail queue
an unknown hostroot error in the logs The agent runs in a container started without the host filesystem Add -v /:/hostroot:ro to the agent container, as in the Docker installation