mirror of
https://git.freebsd.org/ports.git
synced 2025-06-03 20:06:29 -04:00
- rename OPTIONS to match default name of most ports - SASL2 -> SASL - OPENLDAP -> LDAP - install main.cf and master.cf with the @sample macro - rework pkg-install - fix wrong permission for /var/db/postfix [1] - sets WANT_OPENLDAP_SASL option for openldap port when postfix LDAP_SASL option is set [2] - make usage of new ${opt}_DEPENDS notation Changelog: 20150324 Bugfix (introduced: Postfix 2.6): sender_dependent_relayhost_maps ignored the relayhost setting in the case of a DUNNO lookup result. It would use the recipient domain instead. Viktor Dukhovni. Wietse took the pieces of code that enforce the precedence of a sender-dependent relayhost, the global relayhost, and the recipient domain, and put that code together in once place so that it is easier to maintain. File: trivial-rewrite/resolve.c. 20150330 Bitrot: prepare for future changes in OpenSSL API. Viktor Dukhovni. File: tls_dane.c. 20150408 Portability: FreeBSD10 support. Files: makedefs, util/sys_defs.h. Incompatibility: specifying "make makefiles" with "CC=command" will no longer override the default WARN setting. PR: 198215 [1] 198857 [2]
88 lines
2.4 KiB
Bash
88 lines
2.4 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD: /tmp/pcvs/ports/mail/postfix/files/pkg-install.in,v 1.6 2012-02-11 05:14:34 sahil Exp $
|
|
#
|
|
|
|
# If the POSTFIX_DEFAULT_MTA environment variable is set to YES, it
|
|
# will make the port/package use defaults which make postfix replace
|
|
# sendmail as much as possible.
|
|
|
|
PREFIX=${PKG_PREFIX:=%%PREFIX%%}
|
|
ETCDIR=${ETCDIR:=%%ETCDIR%%}
|
|
DAEMONDIR=${DAEMONDIR:=%%DAEMONDIR%%}
|
|
READMEDIR=${READMEDIR:=%%READMEDIR%%}
|
|
BATCH=${BATCH:=no}
|
|
POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no}
|
|
MC=/etc/mail/mailer.conf
|
|
|
|
if [ "${POSTFIX_DEFAULT_MTA}" = "no" ]; then
|
|
DEFAULT_REPLACE_MAILERCONF=n
|
|
else
|
|
DEFAULT_REPLACE_MAILERCONF=y
|
|
fi
|
|
|
|
if [ -x /usr/sbin/nologin ]; then
|
|
NOLOGIN=/usr/sbin/nologin
|
|
else
|
|
NOLOGIN=/sbin/nologin
|
|
fi
|
|
|
|
ask() {
|
|
local question default answer
|
|
|
|
question=$1
|
|
default=$2
|
|
if [ -z "${PACKAGE_BUILDING}" -a "${BATCH}" = "no" ]; then
|
|
read -p "${question} [${default}]? " answer
|
|
fi
|
|
if [ -z "${answer}" ]; then
|
|
answer=${default}
|
|
fi
|
|
echo ${answer}
|
|
}
|
|
|
|
yesno() {
|
|
local question default answer
|
|
|
|
question=$1
|
|
default=$2
|
|
while :; do
|
|
answer=$(ask "${question}" "${default}")
|
|
case "${answer}" in
|
|
[Yy]*) return 0;;
|
|
[Nn]*) return 1;;
|
|
esac
|
|
echo "Please answer yes or no."
|
|
done
|
|
}
|
|
|
|
if [ "$2" = "POST-INSTALL" ]; then
|
|
/bin/sh ${DAEMONDIR}/post-install tempdir=/tmp \
|
|
daemon_directory=${DAEMONDIR} \
|
|
html_directory=${READMEDIR} \
|
|
readme_directory=${READMEDIR} \
|
|
upgrade-package
|
|
fi
|
|
|
|
if [ "$2" = "POST-INSTALL" -a -z "${PACKAGE_BUILDING}" -a -f "${MC}" ]; then
|
|
egrep -q "^sendmail.*${PREFIX}/sbin/sendmail" ${MC} && \
|
|
egrep -q "^send-mail.*${PREFIX}/sbin/sendmail" ${MC} && \
|
|
egrep -q "^mailq.*${PREFIX}/sbin/sendmail" ${MC} && \
|
|
egrep -q "^newaliases.*${PREFIX}/sbin/sendmail" ${MC}
|
|
ret=$?
|
|
if [ ${ret} -ne 0 ]; then
|
|
if yesno "Would you like to activate Postfix in ${MC}" ${DEFAULT_REPLACE_MAILERCONF}; then
|
|
/bin/mv -f ${MC} ${MC}.old
|
|
echo "#" > ${MC}
|
|
echo -n "# Execute the Postfix sendmail program" >> ${MC}
|
|
echo ", named ${PREFIX}/sbin/sendmail" >> ${MC}
|
|
echo "#" >> ${MC}
|
|
echo "sendmail ${PREFIX}/sbin/sendmail" >> ${MC}
|
|
echo "send-mail ${PREFIX}/sbin/sendmail" >> ${MC}
|
|
echo "mailq ${PREFIX}/sbin/sendmail" >> ${MC}
|
|
echo "newaliases ${PREFIX}/sbin/sendmail" >> ${MC}
|
|
fi
|
|
else
|
|
echo "Postfix already activated in ${MC}"
|
|
fi
|
|
fi
|