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 | |
| 6 | POSTFIX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:25 -starttls smtp 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) |
| 7 | DOVECOT=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:143 -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) |
| 8 | NGINX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:443 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2) |
| 9 | echo TLS expiry dates: |
| 10 | echo Postfix: ${POSTFIX} |
| 11 | echo Dovecot: ${DOVECOT} |
| 12 | echo Nginx: ${NGINX} |