HEX
Server: Apache/2.4.54 (Debian)
System: Linux a5825d2beacc 4.15.0-197-generic #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 x86_64
User: root (0)
PHP: 8.1.14
Disabled: NONE
Upload Files
File: /var/lib/dpkg/info/sendmail-base.prerm
#!/bin/sh
set -e;

PACKAGE=sendmail-base;

if [ "$1" = "remove" ]; then
		if [ -x /usr/sbin/update-inetd ]; then
			update-inetd --disable smtp,smtps,submission
			fi;

		# Make sure /etc/aliases is left (move it from /etc/mail if needed)
		if [ -L /etc/mail/aliases ]; then
			rm -f /etc/mail/aliases;
		elif [ -f /etc/mail/aliases ] \
		&&   [ -L /etc/aliases ]; then
			mv /etc/mail/aliases /etc/aliases;
			fi;

		# Remove pseudo conffiles (managed by sendmail)
		rm -f	/etc/cron.d/sendmail;

		# Remove files scattered across the system that
		# happened to be created by sendmail
		rm -f /usr/lib/sasl/Sendmail.conf

		# Remove those files created by sendmail
		rm -rf	/var/lib/sendmail;
		rm -rf	/var/run/sendmail;
		# Note: syslog really owns these files
		#rm -f	/var/log/mail/*;
		#rm -f	/var/log/mail.log;
		# Note: these can lead to a loss of mail!!!!
		if [ -x /etc/init.d/sendmail ]; then
			/etc/init.d/sendmail clean;
			fi;
		if [ -L /var/spool/mqueue ]; then
			rmdir --ignore-fail-on-non-empty \
			`readlink -fn /var/spool/mqueue`;
		elif [ -d /var/spool/mqueue ]; then
			rmdir	--ignore-fail-on-non-empty \
				/var/spool/mqueue;
			fi;
		if [ -L /var/spool/mqueue-client ]; then
			rmdir	--ignore-fail-on-non-empty \
			`readlink -fn /var/spool/mqueue-client`;
		elif [ -d /var/spool/mqueue-client ]; then
			rmdir	--ignore-fail-on-non-empty \
				/var/spool/mqueue-client;
			fi;

		# Remove sendmail built configuration files
		rm -f	/etc/mail/*.db \
			/etc/mail/*.dir \
			/etc/mail/*.pag;
		rm -f	/etc/mail/sendmail.cf \
			/etc/mail/sendmail.cf.old \
			/etc/mail/sendmail.cf.errors \
			/etc/mail/sendmail.mc.old \
			/etc/mail/submit.cf \
			/etc/mail/submit.cf.errors \
			/etc/mail/submit.mc.old \
			/etc/mail/databases \
			/etc/mail/Makefile \
			;
		rm -rf /etc/mail/smrsh \
			/etc/mail/sasl \
			/etc/mail/tls;

		# Remove empty files (probably touched databases)
		find /etc/mail -maxdepth 1 -type f -size 0 -delete
fi

if [ "$1" = "upgrade" ]; then
		# Potentially move the old configuration file to the new name -
		# before it gets deleted (for not existing in the new package)
		mv -f /etc/default/sendmail \
			/etc/mail/sendmail.conf 2>/dev/null || true;

		# Prevent cronjob from running during upgrade...
		if [ -f /etc/cron.d/sendmail ]; then
			echo "#prerm" > /etc/cron.d/sendmail;
			fi;
fi

# Automatically added by dh_installdeb/13.3.4
dpkg-maintscript-helper rm_conffile /etc/dhcp3/dhclient-exit-hooks.d/sendmail 8.14.4-2.2\~ -- "$@"
# End automatically added section