Dash:
[t2-trunk.git] / package / mail / qmail / qmail.conf
blob0d96a80408c05e5133dc645bf0286ae488ff15cb
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
3
4 # T2 SDE: package/.../qmail/qmail.conf
5 # Copyright (C) 2004 - 2020 The T2 SDE Project
6
7 # More information can be found in the files COPYING and README.
8
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
21         prefix="var/qmail"
22         set_confopt
23         sysconfdir=var/qmail/supervise
26 pkg_qmail_symlinks() {
27         if [ "$1" != "$2" -a ! -e "$root/$2" ]; then
28                 set -x
29                 mkdir -vp "$root/$1"
30                 ln -vs $( echo $2 | sed -e 's,[^/]*/,../,g' | tr -d [a-z]  )$1 $root/$2
31                 set +x
32         fi
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"
49 # make setup
51 hook_add inmake 5 'eval "$MAKE $makeopt man"'
53 makeinstopt=
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'
69 # profile.d
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
77         EOT
79         if [ ! -e $rc ]; then
80                 # and multilog rc
81                 cat <<- EOT > $rc
82                 #!/bin/sh
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 )
89                 EOT
90                 chmod +x $rc
91         fi
92         [ ! -e $root/var/qmail/rc ] &&
93                 ln -vs boot/multi $root/var/qmail/rc || true
94         
96 hook_add postmake 5 'pkg_qmail_profiled'
98 # fifo is not flisted
99 hook_add postmake 6 'add_flist $prefix/queue/lock/trigger'
101 createdoc=0
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 )
114                 tar $taropt $xf
115                 ./install_spamcontrol.sh
116         }
117         hook_add premake 2 "qmail_spamcontrol"
118         var_remove_regex patchfiles ' ' ".*hotfixes.patch"