blob: ec2a63aedc231ad39f932be94e36620fbae0a394 [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001#!/usr/bin/env bash
2
3[[ -f mailcow.conf ]] && source mailcow.conf
4[[ -f ../mailcow.conf ]] && source ../mailcow.conf
5
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +01006POSTFIX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:${SMTP_PORT} -starttls smtp 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
7DOVECOT=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:${IMAP_PORT} -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
8NGINX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:${HTTPS_PORT} 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
9
10echo "TLS expiry dates:"
11echo "Postfix: ${POSTFIX}"
12echo "Dovecot: ${DOVECOT}"
13echo "Nginx: ${NGINX}"