pkgsrc/mail/qmail/INSTALL
schmonz 3aafb73dc2 Update to 1.03nb29. pkgsrc changes:
Remove unneeded options:

- Unconditionally apply netqmail (which includes a local patch; remove it)

- Unconditionally apply bigdns, maildiruniq, outgoingip, rcptcheck, remote

- Unconditionally apply the TLS + SMTP AUTH _patch_ (not the options)

- Record all applied patches (mandatory and optional) in QMAILPATCHES

- Remove badrcptto, qregex, realrcptto, viruscan (moved to rejectutils)



Simplify packaging:

- Extract a standalone patch <https://schmonz.com/qmail/rejectutils> to
  repackage the mutually conflicting recipient- and content-checking
  patches as separate programs, along with wrappers for running checks
  in sequence

- Extract a standalone patch <https://schmonz.com/qmail/destdir> to
  build to a staging area, as non-root, without hardcoded IDs

- Run the destdir patch's `install-destdir` to make or repair the queue
  and set special file permissions, obviating the need for a dependency
  on mail/queue-fix and handcrafted SPECIAL_PERMS

- While here, run `instcheck` to ensure we've installed just like `make
  setup check` as root would have

- Install INSTALL and SENDMAIL docs under their original names,
  even on Darwin

- Avoid building catpages, since we don't install them, and remove nroff
  from USE_TOOLS


Default-enable more useful options:

- "eai" (new) permits UTF-8 almost everywhere in email

- "qmail-rejectutils" (new) adds several tools for selectively
  rejecting messages

- "syncdir" forces synchronous link() and related syscalls

- "tls" and "sasl", instead of causing patch conflicts, cause the TLS
  and SMTP AUTH code to be included (!)
2017-07-21 04:07:01 +00:00

125 lines
3.5 KiB
Text

# $NetBSD: INSTALL,v 1.9 2017/07/21 04:07:01 schmonz Exp $
DOCDIR=@DOCDIR@
EGDIR=@EGDIR@
OPENSSL=@OPENSSL@
PKGMANDIR=@PKGMANDIR@
QMAILDIR=@QMAILDIR@
QMAIL_DAEMON_USER=@QMAIL_DAEMON_USER@
QMAIL_QMAIL_GROUP=@QMAIL_QMAIL_GROUP@
QMAIL_QUEUE_DIR=@QMAIL_QUEUE_DIR@
QMAIL_QUEUE_EXTRA=@QMAIL_QUEUE_EXTRA@
VAR_QMAIL_DIRS="alias bin boot control doc man queue users"
case ${STAGE} in
PRE-INSTALL)
for dir in $VAR_QMAIL_DIRS; do
if [ -e ${QMAILDIR}/$dir ]; then
${CAT} <<EOF
===========================================================================
ERROR: ${QMAILDIR} exists and is non-empty.
Please remove or rename it, then try again.
===========================================================================
EOF
exit 1
fi
done
if ${ECHO} ${QMAIL_QUEUE_DIR} | ${GREP} -q "^${QMAILDIR}/"; then
${CAT} <<EOF
===========================================================================
ERROR: QMAIL_QUEUE_DIR must not be under ${QMAILDIR}.
Please adjust your definition of QMAIL_QUEUE_DIR, then try again.
===========================================================================
EOF
exit 1
fi
# keep in sync with Makefile:pre-install
${LN} -s ${PKG_SYSCONFDIR}/alias ${QMAILDIR}/alias
${LN} -s ${PREFIX}/bin ${QMAILDIR}/bin
${LN} -s ${EGDIR}/boot ${QMAILDIR}/boot
${LN} -s ${PKG_SYSCONFDIR}/control ${QMAILDIR}/control
${LN} -s ${DOCDIR} ${QMAILDIR}/doc
${LN} -s ${PREFIX}/${PKGMANDIR} ${QMAILDIR}/man
${LN} -s ${QMAIL_QUEUE_DIR} ${QMAILDIR}/queue
${LN} -s ${PKG_SYSCONFDIR}/users ${QMAILDIR}/users
;;
POST-INSTALL)
${PREFIX}/share/qmail/setup/install-destdir
QMAIL_SETUP_EXITCODE=$?
if [ ${QMAIL_SETUP_EXITCODE} -ne 0 ]; then
${CAT} <<EOF
===========================================================================
ERROR: install-destdir exited nonzero (${QMAIL_SETUP_EXITCODE}).
Permissions are likely wrong, and/or the queue may be uninitialized.
===========================================================================
EOF
exit 1
fi
QMAIL_CHECK_OUTPUT=$(${PREFIX}/share/qmail/setup/instcheck 2>&1)
if [ -n "${QMAIL_CHECK_OUTPUT}" ]; then
${CAT} <<EOF
===========================================================================
ERROR: instcheck issued warnings:
${QMAIL_CHECK_OUTPUT}
Permissions are likely wrong, and/or the queue may be uninitialized.
===========================================================================
EOF
exit 1
fi
if ! [ -z ${QMAIL_QUEUE_EXTRA} ]; then
${CAT} <<EOF
===========================================================================
NOTE: Before using qmail, create a .qmail file corresponding with the local
user or alias "${QMAIL_QUEUE_EXTRA}" that meets the requirements for
QUEUE_EXTRA.
===========================================================================
EOF
fi
SERVERCERT=${PKG_SYSCONFDIR}/control/servercert.pem
if ! [ -z ${OPENSSL} ] && ! [ -s ${SERVERCERT} ]; then
${CAT} <<EOF
===========================================================================
NOTE: If you don't already have an SSL certificate for qmail:
# ${OPENSSL} req -new -x509 -nodes -days 366 -out ${SERVERCERT} -keyout ${SERVERCERT}
# chmod 640 ${SERVERCERT}
# chown ${QMAIL_DAEMON_USER}:${QMAIL_QMAIL_GROUP} ${SERVERCERT}
# ln -s ${SERVERCERT} ${PKG_SYSCONFDIR}/control/clientcert.pem
# update_tmprsadh
Once you have a certificate, regularly regenerate DH params from cron(8):
01 01 * * * ${PREFIX}/bin/update_tmprsadh > /dev/null 2>&1
===========================================================================
EOF
fi
;;
esac