#!/bin/sh

##
# Get top failures with recipient, sorted by message count.
##

DIR="$( cd "$( dirname "$0" )" && pwd )"
RECIPIENTS_TYPE="${DIR}/../lib/recipients-type.sh"
COLUMNT=/usr/local/qmailanalog/bin/columnt

( echo date time dest recipient reason
$RECIPIENTS_TYPE failure \
   | sort -k1,2 ) \
   | $COLUMNT \
   | less -F
