banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Services

banshee/services-collection/services/postfix/ssh/

queue

The messages queued by a Postfix server, by queue, and the age of the oldest deferred message, by SSH and postqueue -j.

  • services
  • postfix
  • mail
  • smtp
  • queue
  • deferred
  • postqueue
  • ssh

by banshee1 installation1 version

v1Latest

Published on October 27, 2026. First version.

Postfix queue, by SSH

Returns the mail queue of a Postfix server: the messages queued, by queue (deferred, being delivered, held, arriving), and the age of the oldest deferred message, read by postqueue -j over SSH. Four watches are offered, each one set on the probe.

Versions

Postfix 3.1 and later (postqueue -j): Debian 9, Ubuntu 18.04, RHEL 8 and later. Generic: no folder of version. An older Postfix knows no -j: the collector stops misconfigured.

How it works

The collector runs postqueue -j, which writes one JSON object per message, one per line:

{"queue_name": "deferred", "queue_id": "4BPm4N2tVLz1x", "arrival_time": 1793062803, "message_size": 2048, "sender": "app@www.example", "recipients": [{"address": "user@mail.example", "delay_reason": "connect to mail.example[192.0.2.25]:25: Connection timed out"}]}
  • queued counts every message; deferred, active, hold count those of each queue; incoming counts those of incoming and maildrop, the mail arriving and not yet taken up.
  • oldest-deferred is the time since the arrival of the oldest deferred message, in hours, against the poller's clock; 0 when none is deferred. Postfix gives up on a message after maximal_queue_lifetime (5 days by default) and bounces it: a message deferred for hours is mail that does not leave.
  • A Postfix that is stopped (postqueue says "mail system is down") is critical: "Postfix is not running". Any other failure of postqueue stops the collector misconfigured, with what it said.
  • Nothing is written: postqueue -j only lists the queue. The senders and recipients are read, never returned.

Prerequisites

  • An SSH account for monitoring, without write rights, on the Postfix server.
  • postqueue in its path (/usr/sbin/postqueue), and the account allowed to list the queue: authorized_mailq_users is static:anyone by default; where it was narrowed, add the account to it (postconf -e 'authorized_mailq_users = monitoring', with the others it names).
  • No sudo.
  • The fingerprint of the server's host key, set in protocol:ssh:fingerprint (not needed when the Security settings trust the first SSH fingerprint presented).

Outputs

NameLabelUnitPer instance
queuedMessages queued—no
deferredMessages deferred—no
activeMessages being delivered—no
holdMessages held—no
incomingMessages arriving—no
oldest-deferredOldest deferred messagehno

Watches

NameTitleKindDefaultsChecked by default
queuedQueue too longabove a threshold, on queuedwarning above 500, critical above 2000yes
deferredMany messages deferredabove a threshold, on deferredwarning above 50, critical above 200, for 3 runsyes
oldest-deferredDeferred message too oldabove a threshold, on oldest-deferredwarning above 4 h, critical above 24 hyes
holdMessages heldabove a threshold, on holdwarning above 0no

Limits

  • The whole queue is listed at each run: a queue of tens of thousands of messages makes an answer of several megabytes, which the poller may refuse as too large; the probe then stops, which says the queue is huge.
  • One Postfix instance per probe, the default one; the other instances of postmulti are not read.
  • Not checked against a Postfix: the format is the one the manual page postqueue(1) gives for -j.