mailq-summary

NAME

mailq-summary - Filter producing summary of sendmail's mailq output

SYNOPSIS

mailq -v | mailq-summary [ options ]

mailq-summary --help

mailq-summary --man


DESCRIPTION

This program processes the output of sendmail's mailq tool to produce a summary of the queued emails. The summary has three header lines and then continuous rows of data.

The verbose option to mailq is needed to avoid the truncation of the sender and recipient email addresses.


OPTIONS

--help

Print this brief help message and exit.

--man

Display the manual page and exit.

--match=domain|all

Select how much to match when doing the summarisation, either just the domain or the entire email address. When matching the domain, consider the --ndots option. The default is "domain".

--field=to|from

Select whether to match means the recipients' addresses ("to") or the senders' addresses ("from"). The default is "to".

--sort=age|domain|number|size

Select the sort order for the report. The sort is ascending and the default is "age".

age

Chronologically by the oldest email queued

domain

Alphabetically using the most significant parts of the domain, for example: example.com, a.example.com, z.example.com, example.org, a.example.org and then example.net.

number

Numerically by number of emails queued

size

Numerically by the total bytes of of emails queued

--ndots=<number>

When summarising by domains, take this many "parts" of the domain, starting from the most significant, for example, a setting of 1 may produce "au, com, net, org, uk." The default is 0, that is, unlimited.

--noprocessing

Emails that are currently being processed are indicated by an asterisk after the queue id, for example, "g1B4eZqd005652*" By default, these emails are included in the report.

This option allows you to exclude these emails, possibly giving a more accurate indication of domains that are failing.

--nohuman

By default, the report is presented in a Human Readable manner, that is, using weeks, days, hours and minutes for time and prefixes for sizes (see the --base option).

This option allows you to access the raw data for additional processing, that is, seconds and bytes.

--base=binary|si

Select the base for the prefixes used in Human Readable output. The default is "si".

binary

The "traditional" base 2 prefixes: "K" is 2**10 and "M" is 2**20, 1024 and 1048576 respectively.

si

The International System of Units (SI) base 10 prefixes: "K" is 10**3 and "M" is 10**6, 1000 and 1000000 respectively.

There is real confusion and the potential for incompatibility in standards and in implemented systems surrounding the use of prefixes. See the following site for more information.

http://physics.nist.gov/cuu/Units/binary.html


SUGGESTED USAGE

I recommend using the tee(1) utility to allow you to make several invocations of this script with different options, for example,

    $ mailq -v | tee mailq-v.txt | mailq-summary
    $ mailq-summary --sort=domain < mailq-v.txt
    $ mailq-summary --sort=number < mailq-v.txt


EXIT STATUS

This script will exit with zero upon successfull completion, non-zero on any error. All debugging or diagnostic output is written to STDERR. Please do not ignore STDERR.


AUTHOR

Mark Suter <mark.suter@miju.com.au>


COPYRIGHT

Copyright (c) 2002,2003,2004 Mark Suter <mark.suter@miju.com.au>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA or from the following webpage.

    http://www.gnu.org/licenses/gpl.txt
-->