Getting Postfix statistics on TLS/SSL usage

My Postfix mail server is set up with opportunistic TLS. Is there a way to get some statistics on how many incoming and outgoing emails actually use TLS? It would be nice to know which of the domains that my mails server talks to support and don't support TLS as well.


Solution 1:

While smtpd_tls_loglevel enables logging of TLS information, it alone doesn't give readable statistics. The default Postfix logfile analyzer pflogsumm doesn't include any TLS statistics, but saftsumm --tls-stats (tool from Log-Saftpresse logfile analyzer) may provide just what you need.

Solution 2:

The loglevel smtpd_tls_loglevel is 0 by default, setting it to 1 should log basic TLS information.