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