1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 # T2 SDE: package/.../qmail/qmail.conf
5 # Copyright (C) 2004 - 2020 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 controldir="${controldir:-var/qmail/control}"
16 sysconfdir="${sysconfdir:-var/qmail/supervise}"
17 queuedir="${queuedir:-var/qmail/queue}"
18 logdir="${logdir:-var/qmail/logs}"
20 if [ "$prefix_auto" == "1" ]; then
23 sysconfdir=var/qmail/supervise
26 pkg_qmail_symlinks() {
27 if [ "$1" != "$2" -a ! -e "$root/$2" ]; then
30 ln -vs $( echo $2 | sed -e 's,[^/]*/,../,g' | tr -d [a-z] )$1 $root/$2
35 # compatibility symlinks if needed
37 hook_add preconf 2 'pkg_qmail_symlinks "$prefix" "var/qmail"'
38 hook_add preconf 4 'pkg_qmail_symlinks "$controldir" "var/qmail/control"'
39 hook_add preconf 4 'pkg_qmail_symlinks "$sysconfdir" "var/qmail/supervise"'
40 hook_add preconf 4 'pkg_qmail_symlinks "$queuedir" "var/qmail/queue"'
41 hook_add preconf 4 'pkg_qmail_symlinks "$logdir" "var/qmail/logs"'
43 # the author loves to use head -1 and tail -1
45 hook_add preconf 5 "sed -i \
46 -e 's,head -,head -n ,g' \
47 -e 's,tail -,tail -n ,g' Makefile"
51 hook_add inmake 5 'eval "$MAKE $makeopt man"'
54 hook_add postmake 1 './install'
56 # install qmail's 'sendmail' wrappers
58 pkg_qmail_sendmailwrappers() {
59 ln -sf /$prefix/bin/sendmail $root/usr/bin/sendmail_qmail
60 ln -sf /$prefix/bin/qmail-qread $root/usr/bin/mailq_qmail
62 # this is part of fastforward but fits better here
63 ln -sf /$prefix/bin/newaliases $root/usr/bin/newaliases_qmail
65 install_setmailer qmail
67 hook_add postinstall 5 'pkg_qmail_sendmailwrappers'
71 pkg_qmail_profiled() {
72 local rc=$root/var/qmail/boot/multi
74 cat <<- EOT > $root/etc/profile.d/qmail
75 export MANPATH=\$MANPATH:$mandir
76 #export PATH=\$PATH:$bindir
84 # Without logger, to use multilog outside
85 # Using qmail-local to deliver messages according to control/defaultdelivery
87 exec env - PATH="/$prefix/bin:\$PATH" \\
88 qmail-start \$( cat /$controldir/defaultdelivery )
92 [ ! -e $root/var/qmail/rc ] &&
93 ln -vs boot/multi $root/var/qmail/rc || true
96 hook_add postmake 5 'pkg_qmail_profiled'
99 hook_add postmake 6 'add_flist $prefix/queue/lock/trigger'
103 # WARNING! Patched copies of qmail can't be re-distributed and they are unsupported
106 [ "$SDECFG_PKG_QMAIL_LDAP" == "1" ] && . $confdir/qmail-ldap.conf
107 [ "$SDECFG_PKG_QMAIL_QUEUE" == "1" ] && var_append patchfiles ' ' "$( match_source_file -p qmailqueue )"
108 [ "$SDECFG_PKG_QMAIL_QMTP" == "1" ] && var_append patchfiles ' ' "$( match_source_file -p qmtpc )"
109 [ "$SDECFG_PKG_QMAIL_HOLD" == "1" ] && var_append patchfiles ' ' "$( match_source_file -p hold )"
110 [ "$SDECFG_PKG_QMAIL_AUTH" == "1" ] && var_append patchfiles ' ' "$( match_source_file -p smtpauth )"
111 [ "$SDECFG_PKG_QMAIL_SPAM" == "1" ] && {
112 qmail_spamcontrol() {
113 xf=$( match_source_file -p spamcontrol )
115 ./install_spamcontrol.sh
117 hook_add premake 2 "qmail_spamcontrol"
118 var_remove_regex patchfiles ' ' ".*hotfixes.patch"