Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?
Advertisement: The OpenBSD PF Packet Filter Book: PF for NetBSD, FreeBSD, DragonFly and OpenBSD

BSD Links
·New Links
·User Groups

This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at

View the Sendmail or Postfix mail queue


Be able to view the mail queue to determine if any mail is stuck in the queue, and if necessary, ask the MTA to reprocess or flush the queue.


As noted in section Determine which MTA is being used on the system, the BSD systems use Sendmail or Postfix by default for handling mail.

The mail queue can be displayed using the mailq(1) utility. The queue listing identifies messages that are still queued (not successfully sent or delivered yet). The output includes MTA's internal message identifier, the size of the message, the date and time the message was accepted into the queue, the sender's envelope address, and the recipient address(es), as well as a reason of failure for messages that have permanently failed.

When using Postfix, if the mailq(1) utility is not setup, use postqueue -p to display the traditional sendmail-style queue listing. To make MTA attempt to deliver all queued mail issue commands: sendmail -q for Sendmail and postqueue -f for Posftix.


Following are two examples of mailq(1) output. First when used with Sendmail:

# mailq
/var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
l0ID36a2085983      524 Thu Jan 18 14:03 <>
                (Deferred: Operation timed out with
               Total requests: 1

And an example when used with Postfix:

# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
D184ACAB55      709 Fri Jan 19 20:50:08
(delivery temporarily suspended: connect to[]: Connection refused)

-- 709 bytes in 1 Request.

Practice Exercises

  1. When logged into your mail server, see the output of postqueue(1) and/or mailq(1) commands (depending on which MTA is used).

More information

mailq(1), postqueue(1)

Front | Information | Lists | Newsfeeds