# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/qmail/qmail.conf # Copyright (C) 2004 - 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- controldir="${controldir:-var/qmail/control}" sysconfdir="${sysconfdir:-var/qmail/supervise}" queuedir="${queuedir:-var/qmail/queue}" logdir="${logdir:-var/qmail/logs}" if [ "$prefix_auto" == "1" ]; then prefix="var/qmail" set_confopt sysconfdir=var/qmail/supervise fi pkg_qmail_symlinks() { if [ "$1" != "$2" -a ! -e "$root/$2" ]; then set -x mkdir -vp "$root/$1" ln -vs $(echo $2 | sed -e 's,[^/]*/,../,g' | tr -d [a-z])$1 $root/$2 set +x fi } # compatibility symlinks if needed # hook_add preconf 2 'pkg_qmail_symlinks "$prefix" "var/qmail"' hook_add preconf 4 'pkg_qmail_symlinks "$controldir" "var/qmail/control"' hook_add preconf 4 'pkg_qmail_symlinks "$sysconfdir" "var/qmail/supervise"' hook_add preconf 4 'pkg_qmail_symlinks "$queuedir" "var/qmail/queue"' hook_add preconf 4 'pkg_qmail_symlinks "$logdir" "var/qmail/logs"' # the author loves to use head -1 and tail -1 # hook_add preconf 5 "sed -i \ -e 's,head -,head -n ,g' \ -e 's,tail -,tail -n ,g' Makefile" # make setup # hook_add inmake 5 'eval "$MAKE $makeopt man"' makeinstopt= hook_add postmake 1 './install' # install qmail's 'sendmail' wrappers # pkg_qmail_sendmailwrappers() { ln -sf $bindir/sendmail $root/usr/bin/sendmail_qmail ln -sf $bindir/qmail-qread $root/usr/bin/mailq_qmail # this is part of fastforward but fits better here ln -sf $bindir/newaliases $root/usr/bin/newaliases_qmail install_setmailer qmail } hook_add postinstall 5 'pkg_qmail_sendmailwrappers' # profile.d # pkg_qmail_profiled() { local rc=$root/var/qmail/boot/multi cat <<- EOT > $root/etc/profile.d/qmail export MANPATH=\$MANPATH:$mandir #export PATH=\$PATH:$bindir EOT if [ ! -e $rc ]; then # and multilog rc cat <<- EOT > $rc #!/bin/sh # Without logger, to use multilog outside # Using qmail-local to deliver messages according to control/defaultdelivery exec env - PATH="$bindir:\$PATH" \\ qmail-start \$(cat /$controldir/defaultdelivery) EOT chmod +x $rc fi [ ! -e $root/var/qmail/rc ] && ln -vs boot/multi $root/var/qmail/rc || true } hook_add postmake 5 'pkg_qmail_profiled' # fifo is not flisted hook_add postmake 6 'add_flist $prefix/queue/lock/trigger' createdoc=0 # WARNING! Patched copies of qmail can't be re-distributed and they are unsupported # [ "$SDECFG_PKG_QMAIL_LDAP" == "1" ] && . $confdir/qmail-ldap.conf [ "$SDECFG_PKG_QMAIL_QUEUE" == "1" ] && var_append patchfiles ' ' "$(match_source_file -p qmailqueue)" [ "$SDECFG_PKG_QMAIL_QMTP" == "1" ] && var_append patchfiles ' ' "$(match_source_file -p qmtpc)" [ "$SDECFG_PKG_QMAIL_HOLD" == "1" ] && var_append patchfiles ' ' "$(match_source_file -p hold)" [ "$SDECFG_PKG_QMAIL_AUTH" == "1" ] && var_append patchfiles ' ' "$(match_source_file -p smtpauth)" [ "$SDECFG_PKG_QMAIL_SPAM" == "1" ] && { qmail_spamcontrol() { xf=$(match_source_file -p spamcontrol) tar $taropt $xf ./install_spamcontrol.sh } hook_add premake 2 "qmail_spamcontrol" var_remove_regex patchfiles ' ' ".*hotfixes.patch" }