#!/bin/sh --

# Check owner- aliases (in files configured in sendmail.cf) to make
# sure they point to -request instead of directly to the owner.
#
# See http://www.sendmail.org/vendor/sun/migration.html#owner- for details.
#
# Copyright (c) 1997 by Sun Microsystems, Inc.
# All Rights Reserved.

PATH=/bin

config=/etc/mail/sendmail.cf

afl1=`grep "^OA" $config | sed 's/^OA//' | sed 's/,/ /g'`
afl2=`grep "^O AliasFile=" $config | sed 's/^O AliasFile=//' | sed 's/,/ /g'`

sed 's/^[#       ].*$//' $afl1 $afl2 | \
	awk '{
		if (substr($1,1,6) == "owner-") {
			list = substr($1,7,index($1,":") - 7)
			if ($2 == list"-request")
				print list " is OK"
			else
				print "owner-" list " points to " $2 " instead of " list "-request"
		}
	}'

