[Postfix] Do not create a TLS SNI map when SKIP_LETS_ENCRYPT=y

master
andryyy 2021-01-08 12:39:40 +01:00
parent 79f8a3c2b5
commit ea98ac6442
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 15 additions and 11 deletions

View File

@ -25,17 +25,21 @@ EOF
newaliases; newaliases;
# create sni configuration # create sni configuration
echo -n "" > /opt/postfix/conf/sni.map; if [[ "${SKIP_LETS_ENCRYPT}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
for cert_dir in /etc/ssl/mail/*/ ; do echo -n "" > /opt/postfix/conf/sni.map
if [[ ! -f ${cert_dir}domains ]] || [[ ! -f ${cert_dir}cert.pem ]] || [[ ! -f ${cert_dir}key.pem ]]; then else
continue; echo -n "" > /opt/postfix/conf/sni.map;
fi for cert_dir in /etc/ssl/mail/*/ ; do
IFS=" " read -r -a domains <<< "$(cat "${cert_dir}domains")" if [[ ! -f ${cert_dir}domains ]] || [[ ! -f ${cert_dir}cert.pem ]] || [[ ! -f ${cert_dir}key.pem ]]; then
for domain in "${domains[@]}"; do continue;
echo -n "${domain} ${cert_dir}key.pem ${cert_dir}cert.pem" >> /opt/postfix/conf/sni.map; fi
echo "" >> /opt/postfix/conf/sni.map; IFS=" " read -r -a domains <<< "$(cat "${cert_dir}domains")"
for domain in "${domains[@]}"; do
echo -n "${domain} ${cert_dir}key.pem ${cert_dir}cert.pem" >> /opt/postfix/conf/sni.map;
echo "" >> /opt/postfix/conf/sni.map;
done
done done
done fi
postmap -F hash:/opt/postfix/conf/sni.map; postmap -F hash:/opt/postfix/conf/sni.map;
cat <<EOF > /opt/postfix/conf/sql/mysql_relay_ne.cf cat <<EOF > /opt/postfix/conf/sql/mysql_relay_ne.cf

View File

@ -255,7 +255,7 @@ services:
- dovecot - dovecot
postfix-mailcow: postfix-mailcow:
image: mailcow/postfix:1.58 image: mailcow/postfix:1.59
depends_on: depends_on:
- mysql-mailcow - mysql-mailcow
volumes: volumes: