2001-06-11 11:20:20 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Since FreeBSD does not supply a user for running an MTA in a sandbox
|
2001-07-11 13:22:32 +02:00
|
|
|
# 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.
|
2001-06-11 11:20:20 +02:00
|
|
|
#
|
|
|
|
# Modern FreeBSD systems already have a group mail.
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
|
|
|
|
|
2001-12-11 13:34:54 +01:00
|
|
|
user=mailnull
|
2001-06-11 11:20:20 +02:00
|
|
|
group=mail
|
|
|
|
|
|
|
|
if [ "$2" = "PRE-INSTALL" ]; then
|
2002-09-12 12:09:02 +02:00
|
|
|
if ! /usr/bin/id ${user} > /dev/null; then
|
|
|
|
echo "Exim requires user ${user}. Please update your system." 1>&2
|
2001-12-11 13:34:54 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
2002-09-12 12:09:02 +02:00
|
|
|
if ! /usr/bin/grep -q "^${group}:" < /etc/group; then
|
|
|
|
echo "Exim requires group ${group}. Please update your system." 1>&2
|
2001-12-11 13:34:54 +01:00
|
|
|
exit 1
|
2001-06-11 11:20:20 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2003-06-13 15:20:56 +02:00
|
|
|
if [ "$2" = "POST-INSTALL" ]; then
|
|
|
|
cf=$PKG_PREFIX/etc/exim/configure
|
|
|
|
if [ -e $cf ]; then
|
|
|
|
if 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
|
|
|
|
fi
|
|
|
|
|
2001-06-11 11:20:20 +02:00
|
|
|
# This is naughty, since the directory we create won't be removed along
|
|
|
|
# with Exim. However, logfiles should probably stick around after Exim
|
|
|
|
# is removed, until the administrator is sure he doesn't want them
|
|
|
|
# any more.
|
|
|
|
#
|
|
|
|
mkdir -p /var/log/exim
|
|
|
|
chown ${user}:${group} /var/log/exim
|