Skip to main content

List IPs by number of successful mail transactions

(2024-11-22)

for z in /var/log/maillog* ; do
  for i in `grep stat= $z | awk '{print $6}' | sort -u` ; do
    grep $i $z | grep 'Hello' | sed -e 's/^.*\[//' -e 's/\].*$//'
  done
done | sort | uniq -c | sort -nr