mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-11 02:50:24 +00:00
32ed790ca9
- Support for WITH_SPF and WITH_SRS via libspf2/libsrs2, needs exiscan - Note for 5.x users: the default location of the start/stop file has changed. Build WITH_RCORDER=yes when you depend on the old behaviour - WITH_OPENLDAP_VER and WITH_MYSQL_VER does no longer imply the corresponding WITH_ variable. - experimental support for optionsng from devel/portmk
60 lines
1.8 KiB
Bash
60 lines
1.8 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Since FreeBSD does not supply a user for running an MTA in a sandbox
|
|
# by default, use user 'exim', adding it if it does not exist. Even
|
|
# if FreeBSD supplied an MTA user, it's neglected to do so for so long
|
|
# that every sandboxed MTA under the sun uses its own user, so user
|
|
# 'exim' should probably be used forever.
|
|
#
|
|
# Modern FreeBSD systems already have a group mail.
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PKG_PREFIX=${PKG_PREFIX:=%%PREFIX%%}
|
|
PKG_DESTDIR=${PKG_DESTDIR:=}
|
|
|
|
user=%%EXIM_USER%%
|
|
group=%%EXIM_GROUP%%
|
|
logdir=$PKG_DESTDIR%%LOGDIR%%
|
|
|
|
if [ "$2" = "PRE-INSTALL" ]; then
|
|
if ! /usr/bin/id ${user} > /dev/null; then
|
|
echo "Exim requires user ${user}. Please update your system." 1>&2
|
|
exit 1
|
|
fi
|
|
if ! /usr/bin/grep -q "^${group}:" /etc/group; then
|
|
echo "Exim requires group ${group}. Please update your system." 1>&2
|
|
exit 1
|
|
fi
|
|
/bin/mkdir -p ${logdir}
|
|
/usr/sbin/chown ${user}:${group} ${logdir}
|
|
fi
|
|
|
|
if [ "$2" = "POST-INSTALL" ]; then
|
|
cf=$PKG_DESTDIR$PKG_PREFIX/etc/exim/configure
|
|
if [ -e $cf ]; then
|
|
if /usr/bin/grep -q '^[^#]*hostlist.*relay_from_hosts.*=.*127.0.0.1' $cf
|
|
then
|
|
echo
|
|
echo "============================================================"
|
|
echo " !!! WARNING !!! "
|
|
echo "============================================================"
|
|
echo
|
|
echo "Existing configure file $cf"
|
|
echo "contains 127.0.0.1 in relay_from_hosts hostlist!"
|
|
echo "Use of localhost instead of 127.0.0.1 is highly recommended."
|
|
echo
|
|
echo "============================================================"
|
|
echo " !!! WARNING !!! "
|
|
echo "============================================================"
|
|
fi
|
|
fi
|
|
if ! /usr/bin/grep -qs "^exim_enable" $PKG_DESTDIR/etc/rc.conf
|
|
then
|
|
echo
|
|
echo "Don't forget to add 'exim_enable=\"YES\"' to rc.conf(5)"
|
|
echo
|
|
fi
|
|
fi
|