From 89b7b67a13ebb7965cc7f13ad0595e2194a2d34c Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:48:04 +0200 Subject: add sqmail-4.2.29a --- package/sslenv | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 package/sslenv (limited to 'package/sslenv') 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 -- cgit v1.2.3