Skip to content

Instantly share code, notes, and snippets.

@bigntallmike
Created September 8, 2020 14:44
Show Gist options
  • Save bigntallmike/7bf62727112d8ba0530d7dbbcbab0b71 to your computer and use it in GitHub Desktop.
Save bigntallmike/7bf62727112d8ba0530d7dbbcbab0b71 to your computer and use it in GitHub Desktop.
cd /var/qmail/control/notlshosts
cat /var/log/qmail/current \
| sed -n 's/.*\delivery \([0-9]\+\):.*TLS_connect_failed.*/\1/p' \
| xargs -n1 --replace={} grep "{}" /var/log/qmail/current \
| grep -B1 TLS \
| sed -n 's/.*to remote .*@\(.*\)/\1/p' \
| sort | uniq \
| xargs -n1 dnsqr mx \
| grep answer: | awk '{print $6}' \
| xargs -n1 touch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment