[logo] sendmail administration add-on tools

Download

To obtain my PGP/GnuPG key, see these instructions.

Back to software page.

Introduction

This package provides two scripts that can help administer a mail server that uses the sendmail Mail Transport Agent (MTA). I use these scripts frequently on my own servers; perhaps others will find them useful, too.

mailqs

mailqs reads the output from sendmail's mailq(8) command and summarizes each queue entry, one entry per line. As such, its output is more easily consumed by other scripts. For example, consider this sample output from mailq(8):

# mailq
                /var/spool/mqueue (2 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
m0N1UBG3044481      432 Tue Jan 22 20:30 <bmc@example.org>
                 (Deferred: 451 4.7.1 Greylisting in action, please come back )
                                         <seb@example.edu>
m0N1hTZV044788*     430 Tue Jan 22 20:43 <owner-foo@example.org>
                                         <foobar@yahoo.example.com>
                                         <joe@comcast.example.net>

Running mailqs produces the following output:

# mailqs
m0N1UBG3044481  bmc@example.org        seb@example.edu
m0N1hTZV044788  owner-foo@example.org  foobar@yahoo.example.com, joe@comcast.example.net

The first column of output shows the sendmail queue ID. The second column shows the sender of the message. The remaining columns lists the intended recipients.

mailqs also supports a -s (or --short) option that truncates the output, if necessary, so that it won't exceed 80 columns:

# mailqs -s
m0N1UBG3044481  bmc@example.org        seb@example.edu
m0N1hTZV044788  owner-foo@example.org  foobar@yahoo.example.com, joe@comcas ...

Here's a full list of mailqs options:

--input file
-i file
Read mailq(8) output from the specified file, isntead of piping from the mailq(8) command. Use "-" to read from standard input.
-r sep Use the string sep, instead of ", ", to separate recipient addresses.
--short
-s
Truncate the display so that it doesn't exceed 80 characters per line. (An ellipsis will be used to indicate truncation.)

rmmq

rmmq is a convenience command for removing items from a sendmail queue. When you run mailq(8) or mailqs, you get a list of sendmail queue IDs. These queue IDs map to several files in a sendmail queue directory. This command automatically maps the queue IDs to the files and removes them for you.

Options:

--ask, -i Ask before removing each queue ID's files.
--no-exec, -n Show what would be done, but don't do it.
--verbose, -v Display each file being removed.

Installation

The usual:

  1. Unpack the tarball or Zip file.
  2. Change your directory to the resulting sendmail-admin-1.0 directory.
  3. Run: python setup.py install
As a convenience, if you want to install the package in your home directory (on Unix, Mac OS X, or on Windows via Cygwin), you can run:
sh install-home.sh

Author

Brian M. Clapper, <bmc @ clapper . org>

Copyright

© 2008 Brian M. Clapper

License

BSD-style license. See accompanying LICENSE file.

$Id: index.html,v 1.7 2005/05/20 14:37:58 bmc Exp $