Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | [[ -f mailcow.conf ]] && source mailcow.conf |
| 4 | [[ -f ../mailcow.conf ]] && source ../mailcow.conf |
| 5 | |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 6 | 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) |
| 7 | 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) |
| 8 | NGINX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:${HTTPS_PORT} 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) |
| 9 | |
| 10 | echo "TLS expiry dates:" |
| 11 | echo "Postfix: ${POSTFIX}" |
| 12 | echo "Dovecot: ${DOVECOT}" |
| 13 | echo "Nginx: ${NGINX}" |