#!/bin/csh -f
#
# Network Installation Kit
#
# install.mail: install MIT sendmail config
#
# Tom Coppeto
# MIT Network Group
# 17 September 1994
#
# Last Modified 3 January 1996 by jyp
#

set pltfrm = `/usr/bin/uname`

source $util/aliases

top:

vclear
vecho "INSTALL"
vecho ""
vecho "                                Mail"
vecho $bar
vecho ""
vecho ""
vecho "New files: "
vecho "               /etc/sendmail.cf"
vecho "Disk consumed:"
vecho "               /usr       53K"
vecho ""

df /usr | vcat

vecho ""
vecho " * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *"
vecho " This package installs a sendmail.cf to make use of the MIT.EDU"
vecho " mail servers. This sendmail.cf may break existing sendmail"
vecho " setups. It is recommended to only install this package if"
vecho " you do not receive mail on this host or you know what you are"
vecho " doing! "
vecho " * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *"
vecho ""

if ($interactive == true) then
	get_response "continue? (yes/no) " "yes" "no"
        if($status == 2) then
		exit -1
	endif
endif

vlog "**   running install.mail:"
vecho ""
vecho "     installing..."

#
# install config
#

vecho "     installing binaries..."
save /etc/sendmail.cf
install -c -m 444 $mail/sendmail.cf /etc/sendmail.cf
vlog "     mail: installed sendmail.cf"

#
# restart sendmail
#

vecho "     re-freezing configs..."

if ($pltfrm == "IRIX") then
	/usr/lib/sendmail -bz
	save /etc/aliases
	cp /dev/null /etc/aliases
	/usr/lib/sendmail -bi
else
	/usr/lib/sendmail -bz
	/usr/lib/sendmail -bi
endif

vlog "     mail: refroze sendmail.cf and built aliases"

if ($pltfrm == "SunOS") then
	kill -1 `ps ax | fgrep sendmail | fgrep -v grep | awk '{print $1}'` >& /dev/null
endif

#
# configure rc.conf
#

vecho "     updating rc and version..."

if ($pltfrm == "SunOS") then
	install.rc
	config.rc MAILCLIENT true
endif

version add MailClient $mailversion
vlog "     mail: updated version"

vecho "done."
vlog "**   done"

if($interactive == true) then
        get_response "Press <return> to continue..." "<return>"
endif

exit 0



