• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / Show the sendmail mail queue

Show the sendmail mail queue

To check what is currently sitting in the sendmail mail queue use the sendmail -bp command or its alias mailq. This post looks at basic usage of this command and the output from viewing the mail queue.

To list the mail queue in sendmail do this:

sendmail -bp

or this:

mailq

Depending on the settings on your server you will probably need to run the above commands either as root or using the sudo command. You may also need to type the full path to sendmail which for example is /usr/sbin/sendmail on a CentOS or Red Hat Enterprise Linux setup.

This will give you example output like this:

                /var/spool/mqueue (3 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
m9TMLQHG012749     1103 Thu Oct 30 11:21 <apache@localhost.localdomain>
                 (host map: lookup (electrictoolbox.com): deferred)
                                         <test@electrictoolbox.com>
m9TMLRB9012751    37113 Thu Oct 30 11:21 <apache@localhost.localdomain>
                 (host map: lookup (electrictoolbox.com): deferred)
                                         <test@electrictoolbox.com>
m9TMLPcg012747   240451 Thu Oct 30 11:21 <apache@localhost.localdomain>
                 (host map: lookup (electrictoolbox.com): deferred)
                                         <test@electrictoolbox.com>
                Total requests: 3

The above example shows that there are currently 3 messages in the mail queue and that they have all been deferred, meaning delivery will be attempted again at a later time.

If the queue was empty you would simply get this:

/var/spool/mqueue is empty
                Total requests: 0

Check Out These Related posts:

  1. Sendmail remote connection refused
  2. Starting and Stopping Sendmail with FreeBSD
  3. Changing exim4 settings with Debian 5 Lenny
  4. Flush the exim mail queue

Filed Under: Email Servers

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap