diff options
Diffstat (limited to 'package')
42 files changed, 1781 insertions, 0 deletions
diff --git a/package/build b/package/build new file mode 100644 index 0000000..390677b --- /dev/null +++ b/package/build @@ -0,0 +1 @@ +20240226150615 diff --git a/package/command-cp b/package/command-cp new file mode 100644 index 0000000..5115c14 --- /dev/null +++ b/package/command-cp @@ -0,0 +1,6 @@ + + +Additional directories to copy commands into, one per line. +The first empty line terminates the list. + +Note: This file is 'empty' here, due to legacy installation. diff --git a/package/command-ln b/package/command-ln new file mode 100644 index 0000000..85feb78 --- /dev/null +++ b/package/command-ln @@ -0,0 +1 @@ +/usr/local/bin diff --git a/package/commands-analog b/package/commands-analog new file mode 100644 index 0000000..cbc4c74 --- /dev/null +++ b/package/commands-analog @@ -0,0 +1,25 @@ +columnt +ddist +deferrals +failures +matchup +recipients +rhosts +rxdelay +senders +successes +suids +xqp +xrecipient +xsender +zddist +zdeferrals +zfailures +zoverall +zrecipients +zrhosts +zrxdelay +zsenders +zsendmail +zsuccesses +zsuids diff --git a/package/commands-base b/package/commands-base new file mode 100644 index 0000000..501724b --- /dev/null +++ b/package/commands-base @@ -0,0 +1,10 @@ +qmail-clean +qmail-inject +qmail-local +qmail-lspawn +qmail-send +qmail-queue +qmail-rspawn +qmail-send +qmail-start +qmail-todo diff --git a/package/commands-clients b/package/commands-clients new file mode 100644 index 0000000..8383dcb --- /dev/null +++ b/package/commands-clients @@ -0,0 +1,4 @@ +mailsubj +qmail-remote +qmail-qmqpc +sendmail diff --git a/package/commands-control b/package/commands-control new file mode 100644 index 0000000..d05937c --- /dev/null +++ b/package/commands-control @@ -0,0 +1,5 @@ +qmail-mfrules +qmail-showctl +qmail-badloadertypes +qmail-badmimetypes +qmail-recipients diff --git a/package/commands-dkim b/package/commands-dkim new file mode 100644 index 0000000..1ad1bf5 --- /dev/null +++ b/package/commands-dkim @@ -0,0 +1,2 @@ +qmail-dkim +qmail-dksign diff --git a/package/commands-dns b/package/commands-dns new file mode 100644 index 0000000..c1d692c --- /dev/null +++ b/package/commands-dns @@ -0,0 +1,10 @@ +dnscname +dnsfq +dnsip +dnsmxip +dnsptr +dnstlsa +dnstxt +hostname +ipmeprint +spfquery diff --git a/package/commands-forward b/package/commands-forward new file mode 100644 index 0000000..1d2627d --- /dev/null +++ b/package/commands-forward @@ -0,0 +1,8 @@ +fastforward +forward +setforward +newaliases +newinclude +printforward +printmaillist +setmaillist diff --git a/package/commands-log b/package/commands-log new file mode 100644 index 0000000..3fe9f6f --- /dev/null +++ b/package/commands-log @@ -0,0 +1,4 @@ +qmail-mrtg +qmail-mrtg-queue +splogger +tai64nfrac diff --git a/package/commands-mbox b/package/commands-mbox new file mode 100644 index 0000000..fc32c41 --- /dev/null +++ b/package/commands-mbox @@ -0,0 +1,9 @@ +condredirect +bouncesaying +except +maildirmake +maildir2mbox +maildirwatch +preline +qbiff +qreceipt diff --git a/package/commands-pam b/package/commands-pam new file mode 100644 index 0000000..27a6a69 --- /dev/null +++ b/package/commands-pam @@ -0,0 +1,4 @@ +qmail-authuser +qmail-smtpam +qmail-vmailuser +qmail-postgrey diff --git a/package/commands-pop b/package/commands-pop new file mode 100644 index 0000000..f14d6da --- /dev/null +++ b/package/commands-pop @@ -0,0 +1,2 @@ +qmail-popup +qmail-pop3d diff --git a/package/commands-queue b/package/commands-queue new file mode 100644 index 0000000..d439b37 --- /dev/null +++ b/package/commands-queue @@ -0,0 +1,5 @@ +qmail-qread +qmail-qstat +qmail-tcpok +qmail-tcpto +qmail-qmaint diff --git a/package/commands-recipients b/package/commands-recipients new file mode 100644 index 0000000..c83d272 --- /dev/null +++ b/package/commands-recipients @@ -0,0 +1 @@ +qmail-alias2recipients diff --git a/package/commands-scan b/package/commands-scan new file mode 100644 index 0000000..456c4b3 --- /dev/null +++ b/package/commands-scan @@ -0,0 +1 @@ +qmail-queue-scan diff --git a/package/commands-server b/package/commands-server new file mode 100644 index 0000000..be8bba9 --- /dev/null +++ b/package/commands-server @@ -0,0 +1,3 @@ +qmail-qmtpd +qmail-qmqpd +qmail-smtpd diff --git a/package/commands-setup b/package/commands-setup new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/package/commands-setup diff --git a/package/commands-srs b/package/commands-srs new file mode 100644 index 0000000..02db41a --- /dev/null +++ b/package/commands-srs @@ -0,0 +1,2 @@ +srsforward +srsreverse diff --git a/package/commands-user b/package/commands-user new file mode 100644 index 0000000..55d4d04 --- /dev/null +++ b/package/commands-user @@ -0,0 +1,4 @@ +qmail-getpw +qmail-newu +qmail-newmrh +qmail-pw2u diff --git a/package/commands-x509 b/package/commands-x509 new file mode 100644 index 0000000..a91ec38 --- /dev/null +++ b/package/commands-x509 @@ -0,0 +1,2 @@ +x509fingerprint +mkdkimkey diff --git a/package/compile b/package/compile new file mode 100755 index 0000000..b8aa789 --- /dev/null +++ b/package/compile @@ -0,0 +1,96 @@ +#!/bin/sh + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +safe umask 022 +[ -d package ] || barf "no package directory" +[ -d src ] || barf "no src directory" + +here=`env - PATH=$PATH pwd` + +[ -d compile ] || safe mkdir -p compile +[ -d commmand ] || safe mkdir -p command +[ -r compile/home ] || echo $here > compile/home +[ -h compile/src ] || safe ln -s $here/src compile/src + +for i in `ls src` +do + [ ! -d src/$i ] && [ -h compile/$i ] || safe ln -sf src/$i compile/$i +done + +for i in `sed -e '/^it-/!d' -e 's/^it-//' < compile/it=d` +do + all="$all $i" +done + +other="`grep -v '^it-' compile/it=d`" +usage() { shout "usage: package/compile [ [-]$all ]"; exit 100; } + +targets="" +if [ $# -eq 0 ] +then + targets="$all" +else + if [ "$1" = "-" ] + then + shift + suppress=":" + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + suppress="$suppress$i:" + done + for i in $all + do + case "$suppress" in + *:$i:*) + ;; + *) + targets="$targets $i" + ;; + esac + done + else + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + targets="$targets $i" + done + fi +fi + +[ "X$all" != "X" ] && [ "X$targets" = "X" ] && usage + +commands="" +for i in $targets +do + commands="$commands `cat package/commands-$i`" +done + +safe cd compile +safe make $other `echo "$targets" | sed -e 's/ / it-/g'` +safe cd $here + +for i in $commands +do + i=${i%:} + safe rm -f command/$i'{new}' + safe cp -p compile/$i command/$i'{new}' + safe mv -f command/$i'{new}' command/$i +done + +exit 0 diff --git a/package/control b/package/control new file mode 100755 index 0000000..8f2bdf8 --- /dev/null +++ b/package/control @@ -0,0 +1,36 @@ +#!/bin/sh + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} +home=`head -1 $mypwd/conf-home` + +safe umask 022 +[ -d package ] || barf "no package directory" +[ -d command ] || barf "no command directory" +[ -d ctl ] || barf "no ctl directory" +[ -d $home/control ] || barf "no s/qmail/control directory" + +[ -x command/hostname ] || barf "no 'hostname' file" + +[ -f $home/control/me ] || \ +safe command/hostname > $home/control/me + +[ -f $home/control/rcpthosts ] || \ +safe command/hostname > $home/control/rcpthosts + +[ -f $home/control/tlsdestinations ] || \ +safe echo '*:' > $home/control/tlsdestinations + +for i in `ls ctl` +do + [ -f $home/control/$i ] || safe cp ctl/$i $home/control/ +done + +shout "s/qmail control files populated." + +exit 0 diff --git a/package/dir b/package/dir new file mode 100755 index 0000000..ab9b8a0 --- /dev/null +++ b/package/dir @@ -0,0 +1,19 @@ +#!/bin/sh +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} +home=`head -1 $mypwd/conf-home` + +if [ -d $home ] +then + shout "Keeping directory $home." + shout "The queue directory will use now bigtodo ..." +else + safe mkdir -p $home +fi + +exit 0 diff --git a/package/files b/package/files new file mode 100644 index 0000000..64878ca --- /dev/null +++ b/package/files @@ -0,0 +1,543 @@ +INSTALL +README.md +addons +addons/clamav-0.90.1_output.patch +conf-break +conf-cc +conf-delivery +conf-groups +conf-home +conf-idn2 +conf-ids +conf-instances +conf-ld +conf-log +conf-man +conf-patrn +conf-qlibs +conf-qmq +conf-spawn +conf-split +conf-svcdir +conf-ucspissl +conf-users +ctl +ctl/badloadertypes +ctl/badmailfrom +ctl/badmimetypes +ctl/badrcptto +ctl/locals +ctl/rules.qmtpd.cdb +ctl/rules.qmtpd.txt +ctl/rules.smtpd.cdb +ctl/rules.smtpd.txt +doc +doc/BLURB +doc/CHANGELOG +doc/CHANGELOG_V3 +doc/CONTRIBUTERS +doc/EXTTODO +doc/LICENSE +doc/LOGGING +doc/Old/PROPOSAL.mav +doc/Old/README.djbdns +doc/Old/README.mav +doc/Old/README.qmq +doc/Old/README.recipients +doc/Old/README.wildmat +doc/Postgrey.txt +doc/Qmail/BLURB +doc/Qmail/FAQ +doc/Qmail/INSTALL.alias +doc/Qmail/INSTALL.ctl +doc/Qmail/INSTALL.ids +doc/Qmail/INSTALL.maildir +doc/Qmail/INSTALL.mbox +doc/Qmail/INSTALL.qmail +doc/Qmail/INTERNALS +doc/Qmail/PIC.local2alias +doc/Qmail/PIC.local2ext +doc/Qmail/PIC.local2local +doc/Qmail/PIC.local2rem +doc/Qmail/PIC.local2virt +doc/Qmail/PIC.nullclient +doc/Qmail/PIC.relaybad +doc/Qmail/PIC.relaygood +doc/Qmail/PIC.rem2local +doc/Qmail/README +doc/Qmail/REMOVE.binmail +doc/Qmail/REMOVE.sendmail +doc/Qmail/SYSDEPS +doc/Qmail/TEST.deliver +doc/Qmail/TEST.receive +doc/Qmail/THANKS +doc/Qmail/THOUGHTS +doc/Qmail/TODO.djb +doc/Qmail/TODO.done +doc/README.clamav +doc/README.smtpreply +doc/TODO +doc/TODO +doc/smtpreplies +etc/qmail-mrtg.pop3d.sample +etc/qmail-mrtg.send.sample +etc/qmail-mrtg.smtpd.sample +man +man/Makefile +man/Makefile.mandoc +man/TARGETS +man/addresses.5 +man/bouncesaying.1 +man/columnt.1 +man/condredirect.1 +man/datetime.3 +man/dnscname.8 +man/dnsfq.8 +man/dnsip.8 +man/dnsmxip.8 +man/dnsptr.8 +man/dnstlsa.8 +man/dnstxt.8 +man/dot-qmail.9 +man/envelopes.5 +man/except.1 +man/fastforward.1 +man/forgeries.7 +man/forward.1 +man/hostname.8 +man/ipmeprint.8 +man/maildir.5 +man/maildir2mbox.1 +man/maildirmake.1 +man/maildirwatch.1 +man/mailsubj.1 +man/matchup.1 +man/mbox.5 +man/newaliases.1 +man/newinclude.1 +man/preline.1 +man/printforward.1 +man/printmaillist.1 +man/qbiff.1 +man/qmail-authuser.9 +man/qmail-badloadertypes.9 +man/qmail-badmimetypes.9 +man/qmail-clean.8 +man/qmail-command.8 +man/qmail-control.9 +man/qmail-dkim.8 +man/qmail-dksign.9 +man/qmail-dkverify.8 +man/qmail-getpw.9 +man/qmail-header.5 +man/qmail-inject.8 +man/qmail-limits.9 +man/qmail-local.8 +man/qmail-log.5 +man/qmail-lspawn.8 +man/qmail-mfrules.9 +man/qmail-mrtg.8 +man/qmail-newmrh.9 +man/qmail-newu.9 +man/qmail-pop3d.8 +man/qmail-popup.8 +man/qmail-postgrey.8 +man/qmail-pw2u.9 +man/qmail-qmaint.8 +man/qmail-qmqpc.8 +man/qmail-qmqpd.8 +man/qmail-qmtpd.8 +man/qmail-qread.8 +man/qmail-qstat.8 +man/qmail-queue.8 +man/qmail-recipients.9 +man/qmail-remote.8 +man/qmail-rspawn.8 +man/qmail-send.9 +man/qmail-showctl.8 +man/qmail-smtpam.8 +man/qmail-smtpd.8 +man/qmail-start.9 +man/qmail-tcpok.8 +man/qmail-tcpto.8 +man/qmail-todo.8 +man/qmail-users.9 +man/qmail-vmailuser.9 +man/qreceipt.1 +man/setforward.1 +man/setmaillist.1 +man/spfquery.8 +man/splogger.8 +man/sqmail.9 +man/srsforward.1 +man/srsreverse.9 +man/tai64nfrac.5 +man/tcp-environ.5 +man/xqp.1 +man/xrecipient.1 +man/xsender.1 +package +package/build +package/command-cp +package/command-ln +package/commands-analog +package/commands-base +package/commands-clients +package/commands-control +package/commands-dkim +package/commands-dns +package/commands-forward +package/commands-log +package/commands-mbox +package/commands-pam +package/commands-pop +package/commands-queue +package/commands-recipients +package/commands-scan +package/commands-server +package/commands-setup +package/commands-srs +package/commands-user +package/commands-x509 +package/compile +package/control +package/dir +package/files +package/ids +package/install +package/legacy +package/man +package/path +package/qmq +package/report +package/rts +package/run +package/scripts +package/service +package/services=d +package/sslenv +package/ucspissl +package/upgrade +package/version +scripts +scripts/Makefile +scripts/TARGETS +scripts/it-pam=d +scripts/it-recipients=d +scripts/it-scan=d +scripts/it-x509=d +scripts/it=d +scripts/ksh-auto.sh +scripts/ldap-pam.pl +scripts/mkdkimkey.sh +scripts/multiple-queues.sh +scripts/perl-auto.sh +scripts/qmail-alias2recipients.sh +scripts/qmail-queue-scan.sh +scripts/warn-auto.sh +scripts/x509fingerprint.sh +service/run_log +service/run_pop3d +service/run_pop3sd +service/run_postgrey +service/run_qmqpd +service/run_qmtpd +service/run_qmtpsd +service/run_send +service/run_smtpd +service/run_smtpsd +service/run_smtpsub +service/ssl.env +src +src/Makefile +src/TARGETS +src/auto-gid.c +src/auto-int.c +src/auto-int8.c +src/auto-str.c +src/auto-uid.c +src/base64.c +src/bouncesaying.c +src/chkshsgr.c +src/chkspawn.c +src/columnt.c +src/commands.c +src/condredirect.c +src/config-fast.sh +src/config.sh +src/constmap.c +src/control.c +src/crypt.lib +src/date822fmt.c +src/datemail.sh +src/datetime.c +src/datetime_un.c +src/ddist.sh +src/deferrals.sh +src/direntry.h1 +src/direntry.h2 +src/dkim.cpp +src/dkimbase.cpp +src/dkimsign.cpp +src/dkimverify.cpp +src/dns.c +src/dns_tlsa.c +src/dnscname.c +src/dnsdoe.c +src/dnsfq.c +src/dnsip.c +src/dnsmxip.c +src/dnsptr.c +src/dnstlsa.c +src/dnstxt.c +src/except.c +src/failures.sh +src/fastforward.c +src/fifo.c +src/find-systype.sh +src/fmtqfn.c +src/fork.h1 +src/fork.h2 +src/forward.c +src/gfrom.c +src/headerbody.c +src/hfield.c +src/hier.c +src/hmac_md5.c +src/hostname.c +src/include +src/include/auto_break.h +src/include/auto_patrn.h +src/include/auto_qmail.h +src/include/auto_spawn.h +src/include/auto_split.h +src/include/auto_uids.h +src/include/auto_usera.h +src/include/base64.h +src/include/commands.h +src/include/constmap.h +src/include/control.h +src/include/date822fmt.h +src/include/datetime.h +src/include/dkim.h +src/include/dkimbase.h +src/include/dkimsign.h +src/include/dkimverify.h +src/include/dns.h +src/include/dnsgettxt.h +src/include/dnsdoe.h +src/include/exit.h +src/include/extra.h +src/include/fifo.h +src/include/fmtqfn.h +src/include/gfrom.h +src/include/global.h +src/include/headerbody.h +src/include/hfield.h +src/include/hier.h +src/include/hmac_md5.h +src/include/ipalloc.h +src/include/ipme.h +src/include/maildir.h +src/include/md5.h +src/include/mfrules.h +src/include/myctime.h +src/include/newfield.h +src/include/now.h +src/include/prioq.h +src/include/prot.h +src/include/qlx.h +src/include/qmail.h +src/include/qsutil.h +src/include/quote.h +src/include/rcpthosts.h +src/include/readsubdir.h +src/include/readwrite.h +src/include/received.h +src/include/recipients.h +src/include/sendtodo.h +src/include/sha1.h +src/include/sha256.h +src/include/smtpdlog.h +src/include/spf.h +src/include/srs2.h +src/include/strset.h +src/include/tcpto.h +src/include/tls_errors.h +src/include/tls_remote.h +src/include/tls_start.h +src/include/tls_timeoutio.h +src/include/token822.h +src/include/trigger.h +src/include/triggerpull.h +src/include/ucspitls.h +src/include/wildmat.h +src/install.c +src/instcheck.c +src/ipalloc.c +src/ipme.c +src/ipmeprint.c +src/it-analog=d +src/it-base=d +src/it-clients=d +src/it-control=d +src/it-dkim=d +src/it-dns=d +src/it-forward=d +src/it-log=d +src/it-mbox=d +src/it-pam=d +src/it-pop=d +src/it-queue=d +src/it-server=d +src/it-setup=d +src/it-srs=d +src/it-user=d +src/it=d +src/maildir.c +src/maildir2mbox.c +src/maildirmake.c +src/maildirwatch.c +src/mailsubj.sh +src/make-compile.sh +src/make-load.sh +src/make-makelib.sh +src/matchup.c +src/md5c.c +src/mfrules.c +src/migrate.sh +src/myctime.c +src/newaliases.c +src/newfield.c +src/newinclude.c +src/now.c +src/predate.c +src/preline.c +src/printforward.c +src/printmaillist.c +src/prioq.c +src/prot.c +src/qbiff.c +src/qmail-authuser.c +src/qmail-badloadertypes.c +src/qmail-badmimetypes.c +src/qmail-clean.c +src/qmail-dkim.cpp +src/qmail-dksign.c +src/qmail-dkverify.c +src/qmail-getpw.c +src/qmail-inject.c +src/qmail-local.c +src/qmail-lspawn.c +src/qmail-mfrules.c +src/qmail-mrtg-queue.sh +src/qmail-mrtg.c +src/qmail-newmrh.c +src/qmail-newu.c +src/qmail-pop3d.c +src/qmail-popup.c +src/qmail-postgrey.c +src/qmail-pw2u.c +src/qmail-qmaint.c +src/qmail-qmqpc.c +src/qmail-qmqpd.c +src/qmail-qmtpd.c +src/qmail-qread.c +src/qmail-qstat.sh +src/qmail-queue.c +src/qmail-recipients.c +src/qmail-remote.c +src/qmail-rspawn.c +src/qmail-send.c +src/qmail-showctl.c +src/qmail-smtpam.c +src/qmail-smtpd.c +src/qmail-start.c +src/qmail-tcpok.c +src/qmail-tcpto.c +src/qmail-todo.c +src/qmail-upq.sh +src/qmail-vmailuser.c +src/qmail.c +src/qreceipt.c +src/qsutil.c +src/quote.c +src/rcpthosts.c +src/readsubdir.c +src/received.c +src/recipients.c +src/recipients.sh +src/rhosts.sh +src/rxdelay.sh +src/select.h1 +src/select.h2 +src/senders.sh +src/sendmail.c +src/setforward.c +src/setmaillist.c +src/sha1.c +src/sha256.c +src/smtpdlog.c +src/spawn.c +src/spf.c +src/spfdnsip.c +src/spfquery.c +src/splogger.c +src/srs2.c +src/srsforward.c +src/srsreverse.c +src/strset.c +src/successes.sh +src/suids.sh +src/tai64nfrac.c +src/tcpto.c +src/tcpto_clean.c +src/tls_errors.c +src/tls_remote.c +src/tls_start.c +src/tls_timeoutio.c +src/token822.c +src/trigger.c +src/triggerpull.c +src/trycpp.c +src/trycrypt.c +src/trydnsresolv.c +src/trydrent.c +src/tryflock.c +src/tryidn2.c +src/trylsock.c +src/trymkffo.c +src/trynpbg1.c +src/tryqlibs.c +src/tryrsolv.c +src/trysalen.c +src/trysgact.c +src/trysgprm.c +src/tryshadow.c +src/tryshsgr.c +src/tryslib.c +src/tryspnam.c +src/trysysel.c +src/trysyslog.c +src/tryulong32.c +src/tryuserpw.c +src/tryutmp.c +src/tryvfork.c +src/trywaitp.c +src/warn-auto.sh +src/warn-shsgr +src/wildmat.c +src/xqp.sh +src/xrecipient.sh +src/xsender.sh +src/zddist.sh +src/zdeferrals.sh +src/zfailures.sh +src/zoverall.sh +src/zrecipients.sh +src/zrhosts.sh +src/zrxdelay.sh +src/zsenders.sh +src/zsendmail.sh +src/zsuccesses.sh +src/zsuids.sh diff --git a/package/ids b/package/ids new file mode 100755 index 0000000..7b18788 --- /dev/null +++ b/package/ids @@ -0,0 +1,106 @@ +#!/bin/sh +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} +home=`head -1 $mypwd/conf-home` + +if [ -f $mypwd/conf-ids ] +then + sqmailids=`grep -v "^#" $mypwd/conf-ids | grep ":" | tr ' ' '_'` +else + barf "Can't open file '$mypwd/conf-ids' with sqmail ids!" +fi + +unix=`uname -a | cut -d' ' -f1 | tr [a-z] [A-Z]` + +if [ "$unix" = "LINUX" ] +then + qshl="/bin/false" + shout "Linux (Shell: $qshl):" + + for line in $sqmailids + do + if [ `echo $line | grep "group"` ] + then + qgid=`echo "$line" | cut -d":" -f1` + qgrp=`echo "$line" | cut -d":" -f2` + if [ `grep -c ^$qgrp /etc/group` -eq 0 ] + then + safe groupadd -g $qgid $qgrp + else + shout "Group '$qgrp' already existing!" + fi + fi + + if [ `echo $line | grep "user"` ] + then + quid=`echo "$line" | cut -d":" -f1` + qusr=`echo "$line" | cut -d":" -f2` + qcom=`echo "$line" | cut -d":" -f3 | tr "_" " "` + qgrp=`echo "$line" | cut -d":" -f4` + qdir="$home/`echo "$line" | cut -d":" -f5`" + if [ `grep -c $qusr /etc/passwd` -eq 0 ] + then + shout "Generating user: $qusr:$quid - $qgr - $qdir - $qshl - $qcom" + safe useradd -u $quid -g $qgrp -d $qdir $qusr -s $qshl -c "$qcom" + else + shout "User '$qusr' already existing!" + fi + fi + done + +elif [ `echo "$unix" | grep "BSD"` ] +then + qshl="/sbin/nologin" + shout "BSD ($unix) (Shell: $qshl):" + + for line in $sqmailids + do + if [ `echo $line | grep "group"` ] + then + qgid=`echo "$line" | cut -d":" -f1` + qgrp=`echo "$line" | cut -d":" -f2` + if [ `grep -c ^$qgrp /etc/group` -eq 0 ] + then + if [ `echo "$unix" | grep "OPENBSD"` ] + then + safe groupadd -g $qgid $qgrp + else + safe pw groupadd $qgrp -g $qgid $qgrp + fi + else + shout "Group '$qgrp' already existing!" + fi + fi + if [ `echo $line | grep "user"` ] + then + quid=`echo "$line" | cut -d":" -f1` + qusr=`echo "$line" | cut -d":" -f2` + qcom=`echo "$line" | cut -d":" -f3 | tr "_" " "` + qgrp=`echo "$line" | cut -d":" -f4` + qdir="$home/`echo "$line" | cut -d":" -f5`" + if [ `grep -c $qusr /etc/passwd` -eq 0 ] + then + shout "Generating user: $qusr:$quid - $qgrp - $qdir - $qshl - $qcom" + if [ `echo "$unix" | grep "OPENBSD"` ] + then + safe useradd -u $quid -g $qgrp -d $qdir -s $qshl -c "$qcom" $qusr + else + safe pw useradd $qusr -u $quid -g $qgrp -d $qdir -s $qshl -c "$qcom" + fi + else + shout "User '$qusr' already existing!" + fi + fi + done + +else + shout "Unix OS not recognized; please install s/qmail user/groups manually \\ + and continue with installation step-by-step." +fi + +exit 0 diff --git a/package/install b/package/install new file mode 100755 index 0000000..a3e121c --- /dev/null +++ b/package/install @@ -0,0 +1,12 @@ +#!/bin/sh -e +package/dir ${1+"$@"} +package/ids ${1+"$@"} +package/ucspissl ${1+"$@"} +package/compile ${1+"$@"} +package/upgrade ${1+"$@"} +package/legacy ${1+"$@"} +package/man ${1+"$@"} +package/control ${1+"$@"} +package/sslenv ${1+"$@"} +package/service ${1+"$@"} +package/run ${1+"$@"} diff --git a/package/legacy b/package/legacy new file mode 100755 index 0000000..3acee1d --- /dev/null +++ b/package/legacy @@ -0,0 +1,23 @@ +#!/bin/sh + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` + +safe umask 022 +[ -d package ] || barf "no package directory" +[ -d src ] || barf "no src directory" +[ -d compile ] || barf "no compile directory" + +safe cd compile + +[ -f install ] && safe ./install +[ -f instcheck ] && safe ./instcheck + +safe cd $here + +shout "s/qmail binary files installed in `head -n 1 conf-home`/bin." + +exit 0 diff --git a/package/man b/package/man new file mode 100755 index 0000000..6b79049 --- /dev/null +++ b/package/man @@ -0,0 +1,124 @@ +#!/bin/sh +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +me=`cat package/path | cut -d'/' -f2` +unix=`uname -a | cut -d' ' -f1 | tr [a-z] [A-Z]` +mandir="" +usemanpath=0 +usemandoc=0 + +if [ `which manpath` 2>/dev/null ] +then + usemanpath=1 +fi + +if [ `which mandoc` 2>/dev/null ] +then + usemandoc=1 + shout "Using mandoc facility for man files." +fi + +safe umask 022 +[ -d man ] || barf "no man directory" + +if [ -f conf-man ] +then + mandir=`head -1 conf-man` + if [ -d "$mandir" ] + then + shout "Setting manual man-dir: $mandir." + else + if [ $usemanpath -eq 0 ] + then + barf "`manpath` not available; use conf-man instead." + fi + mandir=`manpath | awk -F: '{print $1}'` + if [ -d "$mandir" ] + then + shout "Setting manpath man-dir: $mandir." + else + barf "can't determine man-path directory." + fi + fi +else + barf "can't determine man-path directory." + exit 1 +fi + +cd man +if [ $usemandoc -eq 1 ] +then + safe make -f Makefile.mandoc +else + safe make +fi + +if [ $usemandoc -eq 0 ] +then + shout "Installing ${me} compressed man-files in ${mandir}." +else + shout "Installing ${me} un-compressed man-files in ${mandir}." +fi + +for i in `find . -name "*[1-8]"` +do + all="$all $i" +done + +for manfile in $all +do + dir="man`echo $manfile | awk -F. '{print $NF}'`" + [ -d $mandir/$dir ] || safe mkdir $mandir/$dir + if [ $usemandoc -eq 0 ] + then + safe gzip $manfile && \ + install -m 644 "$manfile.gz" $mandir/$dir/"${manfile#*/}.gz" + else + safe install -m 644 $manfile $mandir/$dir/${manfile#*./} + fi +done + +## nroff: Required for old catman systems only + +if [ $usemandoc -eq 0 ] +then + shout "Installing ${me} nroff'ed man-files in ${mandir}/catX." + + all="" + for i in `find . -name "*0"` + do + all="$all $i" + done + + for manfile in $all + do + catname=${manfile%.0} + catfiles=`ls -1 ${catname}* | grep -v '.0' | grep -v '.9'` + + for catfile in $catfiles + do + dir="$mandir/cat`echo $catfile | awk -F. '{print $(NF-1)}'`" + safe mkdir -p $dir + safe install -m 644 $manfile $dir/${manfile#*/} + done + done +else + if [ `which makewhatis` 2>/dev/null ] + then + makewhatis $mandir + shout "Installing ${me} mandoc files in db (makewhatis)." + elif [ `which catman` 2>/dev/null ] + then + catman $mandir + shout "Installing ${me} mandoc files in db (catman)." + else + man -w $mandir + shout "Installing ${me} mandoc files in db (man -w)." + fi +fi + +cd .. + +exit 0 diff --git a/package/path b/package/path new file mode 100644 index 0000000..c4103a3 --- /dev/null +++ b/package/path @@ -0,0 +1 @@ +mail/sqmail diff --git a/package/qmq b/package/qmq new file mode 100755 index 0000000..2667280 --- /dev/null +++ b/package/qmq @@ -0,0 +1,162 @@ +#!/bin/sh -e + +action=$1 + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} +home=`head -1 ${mypwd}/conf-home` +qmaill=`grep Log ${mypwd}/conf-ids | awk -F: '{print $2}'` + +QMQ_HOME="" +if [ -f ${mypwd}/conf-home ] +then + export QMQ_HOME=`head -1 ${mypwd}/conf-home` +fi +[ -d "${QMQ_HOME}" ] || barf "s/qmail home dir '${QMQ_HOME}' not available." + +QMQ_LOGS="" +if [ -f ${mypwd}/conf-log ] +then + export QMQ_LOGS=`head -1 ${mypwd}/conf-log` +fi +[ -d "${QMQ_LOGS}" ] || barf "s/qmail log dir '${QMQ_LOGS}' not available." + +SVC_DIR="" +if [ -f ${mypwd}/conf-svcdir ] +then + export SVC_DIR=`head -1 ${mypwd}/conf-svcdir` +fi +[ -d "${SVC_DIR}" ] || barf "supervise dir '${SVC_DIR}' not available." + +export QMQ_ME=`hostname` + +instances="" +if [ -f ${mypwd}/conf-instances ] +then + myinstances=`grep -v "^#" ${mypwd}/conf-instances | cut -d'#' -f1` + shout "Setting s/qmail QMQ instances:" + shout "-------------------------------------------------------------------" + echo "${myinstances}" + shout "-------------------------------------------------------------------" +else + barf "No QMQ instances defined." +fi + +if [ -f ${mypwd}/conf-qmq ] +then + . ${mypwd}/conf-qmq + shout "Setting s/qmail QMQ skeleton environment:" + safe env | grep SKELETON +else + barf "No QMQ environment available." +fi + + +if [ "X${myinstances}" != "X" ] +then + shout "--> Use '$0 build' to setup the instances." + shout "--> Use '$0 conf' to deploy the instances." + shout "--> Use '$0 all' to setup and deploy the instances." + shout "-------------------------------------------------------------------" + shout "Note (1): s/qmail will be installed at '${QMQ_HOME}'." + shout "Note (2): s/qmail-logs will be installed at '${QMQ_LOGS}/[qmail|qmtp]-INSTANCEID' ...." + shout "Note (3): 'service' base directory is '${SVC_DIR}'." + shout "Note (4): 'qmail-send' will be initially touched 'down' at every instance." + shout "Note (5): Initial configuration is: 'queuelifetime=${SKELETON_QUEUELIFETIME}', concurrencyremote=${SKELETON_CONCURRENCYREMOTE}'." + shout "Note (6): Communication from the primary qmail instance to the secondaries is based on 'QMTP'." + shout "-------------------------------------------------------------------" + shout "Enter 'ctl-c' to abort; otherwise '$0 $action' will continue in 10 secs." + sleep 10 +fi + +if [ "X$action" = "Xbuild" -o "X$action" = "Xall" ] +then + safe cp ${mypwd}/conf-home ${mypwd}/conf-home.org + + for mapping in ${myinstances} + do + instance=${mapping%%:*} + ipaddress=$(echo ${mapping} | cut -d':' -f3) + [ "X${ipaddress}" = "X" ] && ipaddress=0 + + QMQ_INST="${QMQ_HOME%/*}/qmail-${instance}" + shout "Setting up QMQ instance: ${QMQ_INST} (IP: $ipaddress)" + + safe mkdir -p ${QMQ_INST} + safe mkdir -p ${QMQ_LOGS}/qmail-${instance} + safe chown $qmaill ${QMQ_LOGS}/qmail-${instance} + safe mkdir -p ${QMQ_LOGS}/qmtp-${instance} + safe chown $qmaill ${QMQ_LOGS}/qmtp-${instance} + + safe cd ${mypwd}/compile + safe echo "${QMQ_INST}" > ${mypwd}/conf-home + safe make + safe ./install + safe echo "${SKELETON_ME}" > ${QMQ_INST}/control/me + safe echo "${SKELETON_CONCURRENCYREMOTE}" > ${QMQ_INST}/control/concurrencyremote + safe echo "#!@:localhost;bounceport -- typically 1090" > ${QMQ_INST}/control/qmtproutes + [ "${ipaddress}" != "0" ] && safe echo "*:${ipaddress}" > ${QMQ_INST}/control/domainips + done + + safe mv ${mypwd}/conf-home.org ${mypwd}/conf-home + + shout "All s/qmail QMQ instances build." +fi + +if [ "X$action" = "Xconf" -o "X$action" = "Xall" ] +then + for mapping in ${myinstances} + do + instance=${mapping%%:*} + ipaddress=$(echo ${mapping} | cut -d':' -f3) + [ "X${ipaddress}" = "X" ] && ipaddress=0 + + QMQ_INST="${QMQ_HOME%/*}/qmail-${instance}" + shout "Configurating initially QMQ instance: ${QMQ_INST} (IP address: $ipaddress)" + + port=$((${SKELETON_PORT}+${instance})) + shout "Selecting port ${port} for instance ${instance} ..." +# +## qmail-send/qmail-start +# + safe mkdir -p ${QMQ_INST}/svc/qmail-${instance}/log + safe cp ${mypwd}/service/run_log ${QMQ_INST}/svc/qmail-${instance}/log/run + safe chmod +x ${QMQ_INST}/svc/qmail-${instance}/log/run + + safe eval sed -e 's!/var/qmail!${QMQ_INST}!g' \ + ${mypwd}/service/run_send \ + > ${QMQ_INST}/svc/qmail-${instance}/run + safe chmod +x ${QMQ_INST}/svc/qmail-${instance}/run + safe touch ${QMQ_INST}/svc/qmail-${instance}/down +# +## qmail-qmtpd +# + safe mkdir -p ${QMQ_INST}/svc/qmtp-${instance}/log + safe cp ${mypwd}/service/run_log ${QMQ_INST}/svc/qmtp-${instance}/log/run + safe chmod +x ${QMQ_INST}/svc/qmtp-${instance}/log/run + + safe eval sed -e 's!/var/qmail!${QMQ_INST}!g' \ + -e 's!0\ qmtp!$ipaddress\ $port!g' \ + ${mypwd}/service/run_qmtpd \ + > ${QMQ_INST}/svc/qmtp-${instance}/run + safe chmod +x ${QMQ_INST}/svc/qmtp-${instance}/run + safe touch ${QMQ_INST}/svc/qmtp-${instance}/down + +# +## link to /svc +# +# safe ln -s ${QMQ_INST}/svc/qmtp-${instance} ${SVC_DIR}/qmail-${instance}-qmtpd +# safe ln -s ${QMQ_INST}/svc/qmail-${instance} ${SVC_DIR}/qmail-${instance}-send + done + + shout "All QMQ instances configured, available unter ${SVC_DIR} but toched 'down'." +else + barf "Please provide either 'build' and 'conf' for individual actions; or 'all' for all-inclusive." +fi + +exit 0 diff --git a/package/report b/package/report new file mode 100755 index 0000000..ef2f2cb --- /dev/null +++ b/package/report @@ -0,0 +1,10 @@ +#!/bin/sh -e +test -d compile || ( echo 'Wrong working directory.'; exit 1 ) +here=`env - PATH=$PATH pwd` +( echo sqmail-`head -1 package/version` + echo $here + if test -r compile/sysdeps + then + cat compile/sysdeps + fi +) | mail sqmail@fehcom.de diff --git a/package/rts b/package/rts new file mode 100755 index 0000000..d213f0d --- /dev/null +++ b/package/rts @@ -0,0 +1,76 @@ +#!/bin/sh +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +umask 022 +[ -d package ] || barf "no package directory" +[ -d src ] || barf "no src directory" +[ -d compile ] || barf "no compile directory" +[ -d etc ] || barf "no etc directory" +[ -f `head -1 src/conf-tcpbin`/tcpserver ] || barf "tcpserver not installed" + +for i in `sed -e '/^it-/!d' -e 's/^it-//' < compile/it=d` +do + all="$all $i" +done +usage() { shout "usage: package/rts [ [-]$all ]"; exit 100; } + +targets="" +if [ $# -eq 0 ] +then + targets="$all" +else + if [ "$1" = "-" ] + then + shift + suppress=":" + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + suppress="$suppress$i:" + done + for i in $all + do + case "$suppress" in + *:$i:*) + ;; + *) + targets="$targets $i" + ;; + esac + done + else + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + targets="$targets $i" + done + fi +fi + +[ "X$all" != "X" ] && [ "X$targets" = "X" ] && usage + +here=`env - PATH=$PATH pwd` +safe cd compile +PATH="$here/compile:/command:$PATH" +export PATH +. $here/compile/rts.it > $here/compile/out.it 2>&1 +cat -v $here/compile/out.it | diff - $here/compile/exp.it +for i in $targets +do + . $here/compile/rts.$i 2>&1 | cat -v > $here/compile/out.$i + diff $here/compile/out.$i $here/compile/exp.$i +done diff --git a/package/run b/package/run new file mode 100755 index 0000000..e5b2428 --- /dev/null +++ b/package/run @@ -0,0 +1,71 @@ +#!/bin/sh -e + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} +home=`head -1 ${mypwd}/conf-home` + +bindir="" +if [ -f ${mypwd}/conf-home ] +then + bindir="${home}/bin" +fi + +sendmail=`which sendmail` +dir=`dirname ${sendmail}` + +if [ ${dir} != ${bindir} ] +then + if [ -L ${sendmail} ] + then + cd ${dir} + safe rm ${sendmail} + safe ln -s ${bindir}/sendmail sendmail + shout "Replaced system's sendmail with ${bindir}/sendmail" + cd ${mypwd} + else + cd ${dir} + safe mv sendmail sendmail_ + safe chmod 000 sendmail_ + safe ln -s ${bindir}/sendmail sendmail + shout "Replaced system's sendmail with ${bindir}/sendmail" + cd ${mypwd} + fi +fi + +aliasdir="" +if [ -f ${mypwd}/conf-home ] +then + aliasdir="${home}/alias" +fi +shout "Setting s/qmail alias-dir: ${aliasdir}" + +[ -d "${aliasdir}" ] || safe mkdir -p ${aliasdir} + +[ -f ${aliasdir}/.qmail-root ] || safe touch ${aliasdir}/.qmail-root +[ -f ${aliasdir}/.qmail-mailer-daemon ] || safe touch ${aliasdir}/.qmail-mailer-daemon +[ -f ${aliasdir}/.qmail-postmaster ] || safe touch ${aliasdir}/.qmail-postmaster + +if [ -f ${mypwd}/conf-delivery ] +then + defaultdelivery="`head -1 ${mypwd}/conf-delivery`" + if [ "x$defaultdelivery" = "x" ] + then + barf "No 'defaultdelivery' defined. Check conf-delivery." + fi + + if [ -f "${home}/svc/qmail-send/run" ] + then + safe cat ${home}/svc/qmail-send/run | \ + eval sed -e 's%./Maildir/%$defaultdelivery%' > run.delivery && \ + mv run.delivery ${home}/svc/qmail-send/run && \ + chmod +x ${home}/svc/qmail-send/run && \ + shout "Setting qmail-start default-delivery: $defaultdelivery" + fi +fi + +exit 0 diff --git a/package/scripts b/package/scripts new file mode 100755 index 0000000..1e92cd7 --- /dev/null +++ b/package/scripts @@ -0,0 +1,92 @@ +#!/bin/sh + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` +destination="`head -1 conf-home`/bin" +group="`head -1 conf-groups`" + +safe umask 022 +[ -d package ] || barf "no package directory" +[ -d scripts ] || barf "no src directory" + +for i in `sed -e '/^it-/!d' -e 's/^it-//' < scripts/it=d` +do + all="$all $i" +done + +other="`grep -v '^it-' scripts/it=d`" +usage() { shout "usage: package/scripts [ [-]$all ]"; exit 100; } + +targets="" +if [ $# -eq 0 ] +then + targets="$all" +else + if [ "$1" = "-" ] + then + shift + suppress=":" + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + suppress="$suppress$i:" + done + for i in $all + do + case "$suppress" in + *:$i:*) + ;; + *) + targets="$targets $i" + ;; + esac + done + else + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + targets="$targets $i" + done + fi +fi + +[ "X$all" != "X" ] && [ "X$targets" = "X" ] && usage + +commands="" +for i in $targets +do + commands="$commands `cat package/commands-$i`" +done + +safe cd scripts +safe make $other `echo "$targets" | sed -e 's/ / it-/g'` + +for i in $commands +do + i=${i%:} + safe rm -f command/$i'{new}' + safe cp -p scripts/$i command/$i'{new}' + safe mv -f command/$i'{new}' command/$i +done + +safe cd $here + +shout "s/qmail additional script files installed in $destination with RC=$rc." +shout "Note: Some of the scripts work only in a specific envrionment; ldap-pam requires PERL module 'Net::LDAP'." + +exit 0 diff --git a/package/service b/package/service new file mode 100755 index 0000000..7233fda --- /dev/null +++ b/package/service @@ -0,0 +1,83 @@ +#!/bin/sh + +shout() { echo "${0}: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +safe umask 022 +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} +home=`head -1 $mypwd/conf-home` +logdir=`head -1 $mypwd/conf-log` +svcdir=`head -1 $mypwd/conf-svcdir` +[ -d $home/control ] || barf "no control directory" + +nofiles=`grep auxiliar $mypwd/conf-ids | awk -F: '{print $2}'` +qmaill=`grep Log $mypwd/conf-ids | awk -F: '{print $2}'` + +[ -d ${svcdir} ] || barf "No /service directory available." +[ `which supervise` ] || barf "No supervise available. Skipping" +[ `which multilog` ] || log=0 + +for i in `sed -e '/^svc:/!d' -e 's/^svc://' < package/services=d` +do + all="$all $i" +done + +# Generate log service dir + +[ "X$logdir" = "X" ] || safe mkdir -p $logdir +[ -d $logdir ] && log=1 + +# Walks thru all configured services + +for i in $all +do + service=`echo $i | awk -F: '{print $1}'` + svcname=`echo $i | awk -F: '{print $2}'` + svc_run=`echo $i | awk -F: '{print $3}'` + +# Generate $home/svc dirs and populate + + [ ! -d /$home/svc/$svcname ] && \ + safe mkdir -p $home/svc/$svcname && \ + safe cat $mypwd/service/$svc_run \ + | eval sed -e 's}/var/qmail}$home}g' \ + > $home/svc/$svcname/run && \ + safe chmod +x $home/svc/$svcname/run && \ + safe touch $home/svc/$svcname/down && \ + shout "Created '$home/svc/$svcname' dir" + +# Generate logdir for services and set permissions + + [ ! -d $logdir/$svcname -a $log -eq 1 ] && \ + safe mkdir -p $logdir/$svcname && \ + shout "Created '$logdir/$svcname' dir" + + [ -d $logdir/$svcname -a $log -eq 1 ] && \ + safe chown $qmaill:$nofiles $logdir/$svcname && \ + shout "Set permissions for '$logdir/$svcname' dir" + +# Include log services + + [ ! -d /$home/svc/$svcname/log -a -d $logdir/$svcname -a $log -eq 1 ] && \ + safe mkdir -p $home/svc/$svcname/log && \ + safe cat $mypwd/service/run_log \ + | eval sed -e 's}qmaill}$qmaill}g' \ + -e 's}nofiles}$nofiles}g' \ + > $home/svc/$svcname/log/run && \ + safe chmod +x $home/svc/$svcname/log/run && \ + safe ln -s $logdir/$svcname $home/svc/$svcname/log/main && \ + shout "Created '$home/svc/$svcname/log' dir" + +# Put the service under supervise (/$svcdir) + + [ ! -d /$svcdir/$svcname ] && \ + safe ln -s $home/svc/$svcname /$svcdir/$svcname && \ + safe ln -s $home/control /$svcdir/$svcname/ctl && \ + shout "Created '/$svcdir/$svcname' dir -- still 'down'" + +done + +exit 0 diff --git a/package/services=d b/package/services=d new file mode 100644 index 0000000..6a7dac5 --- /dev/null +++ b/package/services=d @@ -0,0 +1,24 @@ +svc:send:qmail-send:run_send +svc:smtp:qmail-smtpd:run_smtpd +svc:smtps:qmail-smtpsd:run_smtpsd +svc:submission:qmail-smtpsub:run_smtpsub +svc:pop3:qmail-pop3d:run_pop3d +svc:pop3s:qmail-pop3sd:run_pop3sd +#svc:qmqp:qmail-qmqpd:run_qmqpd +#svc:qmtp:qmail-qmtpd:run_qmtpd +#svc:qmtps:qmail-qmtpsd:run_qmtpsd + +s/qmail supports those svc services listed after the fist colon. +The part after the second colon referes to the service-name of the +/service directory; eg. /service/qmail-send. + +After the the second colon follows the provided default +'run' script for the service. + +Logging will be automatically actived with the +service name under a common directory following the +'log' service; e.g. /var/log/qmail-send. + +Services mentioned here will be auto-generated. + +Lines without the initial token 'svc' will be disregarded. diff --git a/package/sslenv b/package/sslenv new file mode 100755 index 0000000..67cd601 --- /dev/null +++ b/package/sslenv @@ -0,0 +1,42 @@ +#!/bin/sh + +shout() { echo "${0}: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +safe umask 022 +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} +home=`head -1 $mypwd/conf-home` + +nofiles=`grep auxiliar $mypwd/conf-ids | awk -F: '{print $2}'` +sqmtls=`grep TLS $mypwd/conf-ids | awk -F: '{print $2}'` + +safe mkdir -p $home/ssl +safe chown $sqmtls:$nofiles $home/ssl + +ucspi=`head -1 $mypwd/conf-ucspissl` + +if [ -d $ucspi/etc ] +then + for i in `ls $ucspi/etc` + do + shout "Copying ucspi-ssl file '$i' to $home/ssl" + safe cp "$ucspi/etc/$i" "$home/ssl/$i" + safe chown $sqmtls:$nofiles "$home/ssl/$i" + done +else + barf "Can't find ucspi-ssl dir. Check 'conf-ucspissl'." +fi + +[ -f $mypwd/service/ssl.env ] && \ +safe cat $mypwd/service/ssl.env \ + | eval sed -e 's}QMAIL}$home}g' \ + -e 's}SQMTLS}$sqmtls}g' \ + -e 's}NOFILES}$nofiles}g' \ + > $home/ssl/ssl.env + +shout "Environment for s/qmail TLS defined in $home/ssl/ssl.env" + +exit 0 diff --git a/package/ucspissl b/package/ucspissl new file mode 100755 index 0000000..c59a07e --- /dev/null +++ b/package/ucspissl @@ -0,0 +1,34 @@ +#!/bin/sh +shout() { echo "${0}: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +here=`env - PATH=$PATH pwd` +mypwd=${here%package} +mypwd=${mypwd%/} + +sslfiles="conf-ssl compile/ssl.lib compile/ucspissl.a compile/ucspissl.h" + +home=`head -1 $mypwd/conf-ucspissl` +[ -d $mypwd/compile ] || safe mkdir -p $mypwd/compile + + +if [ -d $home ] +then + shout "Linking ucspi-ssl sources." + for sfile in `echo $sslfiles` + do + if [ -f $home/$sfile ] + then + rm -f "$mypwd/compile/$sfile" 2>/dev/null + safe ln -fs "$home/$sfile" "$mypwd/$sfile" + safe ls -l "$mypwd/$sfile" + else + barf "ucspi-ssl file $sfile missing. s/qmail won't compile." + fi + done +else + barf "Can't find ucspi-ssl dir. Check 'conf-ucspissl'." +fi + +exit 0 diff --git a/package/upgrade b/package/upgrade new file mode 100755 index 0000000..ff26087 --- /dev/null +++ b/package/upgrade @@ -0,0 +1,117 @@ +#!/bin/sh + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +safe umask 022 +[ -d package ] || barf "no package directory" +[ -d src ] || barf "no src directory" +[ -d compile ] || barf "no compile directory" + +for i in `sed -e '/^it-/!d' -e 's/^it-//' < compile/it=d` +do + all="$all $i" +done + +usage() { shout "usage: package/upgrade [ [-]$all ]"; exit 100; } + +targets="" +if [ $# -eq 0 ] +then + for i in $all + do + targets="$all" + done +else + if [ "$1" = "-" ] + then + shift + suppress=":" + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + suppress="$suppress$i:" + done + for i in $all + do + case "$suppress" in + *:$i:*) + ;; + *) + targets="$targets $i" + ;; + esac + done + else + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + targets="$targets $i" + done + fi +fi + +[ "X$targets" = "X" ] && barf "no targets" + +version="`head -1 package/version`" +here="`pwd`" +command="`echo $here | sed -e 's/-'$version'$//'`/command" +package="`basename $here | sed -e 's/-'$version'$//'`" +shout "symlink $package -> $package-$version" +safe rm -f $package +safe ln -s $package-$version $package +safe mv -f $package .. + +commands="" +for i in $targets +do + commands="$commands `cat package/commands-$i`" +done + +if [ -r package/command-cp ] +then + for i in `sed -e '/^$/q' < package/command-cp` + do + shout "copying commands into $i" + safe mkdir -p $i + for j in $commands + do + j=${j%:} + safe rm -f $i/$j'{new}' + safe cp -p command/$j $i/$j'{new}' + safe mv -f $i/$j'{new}' $i/$j + done + done +fi + +if [ -r package/command-ln ] +then + for i in `sed -e '/^$/q' < package/command-ln` + do + safe mkdir -p $i + for j in $commands + do + k=${j%:} + [ "$j" = "$k:" ] && \ + shout "linking command $k into $i" && \ + safe rm -f $i/$k'{new}' && \ + safe ln -s $command/$k $i/$k'{new}' && \ + safe mv -f $i/$k'{new}' $i/$k + done + done +fi + +exit 0 diff --git a/package/version b/package/version new file mode 100644 index 0000000..4be682d --- /dev/null +++ b/package/version @@ -0,0 +1 @@ +4.2.29a |