scripts/tls_stats.sh

11 lines
523 B
Bash
Raw Normal View History

2011-01-06 14:04:33 +01:00
#!/usr/bin/env bash
2011-01-06 14:21:38 +01:00
# Author: Oliver Ladner <oli@lugh.ch>
# License: LGPL
#
2011-01-06 14:04:33 +01:00
# greps mail.log for TLS debug loglines and displays sender count
# and cipher used.
MIN_MAILS=2
2011-01-06 15:37:57 +01:00
echo -e "Count\tCipher used\tSending domain"
echo "--------------------------------------"
zgrep 'Anonymous TLS connection established from' /var/log/mail.log* | sed -r 's/\[[0-9.]*\]://g' | awk {'print $15,$11'} | sort | uniq -c -i | while read line; do [[ $(grep -oE '^\s*[0-9]+' <<< $line) -gt $MIN_MAILS ]] && echo $line | tr -s ' ' '\t'; done