Sophie

Sophie

distrib > Mandriva > cs4.0 > x86_64 > by-pkgid > fd83d962cf04a95c6b8c49327beb78f6 > scriptlet

postfix-2.2.11-1mlcs4.x86_64.rpm

PREIN

/bin/sh
/usr/share/rpm-helper/add-user postfix $1 postfix /var/spool/postfix /bin/false 
/usr/share/rpm-helper/add-group postfix $1 postdrop postfix 
if [ -e /var/lib/rpm/alternatives/mta ]; then
	/usr/sbin/update-alternatives --remove mta /usr/sbin/sendmail.postfix
	echo
	echo "============================================================================"
	echo "WARNING"
	echo
	echo "The old \"mta-*\" alternatives have been removed."
	echo "After this upgrade, postfix may be partially broken due to an incorrect"
	echo "triggerpostun in previous packages. If there is no /usr/bin/mailq,"
	echo "for example, then this is the case and you should keep reading."
	echo
	echo "To partially fix the problem, please restart the service after this"
	echo "upgrade is finished (even if it was already restarted during the upgrade)."
	echo
	echo "The init script will correct most of the broken symbolic links, but the"
	echo "following manpages will not be accessible: mailq(1), newaliases(1) and"
	echo "aliases(5)."
	echo
	echo "A reinstallation of the postfix package (or any further upgrade) will fix"
	echo "all issues."
	echo
	echo "See the http://archives.mandrivalinux.com/cooker/2005-07/msg01012.php thread"
	echo "for a more detailed explanation."
	echo "============================================================================"
	echo
fi

PREUN

/bin/sh
rmqueue() {
	[ $2 -gt 0 ] || return
	local i
	for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do
		if [ -d $1/$i ]; then
			rmqueue $1/$i $(( $2 - 1 ))
			rm -f $1/$i/*
			rmdir $1/$i
		fi
	done
}

# selectively remove the queue directory structure
queue_directory_remove () {
# first remove the "queues"
local IFS=', '
for dir in `/usr/sbin/postconf -h hash_queue_names`; do
	test -d $dir && rmqueue /var/spool/postfix/$dir `/usr/sbin/postconf -h hash_queue_depth`
done

# now remove the other directories
for dir in corrupt maildrop pid private public trace; do
	test -d $dir && /bin/rm -f $dir/*
done
}

/usr/share/rpm-helper/del-service postfix $1 postfix 

if [ $1 = 0 ]; then
	/usr/sbin/update-alternatives --remove sendmail-command /usr/sbin/sendmail.postfix

	# Clean up chroot environment and spool directory
	/usr/sbin/postfix-chroot.sh -q remove
	cd /var/spool/postfix && queue_directory_remove || true
fi

POSTIN

/bin/sh
# upgrade configuration files if necessary
sh /etc/postfix/post-install \
	config_directory=/etc/postfix \
	daemon_directory=/usr/lib64/postfix command_directory=/usr/sbin queue_directory=/var/spool/postfix sendmail_path=/usr/sbin/sendmail.postfix newaliases_path=/usr/bin/newaliases mailq_path=/usr/bin/mailq mail_owner=postfix setgid_group=postdrop manpage_directory=/usr/share/man readme_directory=/usr/share/doc/postfix-2.2.11/README_FILES html_directory=/usr/share/doc/postfix-2.2.11/html \
	upgrade-package

# move previous sasl configuration files to new location if applicable
# have to go through many loops to prevent damaging user configuration
saslpath=`postconf -h smtpd_sasl_path | cut -d: -f 1`
if [ -n "${saslpath}" -a "${saslpath%/}" != "/usr/lib64/sasl2" -a -e /usr/lib64/sasl2/smtpd.conf ]; then
	if ! grep -qsve '^\(#.*\|[[:space:]]*\)$' ${saslpath}/smtpd.conf; then
		# ${saslpath}/smtpd.conf missing or just comments
		if [ -s ${saslpath}/smtpd.conf ] && [ ! -e ${saslpath}/smtpd.conf.rpmnew -o ${saslpath}/smtpd.conf -nt ${saslpath}/smtpd.conf.rpmnew ];then
			mv ${saslpath}/smtpd.conf ${saslpath}/smtpd.conf.rpmnew
		fi
		mv /usr/lib64/sasl2/smtpd.conf ${saslpath}/smtpd.conf
	fi
fi

if [ -e /etc/sysconfig/postfix ]; then
	/usr/sbin/postfix-chroot.sh -q update
else
	/usr/sbin/postfix-chroot.sh -q enable
fi
/usr/share/rpm-helper/add-service postfix $1 postfix 

update-alternatives --install /usr/sbin/sendmail sendmail-command /usr/sbin/sendmail.postfix 30 --slave /usr/lib/sendmail sendmail-command-in_libdir /usr/sbin/sendmail.postfix

POSTUN

/bin/sh
/usr/share/rpm-helper/del-user postfix $1 postfix 
/usr/share/rpm-helper/del-group postfix $1 postdrop

Triggers

glibc

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

setup

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

nss_ldap

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

nss_db

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

samba-winbind

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

nss_wins

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

samba2-winbind

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

nss_wins2

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

samba3-winbind

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update

nss_wins3

/bin/sh
# Generate chroot jails on the fly when needed things are installed/upgraded
/usr/sbin/postfix-chroot.sh -q update