added postfix certificate distribution

This commit is contained in:
andreas
2023-10-24 20:57:44 +00:00
parent b17b808404
commit f20896e21c
12 changed files with 184 additions and 17 deletions

12
ssl/create-postfix-certs Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/bash
export CN=$1
./create-key $CN
pushd certs
# The default algorithm is sha256 with Postfix ≥ 3.6 and the compatibility_level set to 3.6 or higher.
# With Postfix ≤ 3.5, the default algorithm is md5.
# https://www.postfix.org/postconf.5.html#relay_clientcerts
openssl x509 -in $CN.crt -noout -pubkey | openssl pkey -pubin -outform DER | openssl dgst -md5 -c | ( read D FP; echo $FP $CN ) >>relay_clientcerts
cp $CN.key ~/kopano-docker/etc-$CN/ssl/private
cp kopano-ca.crt ~/kopano-docker/etc-$CN/ssl/certs
cat kopano-ca.crt $CN.crt >~/kopano-docker/etc-$CN/ssl/$CN-full-chain.pem
popd