#!/bin/sh
#-----------------------------------------------------------------------------
#
# Update Notices for Debian Sendmail
#
# Copyright (c) 2001-2002 Richard Nelson.  All Rights Reserved.
# Time-stamp: <2001/08/15 15:00:00 cowboy>
#
# Notes (to all):
#	*
#
# Notes (to self):
#	*
#
#-----------------------------------------------------------------------------
set -e;
notices=0;
version=$1;
export LANG=C;	 # for the comparison of mail version...
exit 0;
#-----------------------------------------------------------------------------
# Notice Item
#-----------------------------------------------------------------------------
Notice_Item () {
	if [ $notices -eq "0" ]; then
		if [ -z $version ]; then
			echo '
*** WELCOME ***.................*** WELCOME ***.................*** WELCOME ***
';
		else
			echo '
*** IMPORTANT ***..............*** IMPORTANT ***..............*** IMPORTANT ***
';
			fi;
		fi;
	notices=`expr $notices + 1`;
	echo '';
	echo "${notices}: .....................................................";
	cat -;
	};

#-----------------------------------------------------------------------------
if [ -z "$version" ]; then
	Notice_Item <<-EOT;
	Sendmail is a powerful MTA, and you may find the sendmail-doc package
	useful in the configuration phase.	You should find even the few files
	in /usr/share/doc/sendmail useful - they note recent Sendmail and Debian
	changes, along with information on the features present in this package.
	EOT
	fi;

#-----------------------------------------------------------------------------
if  test ! -z "$version" && \
    (dpkg --compare-versions "$version" lt "00.00.00-00"); then
	:
    Notice_Item <<-EOT;
	EOT
    fi;

#-----------------------------------------------------------------------------
if  test ! -z "$version" && \
    (dpkg --compare-versions "$version" lt "8.12.10-5"); then
    Notice_Item <<-EOT;

	7 -> 8 bit (QP/Base64) decoding is no longer done by default as it
	doesn't respect character set differences (ie, utf-8).

	If you wish to keep this functionality, you'll need to update your
	sendmail.mc to include the following line:
	MODIFY_MAILER_FLAGS(\`local', \`+9')  # mime7to8
	EOT
    fi;

#-----------------------------------------------------------------------------
if	test ! -z "$version" && \
	(dpkg --compare-versions "$version" lt "8.12.10-5"); then
	Notice_Item <<-EOT;

	---> IMPORTANT NOTICE <---
	If you want to use TLS and/or AUTH, you *MUST* update your
	sendmail.mc and optionally submit.mc for these to work !

	If you do *NOT* update prior to sendmail being restarted, those
	features will simply *STOP* working !!!

	To allow SASL (SMTP AUTH), you must add this line to /etc/mail/sendmail.mc:
		include(\`/etc/mail/sasl/sasl.m4')dnl

	For TLS (STARTTLS), you need this:
		include(\`/etc/mail/tls/starttls.m4')dnl
	EOT
	fi;

#-----------------------------------------------------------------------------
if	test ! -z "$version" && \
	(dpkg --compare-versions "$version" lt "8.12.6-5"); then
	Notice_Item <<-EOT;

	The group smmsp may have been created within the user, not
	system range.  To correct this issue, the group will be deleted
	and recreated.

	For this to work, you will need to let sendmailconfig run, or
	manually run /usr/share/sendmail/update_sendmail immediately
	after saying 'no' to the sendmailconfig questions.
	EOT
	fi;

#-----------------------------------------------------------------------------
if	test ! -z "$version" && \
	(dpkg --compare-versions "$version" lt "8.12.2-1"); then
	Notice_Item <<-EOT;
	smrsh functionality has moved from /usr/lib/sm.bin to /etc/mail/smrsh.

	Sendmail will populate the directory with some of the more common MDAs
	(procmail,maildrop,deliver,etc.) that are installed, but doesn't know
	about listserver type programs (majordomo, mailman, etc.)  So you'll
	need to place links to those binaries in /etc/mail/smrsh.

	Also, if you add a new MDA, you'll need to rerun sendmailconfig to
	make sure the MDA is available for smrsh processing!
	EOT
	Notice_Item <<-EOT;
	Sendmail has changed to use the standard uid/gid smmsp for the MSP.
	If you've not changed queue directories, you'll be all set.

	However, if you've moved queue directories, you'll need to make sure
	that all of them are 0750 root:smmsp
	EOT
	fi;

#-----------------------------------------------------------------------------
if	test ! -z "$version" && \
	(dpkg --compare-versions "$version" lt "8.12.0-1"); then
	Notice_Item <<-EOT;
	The automatic virtual-host changes have been removed because
	they caused problems for some people...

	If you need to do ip based virtual hosting, add HACK(\`virthost_by_ip')dnl
	to your sendmail.mc and read /usr/share/doc/sendmail/op/op.{ps,txt}.gz
	for the 'b' modifier to DAEMON_OPTIONS.
	EOT
	Notice_Item <<-EOT;
	If you'd like to support MSP->MTA and/or MTA->MTA authentication, you
	can get a good start by using HACK(\`debian_auth')dnl.
	EOT
	Notice_Item <<-EOT;
	The commands 'mailq' and 'hoststat' are now useable by normal users.
	EOT
	Notice_Item <<-EOT;
	Sendmail now defaults to being uid=mail (instead of daemon) when
	calling the MDA to deliver mail.  This means that if you have files
	that are written to by the MDA, they need to be writable by uid=mail!
	EOT
	fi;

#-----------------------------------------------------------------------------
if	test ! -z "$version" && \
	(dpkg --compare-versions "$version" lt "8.11.6+8.12.0.Beta19-1"); then
	Notice_Item <<-EOT;
	You can now control the collection of host statistics via settings in
	/etc/mail/sendmail.conf, please edit the file to your needs.
	EOT
	fi;

#-----------------------------------------------------------------------------
if	test ! -z "$version" && \
	(dpkg --compare-versions "$version" lt "8.11.5+8.12.0.Beta17-1"); then
	Notice_Item <<-EOT;
	You can now control the collection of mailer statistics via settings in
	/etc/mail/sendmail.conf, please edit the file to your needs.
	EOT
	fi;

#-----------------------------------------------------------------------------
if	test ! -z "$version" && \
	(dpkg --compare-versions "$version" lt "8.11.3+8.12.0.Beta7-4"); then
	Notice_Item <<-EOT;
	Sendmail has extended control over queue management, and these changes
	can cause a performance drop if you don't change your local
	configuration.

	Old:
	  MaxDaemonChildren controlled number of listener *and* queue runners

	  Sendmail would fork as many children as needed to run the queues

	New:
	  MaxDaemonChildren still works as a total limit
	  MaxQueueChildren limits *only* the number of total queue runners
	  MaxRunnersPerQueue limits the number of runners per individual
		  queue (in 8.11+, you can have multiple queues) -- *AND* you
		  can override this global limit on per queue basis!
	  MaxQueueRunSize limits the number of messages processed per queue run

	  Sendmail only forks upto MaxRunnersPerQueue for each queue per run

	The gotcha here is that MaxRunnersPerQueue defaults to one !

	I've changed the default MaxRunnersPerQueue to 5, so deliveries aren't
	single threaded, but you may want to have more or less than 5.
	EOT
	fi;

#-----------------------------------------------------------------------------
if [ "$notices" -ne "0" ]; then
	echo '';
	echo -n 'Press [ENTER] to continue';
	read yn;
	fi;
#-----------------------------------------------------------------------------

