mailq
Show emails queued for delivery
SYNOPSIS
mailq [-v]
PARAMETERS
-v
Verbose mode. Provides more detailed information about each message in the queue.
DESCRIPTION
The `mailq` command is a vital tool for system administrators managing Postfix mail servers. It displays the contents of the Postfix mail queue, providing insights into pending email messages. This includes information such as the message ID, sender, recipient, size, and arrival time. Analyzing the output of `mailq` helps in identifying potential problems with mail delivery, such as deferred messages due to network issues, incorrect recipient addresses, or spam filtering configurations. It allows administrators to diagnose and troubleshoot mail flow problems, ensuring timely and reliable email delivery.
The queue provides crucial insight into mail server health. It allows for determining the source of blocked emails and if the mail server has become an Open Relay.
CAVEATS
The interpretation of the output requires some understanding of Postfix architecture and configuration. The exact format of the output may vary slightly depending on the Postfix version and configuration.
OUTPUT INTERPRETATION
The output of `mailq` typically includes columns for message ID, size, arrival time, sender, recipient, and any error messages. Understanding these fields is essential for diagnosing mail delivery issues. Look for messages stuck in the queue for extended periods or those with specific error messages that indicate delivery failures. Often problems are DNS resolution issues, too many connections from the same IP or recipient rejection due to mail filter rules.
ALTERNATIVES
While `mailq` is the standard command, some system administrators prefer to directly query the Postfix queue files (located in `/var/spool/postfix/`) for more customized reporting or analysis. However, manipulating the queue files directly should be done with extreme caution, as it can potentially corrupt the mail queue.
HISTORY
The `mailq` command is part of the Postfix mail transfer agent (MTA) suite. Postfix was created as an alternative to Sendmail, aiming for greater security, reliability, and ease of configuration. `mailq` has been a standard utility within Postfix since its inception, providing administrators with a simple and effective way to monitor the mail queue.