pkgsrc/mail/sendmail/files/sendmail.sh
jnemeth 04f01c205f Update to sendmail 8.14.9: this fixes a minor potential security issue
pkgsrc changes:

- consolidate several patches into site.config.m4
  - pkgsrc LDFLAGS should always be used
- don't bother specifying file owner/group anywhere except in Makefile
- create include/sm/os/sm_os_netbsd.h to fix warnings and OS specific stuff
- install mail.local and rmail
- convert to use res_n* functions
  - allows for linking against threaded libraries
- add a TODO file
- PR/35249 - Loren M. Lang
  - can't find libraries on Linux, this should be fixed by using pkgsrc LDFLAGS
- PR/46694 - Makoto Fujiwara
  - bring back netbsd-proto.mc from when sendmail was part of the base system
- PR/47207 - Richard Palo
  - let pkgsrc infrastructure handle file ownership and group
- PR/48566 - Emmanuel Dreyfus
  - always set _FFR_USE_GETPWNAM_ERRNO on NetBSD
  - roll ffr_tls_1 and the suggested ffr_tls_ec into one new ffr_tls option
    - not enabled by default because it changes behaviour

8.14.9/8.14.9   2014/05/21
        SECURITY: Properly set the close-on-exec flag for file descriptors
                (except stdin, stdout, and stderr) before executing mailers.
        Fix a misformed comment in conf.c: "/*" within comment
                which may cause a compilation error on some systems.
                Problem reported by John Beck of Oracle.
        DEVTOOLS: Fix regression in auto-detection of libraries when only
                shared libraries are available.  Problem reported by
                Bryan Costales.
2014-06-15 20:48:49 +00:00

60 lines
1.4 KiB
Bash
Executable file

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: sendmail.sh,v 1.3 2014/06/15 20:48:49 jnemeth Exp $
#
# PROVIDE: mail
# REQUIRE: LOGIN
# we make mail start late, so that things like .forward's are not
# processed until the system is fully operational
. /etc/rc.subr
name="sendmail"
rcvar=$name
pidfile="@VARBASE@/run/${name}.pid"
required_files="/etc/mail/sendmail.cf"
start_precmd="sendmail_precmd"
extra_commands="reload"
makemap="@PREFIX@/sbin/makemap"
newaliases="@PREFIX@/bin/newaliases"
smbin="@PREFIX@/libexec/sendmail/sendmail"
check_files="aliases access genericstable virtusertable domaintable mailertable"
sendmail_flags="-Lsm-mta -bd -q30m"
command=$smbin
sendmail_precmd()
{
# check modifications on /etc/mail/ databases
for f in ${check_files}; do
if [ -r "/etc/mail/$f.db" ] && [ -r "/etc/mail/$f" ]; then
if [ ! "/etc/mail/$f" -ot "/etc/mail/$f.db" ]; then
echo \
"${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating"
if [ "x$f" = "xaliases" ]; then
${newaliases}
else
${makemap} hash \
/etc/mail/$f < /etc/mail/$f
fi
fi
fi
done
# check existence on /etc/mail/ databases
for f in ${check_files}; do
if [ ! -r "/etc/mail/$f.db" ] && [ -r "/etc/mail/$f" ]; then
echo "${name}: /etc/mail/$f.db not present, generating"
if [ "x$f" = "xaliases" ]; then
${newaliases}
else
${makemap} hash /etc/mail/$f < /etc/mail/$f
fi
fi
done
}
load_rc_config $name
run_rc_command "$1"