Export the Postfix queue as JSON lines
Build a paste-ready command, then review its compatibility and effects before running it.
postqueue -j | head -5read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementspostqueuepostqueue must be installed and available on PATH.
Version supportpostqueue Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals{"queue_name":"deferred","queue_id":"3F2AB1C0042","arrival_time":1784887422,"message_size":1842,"sender":"alerts@example.com","recipients":[{"address":"ops@example.net","delay_reasRepresentative successful output; values vary with the selected target and system state.
Known errorspostqueue: command not foundpostqueue is missing or is not available on PATH.
Verifypostqueue -j | head -5The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01postqueueCommandRuns the postqueue stage of this one-liner.
02-jOptionConfigures postqueue with the -j option.
03|PipelinePasses the output on the left to the command on the right.
04headCommandRuns the head stage of this one-liner.
05-5OptionConfigures head with the -5 option.
Example input
postqueue -j | head -5
Example output
{"queue_name":"deferred","queue_id":"3F2AB1C0042","arrival_time":1784887422,"message_size":1842,"sender":"alerts@example.com","recipients":[{"address":"ops@example.net","delay_reason":"connect timed out"}]}
Illustrative output — exact values vary by system and data.
Official sources