From d11d3568036b7b99d4e2089da94e950aa418695f Mon Sep 17 00:00:00 2001 From: Sven Gottwald <2502366+svengo@users.noreply.github.com> Date: Fri, 3 Mar 2023 12:34:23 +0100 Subject: [PATCH 1/2] [Helper] Update expiry-dates.sh - Use port numbers from `mailcow.conf` instead of fixed port numbers - reformat output --- helper-scripts/expiry-dates.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/helper-scripts/expiry-dates.sh b/helper-scripts/expiry-dates.sh index 1554b709..ec2a63ae 100644 --- a/helper-scripts/expiry-dates.sh +++ b/helper-scripts/expiry-dates.sh @@ -3,10 +3,11 @@ [[ -f mailcow.conf ]] && source mailcow.conf [[ -f ../mailcow.conf ]] && source ../mailcow.conf -POSTFIX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:25 -starttls smtp 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) -DOVECOT=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:143 -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) -NGINX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:443 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) -echo TLS expiry dates: -echo Postfix: ${POSTFIX} -echo Dovecot: ${DOVECOT} -echo Nginx: ${NGINX} +POSTFIX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:${SMTP_PORT} -starttls smtp 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) +DOVECOT=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:${IMAP_PORT} -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) +NGINX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:${HTTPS_PORT} 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) + +echo "TLS expiry dates:" +echo "Postfix: ${POSTFIX}" +echo "Dovecot: ${DOVECOT}" +echo "Nginx: ${NGINX}" From d04f0257c254d0d0f45578588bb2b27b8de6974b Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Fri, 3 Mar 2023 12:41:24 +0100 Subject: [PATCH 2/2] Fixed permission for expiry-dates.sh --- helper-scripts/expiry-dates.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 helper-scripts/expiry-dates.sh diff --git a/helper-scripts/expiry-dates.sh b/helper-scripts/expiry-dates.sh old mode 100644 new mode 100755