nix, shell, perl, php, mysql and mac os x tips and tricks

Saturday, August 13, 2016

grep mail.log for only sent emails

tail -1000 /var/log/mail.log | grep -E -o "\bto=<[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" | grep -v '[DOMAINS YOU WANT TO EXCLUDE]'

No comments:

Post a Comment