summaryrefslogtreecommitdiffstats
path: root/etc/periodic/daily/460.status-mail-rejects
blob: 696e4edba0728dd02a62fcb60a1a1b986bfa8f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# $Id: 460.status-mail-rejects,v 1.4 1998/01/26 02:26:29 brian Exp $
#

if [ -d /etc/mail -a -f /var/log/maillog ]; then
  echo
  echo Checking for rejected mail hosts:

  start=`date -v-1d '+%b %d' | sed 's/0\(.\)$/ \1/'`
  zcat -fc /var/log/maillog.0* /var/log/maillog | grep reject= |
	perl -ne "print \"\$1\n\" 
	    if (/^$start.*ruleset=check_mail, arg1=<.*@([^>]*)>.*reject=/o || 
                /^$start.*ruleset=check_relay, arg1=([^, ]*), .*reject=/o)" | 
	sort -u
fi
OpenPOWER on IntegriCloud